Commit 77edaa72 authored by Tails developers's avatar Tails developers
Browse files

Make the bot use highlighted messages in multi-user chats.

That is, it looks only for message that start with "$BOT_NICK: ".
parent 480b43b4
......@@ -99,6 +99,12 @@ class OtrBot(jabberbot.JabberBot):
otr.otrl_context_force_plaintext(context)
if is_internal:
return
if mess.getType() == "groupchat":
bot_prefix = self.__account + ": "
if decrypted_body.startswith(bot_prefix):
decrypted_body = decrypted_body[len(bot_prefix):]
else:
return
mess.setBody(decrypted_body)
super(OtrBot, self).callback_message(conn, mess)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment