summaryrefslogtreecommitdiff
path: root/finch/gntpounce.c
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2020-10-03 05:58:21 -0500
committerGary Kramlich <grim@reaperworld.com>2020-10-03 05:58:21 -0500
commitcac0124838270bd3be2004e271c2e91e583d6f08 (patch)
tree5cec70b62de32748633f971b86dc5da80b797102 /finch/gntpounce.c
parentd4bafb96a107397b9d1edeaafb1512aba6212962 (diff)
downloadpidgin-cac0124838270bd3be2004e271c2e91e583d6f08.tar.gz
PurpleMessage cleanups from hell
Clean up libpurple/message.[ch] and remove the messages hash table as its current implementation will not fit our future needs add a content-type property to PurpleMessage Convert message timestamps from time_t to GDateTime and set default values Make purple_message_new_outgoing take a parameter for the author. Testing Done: messages sent on bonjour, irc privmsg, irc chat, `/me` is broken i think unrelated. Reviewed at https://reviews.imfreedom.org/r/124/
Diffstat (limited to 'finch/gntpounce.c')
-rw-r--r--finch/gntpounce.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/finch/gntpounce.c b/finch/gntpounce.c
index d39b30b7f5..e20e36e9c1 100644
--- a/finch/gntpounce.c
+++ b/finch/gntpounce.c
@@ -843,15 +843,18 @@ pounce_cb(PurplePounce *pounce, PurplePounceEvent events, void *data)
if (message != NULL)
{
PurpleMessage *pmsg;
+ const gchar *me = purple_account_get_name_for_display(account);
im = purple_conversations_find_im_with_account(pouncee, account);
- if (im == NULL)
+ if (im == NULL) {
im = purple_im_conversation_new(account, pouncee);
+ }
- pmsg = purple_message_new_outgoing(pouncee, message, 0);
+ pmsg = purple_message_new_outgoing(me, pouncee, message, 0);
purple_serv_send_im(purple_account_get_connection(account), pmsg);
purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg);
+ g_object_unref(G_OBJECT(pmsg));
}
}