Merge branch 'expose_canonical_alias' into master

This commit is contained in:
Damir Jelić 2020-10-11 10:39:22 +02:00
commit 0a62f28ac1

View file

@ -927,6 +927,9 @@ class RoomBuffer(object):
room.room_id room.room_id
) )
if room.canonical_alias:
self.update_canonical_alias_localvar()
@property @property
def backlog_pending(self): def backlog_pending(self):
return self._backlog_pending return self._backlog_pending
@ -1149,6 +1152,7 @@ class RoomBuffer(object):
else "#" + room_name) else "#" + room_name)
elif self.room.canonical_alias: elif self.room.canonical_alias:
room_name = self.room.canonical_alias room_name = self.room.canonical_alias
self.update_canonical_alias_localvar()
elif self.room.name == "#": elif self.room.name == "#":
room_name = "##" room_name = "##"
else: else:
@ -1164,6 +1168,13 @@ class RoomBuffer(object):
buffer_name = "{}.{}".format(self.server_name, room_name) buffer_name = "{}.{}".format(self.server_name, room_name)
self.weechat_buffer.name = buffer_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 _redact_line(self, event):
def predicate(event_id, line): def predicate(event_id, line):
def already_redacted(tags): def already_redacted(tags):