buffer: Expose canonical_alias as localvar in buffer
This commit is contained in:
parent
2a79d9c38b
commit
704fdc2f70
1 changed files with 11 additions and 0 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue