3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

clientbot: add STATUSMSG support (#570)

This commit is contained in:
James Lu 2018-02-18 22:11:46 -08:00
parent 81bd1e8474
commit 37be73d39c
2 changed files with 8 additions and 1 deletions

View File

@ -1033,7 +1033,8 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
log.warning('(%s) Received %s to %s being routed the wrong way!', self.name, command, target) log.warning('(%s) Received %s to %s being routed the wrong way!', self.name, command, target)
return return
if not self.is_channel(target): real_target = target.lstrip(''.join(self.prefixmodes.values()))
if not self.is_channel(real_target):
target = self.nick_to_uid(target) target = self.nick_to_uid(target)
if target: if target:

View File

@ -318,6 +318,12 @@ class IRCCommonProtocol(IRCNetwork):
self.umodes['callerid'] = newcaps.get('CALLERID') or 'g' self.umodes['callerid'] = newcaps.get('CALLERID') or 'g'
log.debug('(%s) handle_005: got umode callerid=%r', self.name, self.umodes['callerid']) log.debug('(%s) handle_005: got umode callerid=%r', self.name, self.umodes['callerid'])
if 'STATUSMSG' in newcaps:
# Note: This assumes that all available prefixes can be used in STATUSMSG too.
# Even though this isn't always true, I don't see the point in making things
# any more complicated.
self.protocol_caps |= {'has-statusmsg'}
def _send_with_prefix(self, source, msg, **kwargs): def _send_with_prefix(self, source, msg, **kwargs):
"""Sends a RFC1459-style raw command from the given sender.""" """Sends a RFC1459-style raw command from the given sender."""
self.send(':%s %s' % (self._expandPUID(source), msg), **kwargs) self.send(':%s %s' % (self._expandPUID(source), msg), **kwargs)