diff options
author | Alexander Smaga <smagaan@gmail.com> | 2016-10-26 15:20:45 +0300 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-10-26 08:20:45 -0400 |
commit | b354d25d3731b53613489d95cfa4c946cf8e0888 (patch) | |
tree | b1e11d3c9eef60cd9d8bd7a51b16dc49cff01af7 /webapp/actions | |
parent | 66ed155a58b6f0f365db26fa9e4e605d3d4a61a2 (diff) | |
download | chat-b354d25d3731b53613489d95cfa4c946cf8e0888.tar.gz chat-b354d25d3731b53613489d95cfa4c946cf8e0888.tar.bz2 chat-b354d25d3731b53613489d95cfa4c946cf8e0888.zip |
GH-4095 Favorite/Starred Channels (#4222)
Diffstat (limited to 'webapp/actions')
-rw-r--r-- | webapp/actions/channel_actions.jsx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx index 61c839652..c9c4e6883 100644 --- a/webapp/actions/channel_actions.jsx +++ b/webapp/actions/channel_actions.jsx @@ -172,3 +172,17 @@ export function openDirectChannelToUser(user, success, error) { } ); } + +export function markFavorite(channelId) { + AsyncClient.savePreference(Preferences.CATEGORY_FAVORITE_CHANNEL, channelId, 'true'); +} + +export function unmarkFavorite(channelId) { + const pref = { + user_id: UserStore.getCurrentId(), + category: Preferences.CATEGORY_FAVORITE_CHANNEL, + name: channelId + }; + + AsyncClient.deletePreferences([pref]); +} |