diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-11-25 11:21:20 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-11-25 11:42:50 +0100 |
commit | bb22b39d559a2faa7817d579115a3f76b6a0ea30 (patch) | |
tree | 372f151b5cd5257ea1b71798a13976f44a746d34 | |
parent | 72c634aaeaaa83e05e159f68191f1f6e4e929c61 (diff) | |
download | poezio-bb22b39d559a2faa7817d579115a3f76b6a0ea30.tar.gz poezio-bb22b39d559a2faa7817d579115a3f76b6a0ea30.tar.bz2 poezio-bb22b39d559a2faa7817d579115a3f76b6a0ea30.tar.xz poezio-bb22b39d559a2faa7817d579115a3f76b6a0ea30.zip |
/me now works in all chatabs
fixes #2302
-rw-r--r-- | src/tabs.py | 7 | ||||
-rw-r--r-- | src/text_buffer.py | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/tabs.py b/src/tabs.py index 3f40ad12..c97f8a9f 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1298,10 +1298,6 @@ class MucTab(ChatTab): in the room anymore """ self.log_message(txt, time, nickname) - special_message = False - if txt.startswith('/me '): - txt = "\x192}* \x195}" + nickname + ' ' + txt[4:] - special_message = True user = self.get_user_by_name(nickname) if nickname is not None else None if user: user.set_last_talked(datetime.now()) @@ -1319,9 +1315,6 @@ class MucTab(ChatTab): highlight = self.do_highlight(txt, time, nickname) if highlight: nick_color = highlight - if special_message: - txt = '\x195}%s' % (txt,) - nickname = None time = time or datetime.now() self._text_buffer.add_message(txt, time, nickname, nick_color, history, user) diff --git a/src/text_buffer.py b/src/text_buffer.py index 94bd94b9..9cf5e0d5 100644 --- a/src/text_buffer.py +++ b/src/text_buffer.py @@ -36,6 +36,9 @@ class TextBuffer(object): def add_message(self, txt, time=None, nickname=None, nick_color=None, history=None, user=None): time = time or datetime.now() + if txt.startswith('/me '): + txt = "\x192}* \x195}" + nickname + ' ' + txt[4:] + nickname = None msg = Message(txt='%s\x19o'%(txt.replace('\t', ' '),), nick_color=nick_color, time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\ if history else time.strftime("%H:%M:%S"),\ |