Commits

nakamura committed 5a4e194

tai.service.irc: fix can't update bookmarks when message is DM and sent by this user

Comments (0)

Files changed (1)

tai/service/irc.py

 
             if message.id is not None and hasattr(message, 'receivers'):
                 for receiver in message.receivers:
-                    if receiver.startswith(('#', '&')):
+                    if receiver.startswith(('#', '&')) or \
+                       message.nick == self.nickname:
+                        # message for channels
+                        # or direct message sent from this user
+
                         assert receiver in self.avatar.user.channels and \
                                 self.avatar.user.channels[receiver].messages.maxId >= message.id
 
 
                     elif receiver == self.nickname:
                         # direct message
+
                         # Channel object for direct message is stored
                         # by sender's name, not receiver
                         assert message.nick in self.avatar.user.channels and \