aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorErik Johnson <palehose@gmail.com>2016-04-12 22:54:32 -0500
committerErik Johnson <palehose@gmail.com>2016-04-12 22:54:32 -0500
commit0ba84188a60fead89a856b946a176e9f75b0f385 (patch)
treecf32d05876830a1f5968d34dadaa06f65f0cbba8 /wee_slack.py
parentfabd8894affd8b823924cf3366cf8088bb281b26 (diff)
downloadwee-slack-0ba84188a60fead89a856b946a176e9f75b0f385.tar.gz
Remove unnecessary channels.join API request
There are two problems with this API request: 1. According to https://api.slack.com/methods/channels.join, "user" is not a valid argument. 2. The hash table lookup in the removed line of code is destined to fail anyway, because ``self.name`` here refers to the channel name, which is not present in the ``users`` SearchList() instance as it maps usernames to the Slack API user IDs. Indeed, this causes the call to ``users.find(self.name)`` to return ``None``, causing an AttributeError to be raised. Fixes #190.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 4164f9d..973eb05 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -553,7 +553,6 @@ class Channel(object):
if update_remote:
if "join" in SLACK_API_TRANSLATOR[self.type]:
async_slack_api_request(self.server.domain, self.server.token, SLACK_API_TRANSLATOR[self.type]["join"], {"name": self.name.lstrip("#")})
- async_slack_api_request(self.server.domain, self.server.token, SLACK_API_TRANSLATOR[self.type]["join"], {"user": users.find(self.name).identifier})
def close(self, update_remote=True):
#remove from cache so messages don't reappear when reconnecting