diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-04-22 18:35:13 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-05-30 21:13:20 +0200 |
commit | 93d6ba7de163271e7a39b07643b41d1bcc7c25f8 (patch) | |
tree | 0bc240f7fc1c47350a0a72fc5453740666a4d6c4 | |
parent | d17f96a49997295904365dd52344b29609af3c93 (diff) | |
download | wee-slack-93d6ba7de163271e7a39b07643b41d1bcc7c25f8.tar.gz |
Load history for current buffer after connecting
If you have a stored layout so one of the wee-slack buffers gets
switched to when it's created, the history for that channel wouldn't be
loaded until you switched buffers if background_load_all_history was
off.
-rw-r--r-- | wee_slack.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/wee_slack.py b/wee_slack.py index fa1afac..66e2e4b 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1451,15 +1451,15 @@ class SlackTeam(object): self.buffer_prnt('Connected to Slack team {} ({}) with username {}'.format( self.team_info["name"], self.domain, self.nick)) dbg("connected to {}".format(self.domain)) - if reconnect: - if config.background_load_all_history: - for channel in self.channels.values(): - if channel.channel_buffer: - channel.get_history(slow_queue=True) - else: - current_channel = self.eventrouter.weechat_controller.buffers.get(w.current_buffer()) - if isinstance(current_channel, SlackChannelCommon) and current_channel.team == self: - current_channel.get_history(slow_queue=True) + + if not config.background_load_all_history: + current_channel = self.eventrouter.weechat_controller.buffers.get(w.current_buffer()) + if isinstance(current_channel, SlackChannelCommon) and current_channel.team == self: + current_channel.get_history(slow_queue=True) + elif reconnect: + for channel in self.channels.values(): + if channel.channel_buffer: + channel.get_history(slow_queue=True) def set_disconnected(self): w.unhook(self.hook) |