Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjs <js-gajim@webkeks.org>2008-05-19 21:54:51 +0400
committerjs <js-gajim@webkeks.org>2008-05-19 21:54:51 +0400
commit41fe6ed927daa049929c499d0e2c5acb2121f778 (patch)
tree304ba72318a243db8c66ffa0bcd598b9ced9581e
parent1cbe5678da8e453be1437026b1978a5929832503 (diff)
Better check if msgtxt is not None.
-rw-r--r--src/session.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/session.py b/src/session.py
index 90afc5276..2726ddd04 100644
--- a/src/session.py
+++ b/src/session.py
@@ -158,13 +158,14 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
# 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', '')
+ if msgtxt:
+ 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'