libpurple/tests/test_message.c

changeset 43100
e6df74d36862
parent 42911
15642e855d73
child 43140
951c4110ad50
--- a/libpurple/tests/test_message.c	Thu Dec 05 21:27:35 2024 -0600
+++ b/libpurple/tests/test_message.c	Thu Dec 05 21:31:16 2024 -0600
@@ -38,8 +38,11 @@
  *****************************************************************************/
 static void
 test_purple_message_properties(void) {
-	PurpleContactInfo *author = NULL;
-	PurpleContactInfo *author1 = NULL;
+	PurpleContactInfo *info = NULL;
+	PurpleConversation *conversation = NULL;
+	PurpleConversationMember *author = NULL;
+	PurpleConversationMember *author1 = NULL;
+	PurpleConversationMembers *members = NULL;
 	PurpleMessage *message = NULL;
 	GDateTime *timestamp = NULL;
 	GDateTime *timestamp1 = NULL;
@@ -61,8 +64,13 @@
 	error = g_error_new(g_quark_from_static_string("test-message"), 0,
 	                    "delivery failed");
 
-	author = purple_contact_info_new(NULL);
-	purple_contact_info_set_username(author, "author");
+	conversation = g_object_new(PURPLE_TYPE_CONVERSATION, NULL);
+	members = purple_conversation_get_members(conversation);
+
+	info = purple_contact_info_new(NULL);
+	purple_contact_info_set_username(info, "author");
+	author = purple_conversation_members_add_member(members, info, FALSE,
+	                                                NULL);
 
 	/* We don't set delivered-at here because delivered will set it for us so
 	 * it's impossible to check that here, which is why we have separate tests
@@ -138,8 +146,9 @@
 	g_clear_pointer(&timestamp, g_date_time_unref);
 	g_clear_pointer(&timestamp1, g_date_time_unref);
 
+	g_assert_finalize_object(conversation);
 	g_assert_finalize_object(message);
-	g_assert_finalize_object(author);
+	g_assert_finalize_object(info);
 }
 
 static void

mercurial