aboutsummaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-03-16 21:41:35 +0000
committerJames Booth <boothj5@gmail.com>2015-03-16 21:41:35 +0000
commit11966d39b074e0bff4228067055807274d5d4834 (patch)
treee3f5f38b2cb9b2f92396c211fd573c4fbcadaaab /src/command
parentec57c72fb4ecf7266f16bcb53e260e0c83685c32 (diff)
downloadprofani-tty-11966d39b074e0bff4228067055807274d5d4834.tar.gz
Added otr_tag_message, removed commands.c dependency on libotr
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 1ecaeb6a..ef912d88 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -39,9 +39,6 @@
#include <errno.h>
#include <assert.h>
#include <glib.h>
-#ifdef HAVE_LIBOTR
-#include <libotr/proto.h>
-#endif
#include "chat_session.h"
#include "command/commands.h"
@@ -1377,16 +1374,12 @@ cmd_msg(gchar **args, struct cmd_help_t help)
cons_show_error("Failed to send message. Please check OTR policy");
return TRUE;
} else if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) {
- GString *otr_message = g_string_new(msg);
- g_string_append(otr_message, OTRL_MESSAGE_TAG_BASE);
- g_string_append(otr_message, OTRL_MESSAGE_TAG_V2);
-
- char *id = message_send_chat_encrypted(barejid, otr_message->str);
+ char *otr_tagged_msg = otr_tag_message(msg);
+ char *id = message_send_chat_encrypted(barejid, otr_tagged_msg);
ui_outgoing_chat_msg(barejid, msg, id);
chat_log_msg_out(barejid, msg);
free(id);
-
- g_string_free(otr_message, TRUE);
+ free(otr_tagged_msg);
} else {
_send_chat_message(barejid, msg);
}