Commit f650f51a authored by Philipp Hörist's avatar Philipp Hörist
Browse files

NickCompletion: Simplify nickname change

parent 86d87495
......@@ -1640,10 +1640,6 @@ def draw_all_roles(self):
for role in (Role.VISITOR, Role.PARTICIPANT, Role.MODERATOR):
self.draw_role(role)
def _change_nick(self, new_nick: str) -> None:
self.nick = new_nick
self._nick_completion.change_nick(new_nick)
@event_filter(['account', 'room_jid'])
def _on_self_presence(self, event):
nick = event.properties.muc_nickname
......@@ -1680,7 +1676,7 @@ def _on_nickname_changed(self, event):
nick = event.properties.muc_nickname
new_nick = event.properties.muc_user.nick
if event.properties.is_muc_self_presence:
self._change_nick(new_nick)
self._nick_completion.change_nick(new_nick)
message = _('You are now known as %s') % new_nick
else:
message = _('{nick} is now known '
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment