target = target.users[target_name]
elif target_name == 'topic':
target = target.channels[ret['CHAN']].topic
- for tok_name in tok_names:
+ for tok_name in sorted(tok_names):
+ # NB: alphabetical sorting of tok_names purely as a hack
+ # to ensure any setattr_topic:what be processed before any
+ # setattr_topic:who, i.e. for parsing TOPIC message, FIXME
setattr(target, tok_name, ret[tok_name])
if ret['verb'] == '005': # RPL_ISUPPORT
for item in ret['isupport']:
ch.remove_nick(ret['quitter'])
self._log(f'{ret["quitter"]} quits: {ret["message"]}',
LogScope.CHAT, target=ch_name)
- elif ret['verb'] == 'TOPIC':
- self._db.channels[ret['channel']].topic.what = ret['topic']
- self._db.channels[ret['channel']].topic.who = ret['author']
ClientsDb = dict[str, Client]
'PART',
((MsgTok.CHANNEL, ':channel'),
(MsgTok.ANY, ':message'))),
- _MsgParseExpectation((MsgTok.NICK_USER_HOST, ':author'),
+ _MsgParseExpectation((MsgTok.NICK_USER_HOST, 'setattr_topic:who'),
'TOPIC',
- ((MsgTok.CHANNEL, ':channel'),
- (MsgTok.ANY, ':topic'))),
+ ((MsgTok.CHANNEL, ':CHAN'),
+ (MsgTok.ANY, 'setattr_topic:what'))),
]
# messaging