From 00aa453885bf1a0122e322154032514bd5a54244 Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Sat, 2 Feb 2013 22:30:53 +0400 Subject: [PATCH] gotr.add nbxmpp support --- gotr/manifest.ini | 2 +- gotr/otrmodule.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gotr/manifest.ini b/gotr/manifest.ini index 07081fa..a1653ef 100644 --- a/gotr/manifest.ini +++ b/gotr/manifest.ini @@ -1,7 +1,7 @@ [info] name: Off-The-Record Encryption short_name: gotr -version: 1.7.2 +version: 1.7.3 description: Provide OTR encryption authors: Kjell Braden homepage: http://gajim-otr.pentabarf.de diff --git a/gotr/otrmodule.py b/gotr/otrmodule.py index ea6144d..6c43980 100644 --- a/gotr/otrmodule.py +++ b/gotr/otrmodule.py @@ -85,6 +85,12 @@ try: except ImportError: HAS_CRYPTO = False +nb_xmpp = False +import common.xmpp +if not dir(common.xmpp): + import nbxmpp + nb_xmpp = True + HAS_POTR = True try: import potr @@ -119,7 +125,10 @@ try: msg = unicode(msg) account = self.user.accountname - stanza = common.xmpp.Message(to=self.peer, body=msg, typ='chat') + if not nb_xmpp: + stanza = common.xmpp.Message(to=self.peer, body=msg, typ='chat') + else: + stanza = nbxmpp.Message(to=self.peer, body=msg, typ='chat') if appdata is not None: session = appdata.get('session', None) if session is not None: