Skip to content

Instantly share code, notes, and snippets.

@syldrathecat
Created March 27, 2016 02:47
Show Gist options
  • Save syldrathecat/3b8332ca375ceca21b45 to your computer and use it in GitHub Desktop.
Save syldrathecat/3b8332ca375ceca21b45 to your computer and use it in GitHub Desktop.
diff --git a/f-list_commands.c b/f-list_commands.c
index 92c17b9..1f80174 100644
--- a/f-list_commands.c
+++ b/f-list_commands.c
@@ -464,8 +464,6 @@ int flist_send_message(PurpleConnection *pc, const gchar *who, const gchar *mess
im = PURPLE_CONV_IM(purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, fla->pa));
purple_markup_html_to_xhtml(message, NULL, &plain_message);
- local_message = purple_markup_escape_text(plain_message, -1); /* re-escape the html entities */
- bbcode_message = flist_bbcode_to_html(fla, purple_conv_im_get_conversation(im), local_message); /* convert the bbcode to html to display locally */
json = json_object_new();
json_object_set_string_member(json, "recipient", who);
@@ -473,6 +471,12 @@ int flist_send_message(PurpleConnection *pc, const gchar *who, const gchar *mess
flist_request(pc, FLIST_REQUEST_PRIVATE_MESSAGE, json);
json_object_unref(json);
+ if (strncmp(plain_message, "?OTR", 4) == 0)
+ return 1;
+
+ local_message = purple_markup_escape_text(plain_message, -1); /* re-escape the html entities */
+ bbcode_message = flist_bbcode_to_html(fla, purple_conv_im_get_conversation(im), local_message); /* convert the bbcode to html to display locally */
+
if(im) { /* This should always be the case. */
purple_conv_im_write(im, NULL, bbcode_message, flags, time(NULL));
ret = 0; //we've already displayed it
@syldrathecat
Copy link
Author

Proof of concept. This creates a memory leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment