no need to go through GUI to handle cert request / reply

This commit is contained in:
Yann Leboulanger 2010-08-11 08:44:49 +02:00
parent 08c854aefa
commit fb41b65368
2 changed files with 11 additions and 20 deletions

View file

@ -45,13 +45,13 @@ import common.xmpp
from common import helpers
from common import gajim
from common import exceptions
from common import jingle_xtls
from common.commands import ConnectionCommands
from common.pubsub import ConnectionPubSub
from common.pep import ConnectionPEP
from common.protocol.caps import ConnectionCaps
from common.protocol.bytestream import ConnectionSocks5Bytestream
import common.caps_cache as capscache
import common.jingle_xtls
if gajim.HAVE_FARSIGHT:
from common.jingle import ConnectionJingle
@ -2242,17 +2242,18 @@ ConnectionCaps, ConnectionHandlersBase, ConnectionJingle):
for i in iq_obj.getQueryPayload():
df[i.getName()] = i.getData()
self.dispatch('SEARCH_FORM', (jid, df, False))
def _PubkeyGetCB(self, con, obj):
def _PubkeyGetCB(self, con, iq_obj):
log.info('PubkeyGetCB')
jid_from = unicode(obj.getAttr('from'))
sid = obj.getAttr('id')
self.dispatch('PUBKEY_REQUEST', (con, obj, jid_from, sid))
def _PubkeyResultCB(self, con, obj):
jid_from = helpers.get_full_jid_from_iq(iq_obj)
sid = iq_obj.getAttr('id')
jingle_xtls.send_cert(con, jid_from, sid)
raise common.xmpp.NodeProcessed
def _PubkeyResultCB(self, con, iq_obj):
log.info('PubkeyResultCB')
jid_from = unicode(obj.getAttr('from'))
self.dispatch('PUBKEY_RESULT', (con, obj, jid_from));
jid_from = helpers.get_full_jid_from_iq(iq_obj)
jingle_xtls.handle_new_cert(con, iq_obj, jid_from)
def _StreamCB(self, con, obj):
if obj.getTag('conflict'):

View file

@ -2111,14 +2111,6 @@ class Interface:
pm_ctrl = gajim.interface.msg_win_mgr.get_control(full_jid, account)
if pm_ctrl and hasattr(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):
self.handlers = {
@ -2212,8 +2204,6 @@ class Interface:
'JINGLE_ERROR': [self.handle_event_jingle_error],
'PEP_RECEIVED': [self.handle_event_pep_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):