add /search command (#6741)

This commit is contained in:
Chris
2017-07-04 18:26:31 -07:00
committed by Saturnino Abril
parent 8f8a978e84
commit 5bd60a4d1e
4 changed files with 75 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import * as ChannelUtils from 'utils/channel_utils.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import * as PostActions from 'actions/post_actions.jsx';
import {loadProfilesForSidebar, loadNewDMIfNeeded, loadNewGMIfNeeded} from 'actions/user_actions.jsx';
import {trackEvent} from 'actions/diagnostics_actions.jsx';
@@ -57,6 +58,9 @@ export function executeCommand(message, args, success, error) {
msg = cmd + msg.substring(cmdLength, msg.length);
switch (cmd) {
case '/search':
PostActions.searchForTerm(msg.substring(cmdLength + 1, msg.length));
return;
case '/shortcuts':
if (UserAgent.isMobile()) {
const err = {message: Utils.localizeMessage('create_post.shortcutsNotSupported', 'Keyboard shortcuts are not supported on your device')};