summaryrefslogtreecommitdiffstats
path: root/webapp/actions/channel_actions.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions/channel_actions.jsx')
-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]);
+}