From 995d9215df36063e9c03af2c70e64bac523f3975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 8 Aug 2018 15:43:00 +0200 Subject: [PATCH] buffer: Add support for notices. --- matrix/buffer.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/matrix/buffer.py b/matrix/buffer.py index c94723a..c366b01 100644 --- a/matrix/buffer.py +++ b/matrix/buffer.py @@ -44,6 +44,7 @@ from nio import ( RoomMessageEmote, RoomNameEvent, RoomMessageMedia, + RoomMessageNotice, RoomMessageUnknown, RedactionEvent ) @@ -922,15 +923,15 @@ class RoomBuffer(object): self.get_event_tags(event) ) - # elif isinstance(event, RoomMessageNotice): - # nick = self.find_nick(event.sender) - # date = server_ts_to_weechat(event.server_timestamp) - # self.weechat_buffer.notice( - # nick, - # event.message, - # date, - # self.get_event_tags(event) - # ) + elif isinstance(event, RoomMessageNotice): + nick = self.find_nick(event.sender) + date = server_ts_to_weechat(event.server_timestamp) + self.weechat_buffer.notice( + nick, + event.body, + date, + self.get_event_tags(event) + ) elif isinstance(event, RoomMessageMedia): nick = self.find_nick(event.sender)