Fix mention-related KeyError in message callback
This commit is contained in:
@@ -101,16 +101,17 @@ class NioCallbacks:
|
||||
room_id = room.room_id,
|
||||
)
|
||||
|
||||
if HTML_PROCESSOR.user_id_link_in_html(co, self.client.user_id):
|
||||
rooms = self.client.models[self.client.user_id, "rooms"]
|
||||
rooms[room.room_id].mentions += 1
|
||||
|
||||
mention_list = HTML_PROCESSOR.mentions_in_html(co)
|
||||
|
||||
await self.client.register_nio_event(
|
||||
room, ev, content=co, mentions=mention_list,
|
||||
)
|
||||
|
||||
if HTML_PROCESSOR.user_id_link_in_html(co, self.client.user_id):
|
||||
rooms = self.client.models[self.client.user_id, "rooms"]
|
||||
rooms[room.room_id].mentions += 1
|
||||
|
||||
|
||||
|
||||
async def onRoomMessageNotice(self, room, ev) -> None:
|
||||
await self.onRoomMessageText(room, ev)
|
||||
|
Reference in New Issue
Block a user