Author: js Date: 2008-05-19 20:01:50 +0200 (Mon, 19 May 2008) New Revision: 9672
Modified: trunk/src/session.py Log: *sigh* I'm too confused today. This is nicer.
Modified: trunk/src/session.py =================================================================== --- trunk/src/session.py 2008-05-19 17:58:16 UTC (rev 9671) +++ trunk/src/session.py 2008-05-19 18:01:50 UTC (rev 9672) @@ -152,21 +152,20 @@
if msgtxt == '': return - else: - if msgtxt: - self.append_otr_tag = False + elif msgtxt != None and msgtxt != '': + self.append_otr_tag = False
- # We're also here if we just don't - # support OTR. Thus, we should strip - # the tags from plaintext messages - # since they look ugly. - msgtxt = msgtxt.replace('\x20\x09\x20' \ - '\x20\x09\x09\x09\x09\x20\x09' \ - '\x20\x09\x20\x09\x20\x20', '') - msgtxt = msgtxt.replace('\x20\x09\x20' \ - '\x09\x20\x20\x09\x20', '') - msgtxt = msgtxt.replace('\x20\x20\x09' \ - '\x09\x20\x20\x09\x20', '') + # We're also here if we just don't + # support OTR. Thus, we should strip + # the tags from plaintext messages + # since they look ugly. + msgtxt = msgtxt.replace('\x20\x09\x20' \ + '\x20\x09\x09\x09\x09\x20\x09' \ + '\x20\x09\x20\x09\x20\x20', '') + msgtxt = msgtxt.replace('\x20\x09\x20' \ + '\x09\x20\x20\x09\x20', '') + msgtxt = msgtxt.replace('\x20\x20\x09' \ + '\x09\x20\x20\x09\x20', '') else: log_type = 'single_msg_recv'