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

wrap_message: expand UID targets into nicks before processing (#153)

This commit is contained in:
James Lu 2018-05-11 14:46:47 -07:00
parent 244c4fe0eb
commit 73322bd9ba

View File

@ -1872,6 +1872,12 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
For IRC, the maximum length of one message is calculated as S2S_BUFSIZE (default to 510)
minus the length of ":sender-nick!sender-user@sender-host PRIVMSG #target :"
"""
try:
target = self.get_friendly_name(target)
except KeyError:
log.warning('(%s) Possible desync? Error while expanding wrap_message target %r '
'(source=%s)', self.name, target, source, exc_info=True)
prefixstr = ":%s PRIVMSG %s :" % (self.get_hostmask(source), target)
maxlen = self.S2S_BUFSIZE - len(prefixstr)