Commit 12217815 authored by Yann Leboulanger's avatar Yann Leboulanger

use NEC to handle pep config events

parent ef741a00
......@@ -731,12 +731,12 @@ class ConnectionVcard:
form_tag = conf.getTag('x', namespace=common.xmpp.NS_DATA)
if form_tag:
form = common.dataforms.ExtendForm(node=form_tag)
self.dispatch('PEP_CONFIG', (node, form))
gajim.nec.push_incoming_event(PEPConfigReceivedEvent(None,
conn=self.conn, node=node, form=form))
elif self.awaiting_answers[id_][0] == ARCHIVING_COLLECTIONS_ARRIVED:
# TODO
print 'ARCHIVING_COLLECTIONS_ARRIVED'
pass
elif self.awaiting_answers[id_][0] == ARCHIVING_COLLECTION_ARRIVED:
def save_if_not_exists(with_, nick, direction, tim, payload):
......
......@@ -1519,3 +1519,7 @@ class VcardReceivedEvent(nec.NetworkIncomingEvent):
if self.resource:
self.fjid += '/' + self.resource
return True
class PEPConfigReceivedEvent(nec.NetworkIncomingEvent):
name = 'pep-config-received'
base_network_events = []
\ No newline at end of file
......@@ -3940,11 +3940,17 @@ class ManagePEPServicesWindow:
self.init_services()
self.xml.get_object('services_treeview').get_selection().connect(
'changed', self.on_services_selection_changed)
gajim.ged.register_event_handler('pep-config-received', ged.GUI1,
self._nec_pep_config_received)
self.window.show_all()
def on_manage_pep_services_window_destroy(self, widget):
'''close window'''
del gajim.interface.instances[self.account]['pep_services']
gajim.ged.remove_event_handler('pep-config-received', ged.GUI1,
self._nec_pep_config_received)
def on_close_button_clicked(self, widget):
self.window.destroy()
......@@ -4012,13 +4018,13 @@ class ManagePEPServicesWindow:
our_jid = gajim.get_jid_from_account(self.account)
gajim.connections[self.account].request_pb_configuration(our_jid, node)
def config(self, node, form):
def _nec_pep_config_received(self, obj):
def on_ok(form, node):
form.type = 'submit'
our_jid = gajim.get_jid_from_account(self.account)
gajim.connections[self.account].send_pb_configure(our_jid, node, form)
window = dialogs.DataFormWindow(form, (on_ok, node))
title = "Configure %s" % node
window = dialogs.DataFormWindow(obj.form, (on_ok, obj.node))
title = _('Configure %s') % obj.node
window.set_title(title)
window.show_all()
......
......@@ -1428,7 +1428,6 @@ class Interface:
'METACONTACTS': [self.handle_event_metacontacts],
'FAILED_DECRYPT': [self.handle_event_failed_decrypt],
'ZC_NAME_CONFLICT': [self.handle_event_zc_name_conflict],
'PEP_CONFIG': [self.handle_event_pep_config],
'PASSWORD_REQUIRED': [self.handle_event_password_required],
'atom-entry-received': [self.handle_atom_entry],
'bad-gpg-passphrase': [self.handle_event_bad_gpg_passphrase],
......
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