diff options
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/client.jsx | 7 | ||||
-rw-r--r-- | web/react/utils/constants.jsx | 50 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 5 |
3 files changed, 37 insertions, 25 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index 09e962161..5d02a8c88 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -590,7 +590,12 @@ export function updateChannel(channel, success, error) { track('api', 'api_channels_update'); } -export function updateChannelHeader(data, success, error) { +export function updateChannelHeader(channelId, header, success, error) { + const data = { + channel_id: channelId, + channel_header: header + }; + $.ajax({ url: '/api/v1/channels/update_header', dataType: 'json', diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index 891bc4624..5f027a409 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -35,6 +35,7 @@ export default { RECIEVED_AUDITS: null, RECIEVED_TEAMS: null, RECIEVED_STATUSES: null, + RECIEVED_PREFERENCE: null, RECIEVED_PREFERENCES: null, RECIEVED_MSG: null, @@ -74,7 +75,8 @@ export default { NEW_USER: 'new_user', USER_ADDED: 'user_added', USER_REMOVED: 'user_removed', - TYPING: 'typing' + TYPING: 'typing', + PREFERENCE_CHANGED: 'preference_changed' }, //SPECIAL_MENTIONS: ['all', 'channel'], @@ -164,29 +166,6 @@ export default { UPDATE_TYPING_MS: 5000, THEMES: { default: { - type: 'Mattermost', - sidebarBg: '#fafafa', - sidebarText: '#333333', - sidebarUnreadText: '#333333', - sidebarTextHoverBg: '#e6f2fa', - sidebarTextActiveBorder: '#378FD2', - sidebarTextActiveColor: '#111111', - sidebarHeaderBg: '#2389d7', - sidebarHeaderTextColor: '#ffffff', - onlineIndicator: '#7DBE00', - mentionBj: '#2389d7', - mentionColor: '#ffffff', - centerChannelBg: '#ffffff', - centerChannelColor: '#333333', - newMessageSeparator: '#FF8800', - linkColor: '#2389d7', - buttonBg: '#2389d7', - buttonColor: '#FFFFFF', - mentionHighlightBg: '#fff2bb', - mentionHighlightLink: '#2f81b7', - codeTheme: 'github' - }, - organization: { type: 'Organization', sidebarBg: '#2071a7', sidebarText: '#fff', @@ -209,6 +188,29 @@ export default { mentionHighlightLink: '#2f81b7', codeTheme: 'github' }, + mattermost: { + type: 'Mattermost', + sidebarBg: '#fafafa', + sidebarText: '#333333', + sidebarUnreadText: '#333333', + sidebarTextHoverBg: '#e6f2fa', + sidebarTextActiveBorder: '#378FD2', + sidebarTextActiveColor: '#111111', + sidebarHeaderBg: '#2389d7', + sidebarHeaderTextColor: '#ffffff', + onlineIndicator: '#7DBE00', + mentionBj: '#2389d7', + mentionColor: '#ffffff', + centerChannelBg: '#ffffff', + centerChannelColor: '#333333', + newMessageSeparator: '#FF8800', + linkColor: '#2389d7', + buttonBg: '#2389d7', + buttonColor: '#FFFFFF', + mentionHighlightBg: '#fff2bb', + mentionHighlightLink: '#2f81b7', + codeTheme: 'github' + }, mattermostDark: { type: 'Mattermost Dark', sidebarBg: '#1B2C3E', diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index c2e4276b0..fb8b89252 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1138,6 +1138,11 @@ export function getUserIdFromChannelName(channel) { return otherUserId; } +// Returns true if the given channel is a direct channel between the current user and the given one +export function isDirectChannelForUser(otherUserId, channel) { + return channel.type === Constants.DM_CHANNEL && getUserIdFromChannelName(channel) === otherUserId; +} + export function importSlack(file, success, error) { var formData = new FormData(); formData.append('file', file, file.name); |