diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-02-06 12:54:28 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2017-02-06 12:54:28 -0800 |
commit | 9e666945fc81f4220efffe79b3202ae39acd60e5 (patch) | |
tree | c09f887008d60a5ccfbd0adf2d13300285c8c802 /wee_slack.py | |
parent | 52a7c943e3a034959e0c196e188dadaad2f45dca (diff) | |
download | wee-slack-9e666945fc81f4220efffe79b3202ae39acd60e5.tar.gz |
print a message when getting history
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index c2ac5a6..b7f4f20 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1115,7 +1115,7 @@ class SlackChannel(object): if self.team.connected: w.buffer_clear(self.channel_buffer) self.buffer_prnt('', 'getting channel history...', tagset='backlog') - 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) + 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) self.eventrouter.receive(s) self.got_history = True def send_add_reaction(self, msg_number, reaction): @@ -1725,7 +1725,14 @@ def handle_history(message_json, eventrouter, **kwargs): request_metadata = pickle.loads(message_json["wee_slack_request_metadata"]) kwargs['team'] = eventrouter.teams[request_metadata.team_hash] kwargs['channel'] = kwargs['team'].channels[request_metadata.channel_identifier] + try: + clear = request_metadata.clear + except: + clear = False + print clear kwargs['output_type'] = "backlog" + if clear: + w.buffer_clear(kwargs['channel'].channel_buffer) for message in reversed(message_json["messages"]): process_message(message, eventrouter, **kwargs) |