aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-02-03 00:21:17 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2018-02-03 00:35:09 +0100
commitc9d4238ad8e141591d8d3a70416a211422a85ac9 (patch)
treeb90826c1337dfa33dd310923058ab3978cb2465a /wee_slack.py
parentadd3dbd04576632a1d7c7bdbf695999ff87303cf (diff)
downloadwee-slack-c9d4238ad8e141591d8d3a70416a211422a85ac9.tar.gz
Don't add deleted users to the nicklist
This check was done when generating complete nicklist, but not when updating a single user. Deleted users are still part of the member list of a channel, if they don't leave the channel first. This caused a deleted user to be inserted into the nicklist when processing a joined channel message or when receiving a presence change for that user. When investigating this, I saw that we still receive presence change events for deleted users if we subscribe to them. We might want to filter out the deleted users when generating the list of users to subscribe to.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 516a2a9..9d06bf3 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1557,6 +1557,8 @@ class SlackChannel(object):
if user and len(self.members) < 1000:
user = self.team.users[user]
+ if user.deleted:
+ return
nick = w.nicklist_search_nick(self.channel_buffer, "", user.name)
# since this is a change just remove it regardless of where it is
w.nicklist_remove_nick(self.channel_buffer, nick)