summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorAlexander Smaga <smagaan@gmail.com>2016-10-26 15:20:45 +0300
committerChristopher Speller <crspeller@gmail.com>2016-10-26 08:20:45 -0400
commitb354d25d3731b53613489d95cfa4c946cf8e0888 (patch)
treeb1e11d3c9eef60cd9d8bd7a51b16dc49cff01af7 /webapp/actions
parent66ed155a58b6f0f365db26fa9e4e605d3d4a61a2 (diff)
downloadchat-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.jsx14
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]);
+}