aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-05-21 00:49:33 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2020-05-21 13:03:36 +0200
commitccd8afed92c6b72b03bdd87c61fd11479f3d89d3 (patch)
tree55084ab634d902bfde342db0fc6728a87fe482a9
parent56fc83d731b1a6de130bb9bb4675c6fab248e4c0 (diff)
downloadwee-slack-ccd8afed92c6b72b03bdd87c61fd11479f3d89d3.tar.gz
Remove get_members method, use members attribute
Lots of places used members instead of get_members, and it's inconvenient having to call a function anyways.
-rw-r--r--wee_slack.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/wee_slack.py b/wee_slack.py
index fe6d128..f730801 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1390,7 +1390,7 @@ class SlackTeam(object):
def find_channel_by_members(self, members, channel_type=None):
for channel in self.channels.values():
- if channel.get_members() == members and (
+ if channel.members == members and (
channel_type is None or channel.type == channel_type):
return channel
@@ -1715,9 +1715,6 @@ class SlackChannel(SlackChannelCommon):
self.members = set(members)
self.update_nicklist()
- def get_members(self):
- return self.members
-
def set_unread_count_display(self, count):
self.unread_count_display = count
self.new_messages = bool(self.unread_count_display)
@@ -2079,6 +2076,7 @@ class SlackDMChannel(SlackChannel):
self.type = 'im'
self.update_color()
self.set_name(self.slack_name)
+ self.members = {self.user}
if dmuser in users:
self.set_topic(create_user_status_string(users[dmuser].profile))
@@ -2091,9 +2089,6 @@ class SlackDMChannel(SlackChannel):
def set_name(self, slack_name):
self.name = slack_name
- def get_members(self):
- return {self.user}
-
def create_buffer(self):
if not self.channel_buffer:
super(SlackDMChannel, self).create_buffer()