diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-04-11 10:46:55 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-06-02 23:09:20 +0200 |
commit | dd8af07d945e5bf0862dc14740349917ffdddfbd (patch) | |
tree | 59295905b7740e04636035541b7700013cf3c3a5 | |
parent | d47b5cd6776696d30aed6deecd78a907620baa47 (diff) | |
download | wee-slack-dd8af07d945e5bf0862dc14740349917ffdddfbd.tar.gz |
Remove force_backlog from buffer_prnt
The "getting channel history" message doesn't need any of the logic in
buffer_prnt, so by printing it directly, we can drop this argument.
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py index 5772df4..624c411 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1662,7 +1662,7 @@ class SlackChannel(SlackChannelCommon): s = SlackRequest(self.team.token, SLACK_API_TRANSLATOR[self.type]["leave"], {"channel": self.identifier}, team_hash=self.team.team_hash, channel_identifier=self.identifier) self.eventrouter.receive(s) - def buffer_prnt(self, nick, text, timestamp=str(time.time()), tagset=None, tag_nick=None, force_backlog=None, **kwargs): + def buffer_prnt(self, nick, text, timestamp=str(time.time()), tagset=None, tag_nick=None, **kwargs): data = "{}\t{}".format(format_nick(nick, self.last_line_from), text) self.last_line_from = nick ts = SlackTS(timestamp) @@ -1680,7 +1680,7 @@ class SlackChannel(SlackChannelCommon): tagset = "default" self_msg = tag_nick == self.team.nick - tags = tag(tagset, user=tag_nick, self_msg=self_msg, backlog=backlog or force_backlog) + tags = tag(tagset, user=tag_nick, self_msg=self_msg, backlog=backlog) if not self_msg: self.new_messages = True @@ -1735,7 +1735,7 @@ class SlackChannel(SlackChannelCommon): # we have probably reconnected. flush the buffer if self.team.connected: self.clear_messages() - self.buffer_prnt('', 'getting channel history...', force_backlog=True) + w.prnt_date_tags(self.channel_buffer, SlackTS().major, tag('default', backlog=True), '\tgetting channel history...') s = SlackRequest(self.team.token, SLACK_API_TRANSLATOR[self.type]["history"], {"channel": self.identifier, "count": BACKLOG_SIZE}, team_hash=self.team.team_hash, channel_identifier=self.identifier, clear=True) if not slow_queue: self.eventrouter.receive(s) |