diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-06-12 00:55:42 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-06-12 00:55:42 +0200 |
commit | 5cf4b2414ebdafb15c745c70bd8448eb113f6fd0 (patch) | |
tree | 018f92415cd1f4aec07184cbc373857ede5db945 /wee_slack.py | |
parent | 406e5a06d3b2cde9b337126ed832aa0e26f7ccea (diff) | |
download | wee-slack-5cf4b2414ebdafb15c745c70bd8448eb113f6fd0.tar.gz |
Move common destroy_buffer code to SlackChannelCommon
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/wee_slack.py b/wee_slack.py index 971e9a3..d884dce 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1705,6 +1705,11 @@ class SlackChannelCommon(object): self.eventrouter.receive(s) self.new_messages = False + def destroy_buffer(self, update_remote): + self.channel_buffer = None + self.got_history = False + self.active = False + class SlackChannel(SlackChannelCommon): """ @@ -1918,10 +1923,8 @@ class SlackChannel(SlackChannelCommon): self.eventrouter.receive(s) def destroy_buffer(self, update_remote): + super(SlackChannel, self).destroy_buffer(update_remote) self.messages = OrderedDict() - self.got_history = False - self.channel_buffer = None - self.active = False if update_remote and not self.eventrouter.shutting_down: s = SlackRequest(self.team, self.team.slack_api_translator[self.type]["leave"], {"channel": self.identifier}, channel=self) @@ -2553,9 +2556,7 @@ class SlackThreadChannel(SlackChannelCommon): w.buffer_set(self.channel_buffer, "title", topic) def destroy_buffer(self, update_remote): - self.channel_buffer = None - self.got_history = False - self.active = False + super(SlackThreadChannel, self).destroy_buffer(update_remote) if update_remote and not self.eventrouter.shutting_down: self.mark_read() |