--- a/finch/plugins/gnttinyurl.c Thu Jun 12 21:18:56 2014 +0200
+++ b/finch/plugins/gnttinyurl.c Thu Jun 12 21:33:01 2014 +0200
@@ -246,26 +246,24 @@
-static gboolean writing_msg(PurpleAccount *account, char *sender, char **message,
- PurpleConversation *conv, PurpleMessageFlags flags)
+static gboolean writing_msg(PurpleConversation *conv, PurpleMessage *msg, gpointer _unused) GList *iter, *urls, *next;
- if ((flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_INVISIBLE)))
+ if (purple_message_get_flags(msg) & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_INVISIBLE)) urls = g_object_get_data(G_OBJECT(conv), "TinyURLs");
if (urls != NULL) /* message was cancelled somewhere? Reset. */
g_list_foreach(urls, free_urls, NULL);
- urls = extract_urls(*message);
+ urls = extract_urls(purple_message_get_contents(msg)); - t = g_string_new(*message);
+ t = g_string_new(g_strdup(purple_message_get_contents(msg))); for (iter = urls; iter; iter = next) {
if (g_utf8_strlen((char *)iter->data, -1) >= purple_prefs_get_int(PREF_LENGTH)) {
@@ -289,11 +287,10 @@
urls = g_list_delete_link(urls, iter);
- g_string_free(t, FALSE);
- conv = PURPLE_CONVERSATION(purple_im_conversation_new(account, sender));
- g_object_set_data(G_OBJECT(conv), "TinyURLs", urls);
+ purple_message_set_contents(msg, t->str); + g_string_free(t, TRUE); + g_object_set_data(G_OBJECT(conv), "TinyURLs", urls); --- a/pidgin/gtkconv.c Thu Jun 12 21:18:56 2014 +0200
+++ b/pidgin/gtkconv.c Thu Jun 12 21:33:01 2014 +0200
@@ -6654,6 +6654,29 @@
box_remote_image_cb, conv, NULL);
+writing_msg(PurpleConversation *conv, PurpleMessage *msg, gpointer _unused) + PidginConversation *gtkconv; + g_return_val_if_fail(msg != NULL, FALSE); + if (!(purple_message_get_flags(msg) & PURPLE_MESSAGE_ACTIVE_ONLY)) + g_return_val_if_fail(conv != NULL, FALSE); + gtkconv = PIDGIN_CONVERSATION(conv); + g_return_val_if_fail(gtkconv != NULL, FALSE); + if (conv == gtkconv->active_conv) + purple_debug_info("gtkconv", + "Suppressing message for an inactive conversation"); pidgin_conv_write_conv(PurpleConversation *conv, PurpleMessage *pmsg)
@@ -6702,17 +6725,6 @@
if (conv != gtkconv->active_conv)
- if (flags & PURPLE_MESSAGE_ACTIVE_ONLY)
- /* Unless this had PURPLE_MESSAGE_NO_LOG, this message
- * was logged. Plugin writers: if this isn't what
- * you wanted, call purple_im_conversation_write_message() instead of
- * purple_conversation_write(). */
- purple_debug_info("gtkconv",
- "Suppressing message for an inactive conversation in pidgin_conv_write_conv()\n");
/* Set the active conversation to the one that just messaged us. */
/* TODO: consider not doing this if the account is offline or something */
if (flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV))
@@ -8862,6 +8874,10 @@
purple_signal_connect(purple_connections_get_handle(), "signing-off", handle,
G_CALLBACK(account_signing_off), NULL);
+ purple_signal_connect(purple_conversations_get_handle(), "writing-im-msg", + handle, G_CALLBACK(writing_msg), NULL); + purple_signal_connect(purple_conversations_get_handle(), "writing-chat-msg", + handle, G_CALLBACK(writing_msg), NULL); purple_signal_connect(purple_conversations_get_handle(), "received-im-msg",
handle, G_CALLBACK(received_im_msg_cb), NULL);
purple_signal_connect(purple_conversations_get_handle(), "cleared-message-history",