3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

clientbot: only send AWAY when polling if the message has changed

This commit is contained in:
James Lu 2016-07-26 23:30:26 -07:00
parent fca23c7d55
commit 4002fb9da5

View File

@ -103,11 +103,13 @@ class ClientbotWrapperProtocol(Protocol):
def away(self, source, text):
"""STUB: sets away messages for clients internally."""
log.debug('(%s) away: target is %s, internal client? %s', self.irc.name, source, self.irc.isInternalClient(source))
if not self.irc.isInternalClient(source):
log.debug('(%s) away: sending AWAY hook from %s with text %r', self.irc.name, source, text)
self.irc.callHooks([source, 'AWAY', {'text': text}])
self.irc.users[source].away = text
if self.irc.users[source].away != text:
if not self.irc.isInternalClient(source):
log.debug('(%s) away: sending AWAY hook from %s with text %r', self.irc.name, source, text)
self.irc.callHooks([source, 'AWAY', {'text': text}])
self.irc.users[source].away = text
def invite(self, client, target, channel):
"""Invites a user to a channel."""