aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2015-06-26 01:38:47 +0200
committerTollef Fog Heen <tfheen@err.no>2015-06-26 01:38:47 +0200
commitd301799f0440da04691532176f5b395bd0ece33b (patch)
treeca1d48e26d88c6b1be4039c1dab867f5c1bd2cfc /wee_slack.py
parent491f5ee488f1b0decda7f335e39a09d7b703aa3e (diff)
downloadwee-slack-d301799f0440da04691532176f5b395bd0ece33b.tar.gz
Ignore deleted users when constructing nicklist
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 57df9cd..a6f1e21 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -297,7 +297,7 @@ class SlackServer(object):
def create_slack_mappings(self, data):
for item in data["users"]:
- self.users.append(User(self, item["name"], item["id"], item["presence"]))
+ self.users.append(User(self, item["name"], item["id"], item["presence"], item["deleted"]))
for item in data["channels"]:
if "last_read" not in item:
@@ -424,6 +424,8 @@ class Channel(SlackThing):
try:
for user in self.members:
user = self.server.users.find(user)
+ if user.deleted:
+ continue
if user.presence == 'away':
w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, " ", "", 1)
else:
@@ -666,9 +668,10 @@ class DmChannel(Channel):
class User(SlackThing):
- def __init__(self, server, name, identifier, presence="away"):
+ def __init__(self, server, name, identifier, presence="away", deleted=False):
super(User, self).__init__(name, identifier)
self.channel_buffer = w.info_get("irc_buffer", "{}.{}".format(domain, self.name))
+ self.deleted = deleted
self.presence = presence
self.server = server
self.update_color()