diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-04-20 08:47:02 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-05-30 21:11:27 +0200 |
commit | 3139195dcf5788a8bb66631657a313065ae52aee (patch) | |
tree | d0bd0402843b71fc3d6b70be323c2e2d01a22c84 | |
parent | 8d39f3c16620a4c3e584cab653119dd7aa2da45f (diff) | |
download | wee-slack-3139195dcf5788a8bb66631657a313065ae52aee.tar.gz |
Reload history in current channel on reconnect if background_load_all_history is off
-rw-r--r-- | wee_slack.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py index 3f30373..ece9716 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1445,10 +1445,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 and config.background_load_all_history: - for channel in self.channels.values(): - if channel.channel_buffer: - channel.get_history(slow_queue=True) + 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) def set_disconnected(self): w.unhook(self.hook) |