Try harder to identify previously-posted announcements.
authorCMDR furrycat <elite@furrycat.net>
Fri, 11 Nov 2016 11:09:01 +0000 (11:09 +0000)
committerCMDR furrycat <elite@furrycat.net>
Fri, 11 Nov 2016 11:09:01 +0000 (11:09 +0000)
plugin/announcements/announcements.py

index f7c76bf..ec47595 100644 (file)
@@ -830,7 +830,7 @@ class Announcements(DBConnection):
           logs = yield from client.logs_from(channel, limit = bot.get('message_limit'))
         for message in logs:
           raw = re.sub(r'^(<?@\S+\s)+', '', message.content).strip()
-          if bot.digest(raw) == digest:
+          if digest in [bot.digest(message.content), bot.digest(raw)]:
             log.debug('Saw previously posted announcement {} with digest {}'.format(announcement['id'], digest))
             already_posted = True
             break