aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2017-11-20 16:42:16 +0000
committerAlyssa Ross <hi@alyssa.is>2017-11-20 16:42:16 +0000
commit1efb45bc0a6010f2a9b0727e66d5992e12b2fa18 (patch)
treef3fed688e500d8a69f710067825276eb053daf64 /wee_slack.py
parentdd20dde884e2153da36f2d4253614ab053c6cbe4 (diff)
downloadwee-slack-1efb45bc0a6010f2a9b0727e66d5992e12b2fa18.tar.gz
Don't show closed group DMs
Group DMs shouldn't be displayed just because `is_member` is `True`, because it always will be. Instead, if a channel/DM/whatever has an `is_open` property, use that, and only fall back to `is_member` when `is_open` isn't present (such as for channels).
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 8a50b87..b552829 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1251,7 +1251,10 @@ class SlackChannel(object):
self.create_buffer()
return
- if (hasattr(self, "is_member") and self.is_member) or self.is_open or self.unread_count_display:
+ # Only check is_member if is_open is not set, because in some cases
+ # (e.g. group DMs), is_member should be ignored in favor of is_open.
+ is_open = self.is_open if hasattr(self, "is_open") else self.is_member
+ if is_open or self.unread_count_display:
self.create_buffer()
if config.background_load_all_history:
self.get_history(slow_queue=True)