diff options
author | Gary Kramlich <grim@reaperworld.com> | 2023-02-08 08:56:07 -0600 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2023-02-08 08:56:07 -0600 |
commit | 04f864380fc52d9fed28abfb92281e39be66de6d (patch) | |
tree | 76317782f09b3e993b296b9f993fa6da0fd8efa1 /libpurple/server.c | |
parent | 54b7a5cba0948fcdee3c41d115e153449cf51595 (diff) | |
download | pidgin-04f864380fc52d9fed28abfb92281e39be66de6d.tar.gz |
Add a PurpleAccount parameter to the PurpleMessage constructors
This is the first step of making PurpleMessage use PurpleContactInfo's instead
of bare strings for authors and recipients.
Testing Done:
Connected and XMPP account and sent and received some messages in a MUC.
Bugs closed: PIDGIN-17724
Reviewed at https://reviews.imfreedom.org/r/2203/
Diffstat (limited to 'libpurple/server.c')
-rw-r--r-- | libpurple/server.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libpurple/server.c b/libpurple/server.c index a934972da4..61fe6ed031 100644 --- a/libpurple/server.c +++ b/libpurple/server.c @@ -377,7 +377,7 @@ void purple_serv_got_im(PurpleConnection *gc, const char *who, const char *msg, im = purple_im_conversation_new(account, name); } - pmsg = purple_message_new_incoming(name, message, flags, mtime); + pmsg = purple_message_new_incoming(account, name, message, flags, mtime); purple_conversation_write_message(im, pmsg); g_free(message); g_object_unref(G_OBJECT(pmsg)); @@ -653,14 +653,15 @@ void purple_serv_got_chat_in(PurpleConnection *g, int id, const char *who, who, message, chat, flags); if (flags & PURPLE_MESSAGE_RECV) { - pmsg = purple_message_new_incoming(who, message, flags, mtime); + pmsg = purple_message_new_incoming(purple_connection_get_account(g), + who, message, flags, mtime); } else { PurpleAccount *account = purple_connection_get_account(g); PurpleContactInfo *info = PURPLE_CONTACT_INFO(account); GDateTime *dt = g_date_time_new_from_unix_local((gint64)mtime); const gchar *me = purple_contact_info_get_name_for_display(info); - pmsg = purple_message_new_outgoing(me, who, message, flags); + pmsg = purple_message_new_outgoing(account, me, who, message, flags); purple_message_set_timestamp(pmsg, dt); g_date_time_unref(dt); } |