diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-07-27 15:06:59 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-07-27 15:06:59 -0700 |
commit | ce087595ecd01e86c28862c90291e3bf746bdd64 (patch) | |
tree | e9dfe97015f6c3ec9c992ef3845f456fff9e2f5b /wee_slack.py | |
parent | 48988c464e54bad25323487bc875f0f3d88b9b24 (diff) | |
download | wee-slack-ce087595ecd01e86c28862c90291e3bf746bdd64.tar.gz |
fix message editing/deletion
Diffstat (limited to 'wee_slack.py')
-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 a3d69c5..c50a90f 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -629,9 +629,9 @@ class Channel(object): async_slack_api_request(self.server.domain, self.server.token, 'chat.update', {"channel": self.identifier, "ts": message['ts'], "text": new_message}) def my_last_message(self): - for message in reversed(message_cache[self.identifier]): - if "user" in message and "text" in message and message["user"] == self.server.users.find(self.server.nick).identifier: - return message + for message in reversed(self.messages): + if "user" in message.message_json and "text" in message.message_json and message.message_json["user"] == self.server.users.find(self.server.nick).identifier: + return message.message_json def cache_message(self, message_json, from_me=False): if from_me: |