gotr.add nbxmpp support

This commit is contained in:
Denis Fomin
2013-02-02 22:30:53 +04:00
parent df16dd31c9
commit 00aa453885
2 changed files with 11 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
[info] [info]
name: Off-The-Record Encryption name: Off-The-Record Encryption
short_name: gotr short_name: gotr
version: 1.7.2 version: 1.7.3
description: Provide OTR encryption description: Provide OTR encryption
authors: Kjell Braden <afflux.gajim@pentabarf.de> authors: Kjell Braden <afflux.gajim@pentabarf.de>
homepage: http://gajim-otr.pentabarf.de homepage: http://gajim-otr.pentabarf.de

View File

@@ -85,6 +85,12 @@ try:
except ImportError: except ImportError:
HAS_CRYPTO = False HAS_CRYPTO = False
nb_xmpp = False
import common.xmpp
if not dir(common.xmpp):
import nbxmpp
nb_xmpp = True
HAS_POTR = True HAS_POTR = True
try: try:
import potr import potr
@@ -119,7 +125,10 @@ try:
msg = unicode(msg) msg = unicode(msg)
account = self.user.accountname 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: if appdata is not None:
session = appdata.get('session', None) session = appdata.get('session', None)
if session is not None: if session is not None: