Commit 80c1c1f5 authored by Philipp Hörist's avatar Philipp Hörist

Groupchat: Update name on bookmark name change

parent e9811609
Pipeline #4119 passed with stages
in 6 minutes and 24 seconds
......@@ -334,6 +334,7 @@ class GroupchatControl(ChatControlBase):
('signed-in', ged.GUI1, self._nec_signed_in),
('decrypted-message-received', ged.GUI2, self._nec_decrypted_message_received),
('gc-stanza-message-outgoing', ged.OUT_POSTCORE, self._message_sent),
('bookmarks-received', ged.GUI2, self._on_bookmarks_received),
]
for handler in self._event_handlers:
......@@ -799,6 +800,7 @@ class GroupchatControl(ChatControlBase):
self.update_actions()
self.set_lock_image()
self._connect_window_state_change(self.parent_win)
self.draw_banner_text()
def set_tooltip(self):
widget = self.xml.get_object('list_treeview')
......@@ -1142,6 +1144,13 @@ class GroupchatControl(ChatControlBase):
return
self._update_banner_state_image()
@event_filter(['account'])
def _on_bookmarks_received(self, _event):
if self.parent_win is None:
return
self.parent_win.redraw_tab(self)
self.draw_banner_text()
@event_filter(['account', 'room_jid'])
def _on_voice_approval(self, event):
SingleMessageWindow(self.account,
......
......@@ -2638,6 +2638,11 @@ class RosterWindow:
def _on_muc_disco_update(self, event):
self.draw_contact(str(event.room_jid), event.account)
def _on_bookmarks_received(self, event):
con = app.connections[event.account]
for bookmark in con.get_module('Bookmarks').bookmarks:
self.draw_contact(str(bookmark.jid), event.account)
def _nec_metacontacts_received(self, obj):
self.redraw_metacontacts(obj.conn.name)
......@@ -5684,3 +5689,5 @@ class RosterWindow:
self._nec_chatstate_received)
app.ged.register_event_handler('muc-disco-update', ged.GUI1,
self._on_muc_disco_update)
app.ged.register_event_handler('bookmarks-received', ged.GUI2,
self._on_bookmarks_received)
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