summaryrefslogtreecommitdiff
path: root/crocoite
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-03-05 15:22:41 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-03-05 15:22:41 +0100
commit691c2d2c115278b43dd7e99523c114fb57c13fae (patch)
tree0707867261e835531d0fa95f380420cea4c058a9 /crocoite
parent047c3dbc9871ce93a26057ba339efb7c53724910 (diff)
downloadcrocoite-691c2d2c115278b43dd7e99523c114fb57c13fae.tar.gz
crocoite-691c2d2c115278b43dd7e99523c114fb57c13fae.tar.bz2
crocoite-691c2d2c115278b43dd7e99523c114fb57c13fae.zip
irc: Fix NAMES reply handling
User list may be send using multiple reply messages if too long. Do not overwrite the previous one.
Diffstat (limited to 'crocoite')
-rw-r--r--crocoite/irc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/crocoite/irc.py b/crocoite/irc.py
index 1f06158..0303675 100644
--- a/crocoite/irc.py
+++ b/crocoite/irc.py
@@ -258,7 +258,12 @@ class ArgparseBot (bottom.Client):
# no need for NAMES here, server sends this automatically
async def onNameReply (self, target, channel_type, channel, users, **kwargs):
- self.users[channel] = dict (map (lambda x: (x.name, x), map (User.fromName, users)))
+ # channels may be too big for a single message
+ addusers = dict (map (lambda x: (x.name, x), map (User.fromName, users)))
+ if channel not in self.users:
+ self.users[channel] = addusers
+ else:
+ self.users[channel].update (addusers)
@staticmethod
def parseMode (mode):