From 4bc625e8d10ab7735b76814fe9bbf3fb9144d4e1 Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Tue, 22 Sep 2015 12:00:34 -0400
Subject: Added 'default' option to channel notification settings that just
 uses the user's notification level

---
 web/react/components/sidebar.jsx | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

(limited to 'web/react/components/sidebar.jsx')

diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 6033f200f..bc66ee03c 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -200,13 +200,17 @@ export default class Sidebar extends React.Component {
                 }
                 var channel = ChannelStore.get(msg.channel_id);
 
-                var user = UserStore.getCurrentUser();
-                if (user.notify_props && ((user.notify_props.desktop === 'mention' && mentions.indexOf(user.id) === -1 && channel.type !== 'D') || user.notify_props.desktop === 'none')) {
-                    return;
+                const user = UserStore.getCurrentUser();
+                const member = ChannelStore.getMember(msg.channel_id);
+
+                var notifyLevel = member.notify_level;
+                if (notifyLevel === 'default') {
+                    notifyLevel = user.notify_props.desktop;
                 }
 
-                var member = ChannelStore.getMember(msg.channel_id);
-                if ((member.notify_level === 'mention' && mentions.indexOf(user.id) === -1) || member.notify_level === 'none' || member.notify_level === 'quiet') {
+                if (notifyLevel === 'none') {
+                    return;
+                } else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channel.type !== 'D') {
                     return;
                 }
 
-- 
cgit v1.2.3-1-g7c22

