no need to go through GUI to handle cert request / reply
This commit is contained in:
parent
08c854aefa
commit
fb41b65368
2 changed files with 11 additions and 20 deletions
|
@ -45,13 +45,13 @@ import common.xmpp
|
||||||
from common import helpers
|
from common import helpers
|
||||||
from common import gajim
|
from common import gajim
|
||||||
from common import exceptions
|
from common import exceptions
|
||||||
|
from common import jingle_xtls
|
||||||
from common.commands import ConnectionCommands
|
from common.commands import ConnectionCommands
|
||||||
from common.pubsub import ConnectionPubSub
|
from common.pubsub import ConnectionPubSub
|
||||||
from common.pep import ConnectionPEP
|
from common.pep import ConnectionPEP
|
||||||
from common.protocol.caps import ConnectionCaps
|
from common.protocol.caps import ConnectionCaps
|
||||||
from common.protocol.bytestream import ConnectionSocks5Bytestream
|
from common.protocol.bytestream import ConnectionSocks5Bytestream
|
||||||
import common.caps_cache as capscache
|
import common.caps_cache as capscache
|
||||||
import common.jingle_xtls
|
|
||||||
|
|
||||||
if gajim.HAVE_FARSIGHT:
|
if gajim.HAVE_FARSIGHT:
|
||||||
from common.jingle import ConnectionJingle
|
from common.jingle import ConnectionJingle
|
||||||
|
@ -2242,17 +2242,18 @@ ConnectionCaps, ConnectionHandlersBase, ConnectionJingle):
|
||||||
for i in iq_obj.getQueryPayload():
|
for i in iq_obj.getQueryPayload():
|
||||||
df[i.getName()] = i.getData()
|
df[i.getName()] = i.getData()
|
||||||
self.dispatch('SEARCH_FORM', (jid, df, False))
|
self.dispatch('SEARCH_FORM', (jid, df, False))
|
||||||
|
|
||||||
def _PubkeyGetCB(self, con, obj):
|
def _PubkeyGetCB(self, con, iq_obj):
|
||||||
log.info('PubkeyGetCB')
|
log.info('PubkeyGetCB')
|
||||||
jid_from = unicode(obj.getAttr('from'))
|
jid_from = helpers.get_full_jid_from_iq(iq_obj)
|
||||||
sid = obj.getAttr('id')
|
sid = iq_obj.getAttr('id')
|
||||||
self.dispatch('PUBKEY_REQUEST', (con, obj, jid_from, sid))
|
jingle_xtls.send_cert(con, jid_from, sid)
|
||||||
|
raise common.xmpp.NodeProcessed
|
||||||
def _PubkeyResultCB(self, con, obj):
|
|
||||||
|
def _PubkeyResultCB(self, con, iq_obj):
|
||||||
log.info('PubkeyResultCB')
|
log.info('PubkeyResultCB')
|
||||||
jid_from = unicode(obj.getAttr('from'))
|
jid_from = helpers.get_full_jid_from_iq(iq_obj)
|
||||||
self.dispatch('PUBKEY_RESULT', (con, obj, jid_from));
|
jingle_xtls.handle_new_cert(con, iq_obj, jid_from)
|
||||||
|
|
||||||
def _StreamCB(self, con, obj):
|
def _StreamCB(self, con, obj):
|
||||||
if obj.getTag('conflict'):
|
if obj.getTag('conflict'):
|
||||||
|
|
|
@ -2111,14 +2111,6 @@ class Interface:
|
||||||
pm_ctrl = gajim.interface.msg_win_mgr.get_control(full_jid, account)
|
pm_ctrl = gajim.interface.msg_win_mgr.get_control(full_jid, account)
|
||||||
if pm_ctrl and hasattr(pm_ctrl, "update_contact"):
|
if pm_ctrl and hasattr(pm_ctrl, "update_contact"):
|
||||||
pm_ctrl.update_contact()
|
pm_ctrl.update_contact()
|
||||||
|
|
||||||
def handle_event_pubkey_request(self, account, data):
|
|
||||||
con, obj, jid_from, sid = data
|
|
||||||
common.jingle_xtls.send_cert(con, jid_from, sid)
|
|
||||||
|
|
||||||
def handle_event_pubkey_result(self, account, data):
|
|
||||||
con, obj, jid_from = data
|
|
||||||
common.jingle_xtls.handle_new_cert(con, obj, jid_from)
|
|
||||||
|
|
||||||
def create_core_handlers_list(self):
|
def create_core_handlers_list(self):
|
||||||
self.handlers = {
|
self.handlers = {
|
||||||
|
@ -2212,8 +2204,6 @@ class Interface:
|
||||||
'JINGLE_ERROR': [self.handle_event_jingle_error],
|
'JINGLE_ERROR': [self.handle_event_jingle_error],
|
||||||
'PEP_RECEIVED': [self.handle_event_pep_received],
|
'PEP_RECEIVED': [self.handle_event_pep_received],
|
||||||
'CAPS_RECEIVED': [self.handle_event_caps_received],
|
'CAPS_RECEIVED': [self.handle_event_caps_received],
|
||||||
'PUBKEY_REQUEST': [self.handle_event_pubkey_request],
|
|
||||||
'PUBKEY_RESULT': [self.handle_event_pubkey_result],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def register_core_handlers(self):
|
def register_core_handlers(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue