Remove usage of old MatrixRoom.alias attribute in remaining places.
* Use calculated display name in the bar item. * Don't mention the room name in topic messages for groups.
This commit is contained in:
parent
654e39077d
commit
02bb64feab
3 changed files with 31 additions and 17 deletions
|
@ -49,7 +49,9 @@ def matrix_bar_item_name(data, item, window, buffer, extra_info):
|
|||
|
||||
room = server.rooms[room_id]
|
||||
|
||||
return "{color}{name}".format(color=W.color(color), name=room.alias)
|
||||
return "{color}{name}".format(
|
||||
color=W.color(color),
|
||||
name=room.display_name())
|
||||
|
||||
elif buffer == server.server_buffer:
|
||||
color = ("status_name_ssl"
|
||||
|
|
|
@ -918,12 +918,17 @@ def matrix_command_topic_cb(data, buffer, command):
|
|||
if not room.topic:
|
||||
return W.WEECHAT_RC_OK
|
||||
|
||||
message = ("{prefix}Topic for {color}{room}{ncolor} is "
|
||||
"\"{topic}\"").format(
|
||||
if room.is_named():
|
||||
message = ('{prefix}Topic for {color}{room}{ncolor} is '
|
||||
'"{topic}"').format(
|
||||
prefix=W.prefix("network"),
|
||||
color=W.color("chat_buffer"),
|
||||
ncolor=W.color("reset"),
|
||||
room=room.alias,
|
||||
room=room.named_room_name(),
|
||||
topic=room.topic)
|
||||
else:
|
||||
message = ('{prefix}Topic is "{topic}"').format(
|
||||
prefix=W.prefix("network"),
|
||||
topic=room.topic)
|
||||
|
||||
date = int(time.time())
|
||||
|
|
|
@ -706,6 +706,7 @@ class RoomTopicEvent(RoomEvent):
|
|||
nick_color=W.color(color_name), user=nick, ncolor=W.color("reset"))
|
||||
|
||||
# TODO print old topic if configured so
|
||||
if room.is_named():
|
||||
message = ("{prefix}{nick} has changed "
|
||||
"the topic for {chan_color}{room}{ncolor} "
|
||||
"to \"{topic}\"").format(
|
||||
|
@ -713,7 +714,13 @@ class RoomTopicEvent(RoomEvent):
|
|||
nick=author,
|
||||
chan_color=W.color("chat_channel"),
|
||||
ncolor=W.color("reset"),
|
||||
room=room.display_name(server.user_id),
|
||||
room=room.named_room_name(),
|
||||
topic=topic)
|
||||
else:
|
||||
message = ('{prefix}{nick} has changed the topic to '
|
||||
'"{topic}"').format(
|
||||
prefix=W.prefix("network"),
|
||||
nick=author,
|
||||
topic=topic)
|
||||
|
||||
tags = ["matrix_topic", "log3", "matrix_id_{}".format(self.event_id)]
|
||||
|
|
Loading…
Reference in a new issue