diff --git a/matrix/buffer.py b/matrix/buffer.py index 94900c8..a391260 100644 --- a/matrix/buffer.py +++ b/matrix/buffer.py @@ -927,6 +927,9 @@ class RoomBuffer(object): room.room_id ) + if room.canonical_alias: + self.update_canonical_alias_localvar() + @property def backlog_pending(self): return self._backlog_pending @@ -1149,6 +1152,7 @@ class RoomBuffer(object): else "#" + room_name) elif self.room.canonical_alias: room_name = self.room.canonical_alias + self.update_canonical_alias_localvar() elif self.room.name == "#": room_name = "##" else: @@ -1164,6 +1168,13 @@ class RoomBuffer(object): buffer_name = "{}.{}".format(self.server_name, room_name) self.weechat_buffer.name = buffer_name + def update_canonical_alias_localvar(self): + W.buffer_set( + self.weechat_buffer._ptr, + "localvar_set_canonical_alias", + self.room.canonical_alias + ) + def _redact_line(self, event): def predicate(event_id, line): def already_redacted(tags):