[omemo] Request member list on join again
This was lost in the Gajim 1.5 upgrade
This commit is contained in:
@@ -30,6 +30,7 @@ from gi.repository import Gdk
|
|||||||
from nbxmpp.namespaces import Namespace
|
from nbxmpp.namespaces import Namespace
|
||||||
|
|
||||||
from gajim.common import app, ged
|
from gajim.common import app, ged
|
||||||
|
from gajim.common.modules.contacts import GroupchatContact
|
||||||
|
|
||||||
from gajim.gui.dialogs import ErrorDialog
|
from gajim.gui.dialogs import ErrorDialog
|
||||||
|
|
||||||
@@ -93,6 +94,7 @@ class OmemoPlugin(GajimPlugin):
|
|||||||
'omemo-new-fingerprint': (ged.PRECORE, self._on_new_fingerprints),
|
'omemo-new-fingerprint': (ged.PRECORE, self._on_new_fingerprints),
|
||||||
'signed-in': (ged.PRECORE, self._on_signed_in),
|
'signed-in': (ged.PRECORE, self._on_signed_in),
|
||||||
'muc-disco-update': (ged.GUI1, self._on_muc_disco_update),
|
'muc-disco-update': (ged.GUI1, self._on_muc_disco_update),
|
||||||
|
'muc-added': (ged.GUI1, self._on_muc_added),
|
||||||
}
|
}
|
||||||
self.modules = [omemo]
|
self.modules = [omemo]
|
||||||
|
|
||||||
@@ -108,8 +110,6 @@ class OmemoPlugin(GajimPlugin):
|
|||||||
'encryption_state' + self.encryption_name: (
|
'encryption_state' + self.encryption_name: (
|
||||||
self._encryption_state, None),
|
self._encryption_state, None),
|
||||||
'update_caps': (self._update_caps, None),
|
'update_caps': (self._update_caps, None),
|
||||||
'groupchat_control': (self._gc_control_connect,
|
|
||||||
self._gc_control_disconnect)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.disabled_accounts = []
|
self.disabled_accounts = []
|
||||||
@@ -331,8 +331,13 @@ class OmemoPlugin(GajimPlugin):
|
|||||||
return
|
return
|
||||||
chat_control.add_info_message(msg)
|
chat_control.add_info_message(msg)
|
||||||
|
|
||||||
def _gc_control_connect(self, groupchat_control):
|
def _on_muc_added(self, event):
|
||||||
groupchat_control.contact.connect('room-joined', self._on_room_joined)
|
client = app.get_client(event.account)
|
||||||
|
contact = client.get_module('Contacts').get_contact(event.jid)
|
||||||
|
if not isinstance(contact, GroupchatContact):
|
||||||
|
log.warning('%s is not a groupchat contact', contact)
|
||||||
|
return
|
||||||
|
|
||||||
def _gc_control_disconnect(self, groupchat_control):
|
# Event is triggert on every join, avoid multiple connects
|
||||||
groupchat_control.contact.disconnect(self)
|
contact.disconnect_all_from_obj(self)
|
||||||
|
contact.connect('room-joined', self._on_room_joined)
|
||||||
|
|||||||
Reference in New Issue
Block a user