Author: js Date: 2008-05-19 15:52:45 +0200 (Mon, 19 May 2008) New Revision: 9667
Modified: trunk/src/gajim.py trunk/src/session.py Log: Fix automatic start of OTR session.
Modified: trunk/src/gajim.py =================================================================== --- trunk/src/gajim.py 2008-05-19 10:58:03 UTC (rev 9666) +++ trunk/src/gajim.py 2008-05-19 13:52:45 UTC (rev 9667) @@ -265,14 +265,13 @@ gajim.otr_module = None gajim.otr_windows = None
-def add_appdata(data=None, context=None): +def add_appdata(data, context): account = data - context.app_data = otr_windows.ContactOtrSMPWindow(unicode(context.username), - account) + context.app_data = otr_windows.ContactOtrSMPWindow( + unicode(context.username), account)
gajim.otr_add_appdata = add_appdata
- def otr_dialog_destroy(widget, *args, **kwargs): widget.destroy()
@@ -458,7 +457,7 @@ def max_message_size(self, **kwargs): return 0
- def account_name(self, opdata=None, account='',protocol=''): + def account_name(self, opdata=None, account='', protocol=''): return gajim.get_name_from_jid(opdata['account'], unicode(account))
Modified: trunk/src/session.py =================================================================== --- trunk/src/session.py 2008-05-19 10:58:03 UTC (rev 9666) +++ trunk/src/session.py 2008-05-19 13:52:45 UTC (rev 9667) @@ -82,9 +82,14 @@
log_type = 'chat_msg_recv'
+ # I don't trust libotr, that's why I only pass the + # message to it if it either contains the magic + # ?OTR string or a plaintext tagged message. if gajim.otr_module and \ isinstance(msgtxt, unicode) and \ - msgtxt.find('?OTR') != -1: + (msgtxt.find('?OTR') != -1 or msgtxt.find( + '\x20\x09\x20\x20\x09\x09\x09\x09' \ + '\x20\x09\x20\x09\x20\x09\x20\x20') != -1): # TODO: Do we really need .encode()? otr_msg_tuple = \ gajim.otr_module.otrl_message_receiving(