aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-10-05 21:42:54 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2020-10-05 21:42:54 +0200
commitaacf64e617a4f82f95fd5199f3e5528e846aede5 (patch)
treeb2ea7dc41d2ec1ec8d545e93ff174d2f39a006f9
parent1655b26e8ade77ed56a6a94157a859aa69cfad26 (diff)
downloadwee-slack-aacf64e617a4f82f95fd5199f3e5528e846aede5.tar.gz
Remove unnecessary team parameter in SlackMessage init
-rw-r--r--wee_slack.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/wee_slack.py b/wee_slack.py
index ca6339e..9f09f7e 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2720,8 +2720,8 @@ class SlackMessage(object):
Note: these can't be tied to a SlackUser object because users
can be deleted, so we have to store sender in each one.
"""
- def __init__(self, subtype, message_json, team, channel):
- self.team = team
+ def __init__(self, subtype, message_json, channel):
+ self.team = channel.team
self.channel = channel
self.subtype = subtype
self.user_identifier = message_json.get('user')
@@ -3352,7 +3352,7 @@ def process_message(message_json, eventrouter, team, channel, metadata, history_
elif subtype in subtype_functions:
message = subtype_functions[subtype](message_json, eventrouter, team, channel, history_message)
else:
- message = SlackMessage(subtype or "normal", message_json, team, channel)
+ message = SlackMessage(subtype or "normal", message_json, channel)
channel.store_message(message)
channel.unread_count_display += 1
@@ -3405,7 +3405,7 @@ def download_files(message_json, team):
def subprocess_thread_message(message_json, eventrouter, team, channel, history_message):
parent_ts = SlackTS(message_json['thread_ts'])
- message = SlackThreadMessage(channel, parent_ts, message_json, team, channel)
+ message = SlackThreadMessage(channel, parent_ts, message_json, channel)
parent_message = message.parent_message
if parent_message and message.ts not in parent_message.submessages:
@@ -3431,21 +3431,21 @@ subprocess_thread_broadcast = subprocess_thread_message
def subprocess_channel_join(message_json, eventrouter, team, channel, history_message):
- message = SlackMessage("join", message_json, team, channel)
+ message = SlackMessage("join", message_json, channel)
channel.store_message(message)
channel.user_joined(message_json["user"])
return message
def subprocess_channel_leave(message_json, eventrouter, team, channel, history_message):
- message = SlackMessage("leave", message_json, team, channel)
+ message = SlackMessage("leave", message_json, channel)
channel.store_message(message)
channel.user_left(message_json["user"])
return message
def subprocess_channel_topic(message_json, eventrouter, team, channel, history_message):
- message = SlackMessage("topic", message_json, team, channel)
+ message = SlackMessage("topic", message_json, channel)
channel.store_message(message)
channel.set_topic(message_json["topic"])
return message