Mon, 25 Mar 2024 22:25:49 -0500
PurpleConversationType's values were pascal case when they should be upper snake case
Testing Done:
Ran with the turtles.
Reviewed at https://reviews.imfreedom.org/r/3048/
--- a/libpurple/purplecontact.c Mon Mar 25 21:43:28 2024 -0500 +++ b/libpurple/purplecontact.c Mon Mar 25 22:25:49 2024 -0500 @@ -168,7 +168,7 @@ PURPLE_TYPE_CONVERSATION, "account", contact->account, "name", name, - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); purple_conversation_manager_register(manager, conversation);
--- a/libpurple/purpleconversation.c Mon Mar 25 21:43:28 2024 -0500 +++ b/libpurple/purpleconversation.c Mon Mar 25 22:25:49 2024 -0500 @@ -697,7 +697,7 @@ "type", "type", "The type of the conversation.", PURPLE_TYPE_CONVERSATION_TYPE, - PurpleConversationTypeUnset, + PURPLE_CONVERSATION_TYPE_UNSET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); properties[PROP_ACCOUNT] = g_param_spec_object( @@ -1106,7 +1106,7 @@ PurpleConversationPrivate *priv = NULL; g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), - PurpleConversationTypeUnset); + PURPLE_CONVERSATION_TYPE_UNSET); priv = purple_conversation_get_instance_private(conversation);
--- a/libpurple/purpleconversation.h Mon Mar 25 21:43:28 2024 -0500 +++ b/libpurple/purpleconversation.h Mon Mar 25 22:25:49 2024 -0500 @@ -96,16 +96,16 @@ /** * PurpleConversationType: - * @PurpleConversationTypeUnset: A value to specify that the property has not - * been set. - * @PurpleConversationTypeDM: A direct message between two contacts. - * @PurpleConversationTypeGroupDM: A direct message between a protocol - * dependent number of contacts. - * @PurpleConversationTypeChannel: A multi-user chat that is available to all - * users on the protocol and has features like - * moderation. - * @PurpleConversationTypeThread: A thread is a subset of messages from a - * conversation that are related. + * @PURPLE_CONVERSATION_TYPE_UNSET: A value to specify that the property has + * not been set. + * @PURPLE_CONVERSATION_TYPE_DM: A direct message between two contacts. + * @PURPLE_CONVERSATION_TYPE_GROUP_DM: A direct message between a protocol + * dependent number of contacts. + * @PURPLE_CONVERSATION_TYPE_CHANNEL: A multi-user chat that is available to + * all users on the protocol and has + * features like moderation. + * @PURPLE_CONVERSATION_TYPE_THREAD: A thread is a subset of messages from a + * conversation that are related. * * The type of the conversation. This is mostly ignored, but could be useful in * ways we can't imagine right now. If you come up with one in the future, @@ -115,11 +115,11 @@ */ PURPLE_AVAILABLE_TYPE_IN_3_0 typedef enum { - PurpleConversationTypeUnset, - PurpleConversationTypeDM, - PurpleConversationTypeGroupDM, - PurpleConversationTypeChannel, - PurpleConversationTypeThread, + PURPLE_CONVERSATION_TYPE_UNSET, + PURPLE_CONVERSATION_TYPE_DM, + PURPLE_CONVERSATION_TYPE_GROUP_DM, + PURPLE_CONVERSATION_TYPE_CHANNEL, + PURPLE_CONVERSATION_TYPE_THREAD, } PurpleConversationType; /**
--- a/libpurple/tests/test_conversation.c Mon Mar 25 21:43:28 2024 -0500 +++ b/libpurple/tests/test_conversation.c Mon Mar 25 22:25:49 2024 -0500 @@ -38,7 +38,7 @@ PurpleContactInfo *topic_author1 = NULL; PurpleConversation *conversation = NULL; PurpleConversationManager *conversation_manager = NULL; - PurpleConversationType type = PurpleConversationTypeUnset; + PurpleConversationType type = PURPLE_CONVERSATION_TYPE_UNSET; PurpleTags *tags = NULL; GDateTime *created_on = NULL; GDateTime *created_on1 = NULL; @@ -83,7 +83,7 @@ "topic", "the topic...", "topic-author", topic_author, "topic-updated", topic_updated, - "type", PurpleConversationTypeThread, + "type", PURPLE_CONVERSATION_TYPE_THREAD, "user-nickname", "knick-knack", NULL); @@ -153,7 +153,7 @@ g_assert_true(g_date_time_equal(topic_updated1, topic_updated)); g_clear_pointer(&topic_updated1, g_date_time_unref); - g_assert_cmpuint(type, ==, PurpleConversationTypeThread); + g_assert_cmpuint(type, ==, PURPLE_CONVERSATION_TYPE_THREAD); g_assert_cmpstr(user_nickname, ==, "knick-knack"); g_clear_pointer(&user_nickname, g_free);
--- a/libpurple/tests/test_protocol_conversation.c Mon Mar 25 21:43:28 2024 -0500 +++ b/libpurple/tests/test_protocol_conversation.c Mon Mar 25 22:25:49 2024 -0500 @@ -101,7 +101,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); message = g_object_new(PURPLE_TYPE_MESSAGE, NULL); @@ -160,7 +160,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); purple_protocol_conversation_set_topic_async(protocol, conversation, @@ -293,7 +293,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); purple_protocol_conversation_set_avatar_async(protocol, conversation, @@ -349,7 +349,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); purple_protocol_conversation_send_typing(protocol, conversation, @@ -681,7 +681,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); g_object_set_data_full(G_OBJECT(protocol), "conversation", conversation, g_object_unref); @@ -762,7 +762,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); g_object_set_data_full(G_OBJECT(protocol), "conversation", conversation, g_object_unref); @@ -938,7 +938,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); g_object_set_data_full(G_OBJECT(protocol), "conversation", conversation, g_object_unref); @@ -991,7 +991,7 @@ PURPLE_TYPE_CONVERSATION, "account", account, "name", "this is required at the moment", - "type", PurpleConversationTypeDM, + "type", PURPLE_CONVERSATION_TYPE_DM, NULL); test_purple_protocol_conversation_send_typing(protocol, conversation,
--- a/protocols/ircv3/purpleircv3connection.c Mon Mar 25 21:43:28 2024 -0500 +++ b/protocols/ircv3/purpleircv3connection.c Mon Mar 25 22:25:49 2024 -0500 @@ -916,10 +916,10 @@ id); if(!PURPLE_IS_CONVERSATION(conversation)) { - PurpleConversationType type = PurpleConversationTypeDM; + PurpleConversationType type = PURPLE_CONVERSATION_TYPE_DM; if(purple_ircv3_connection_is_channel(connection, id)) { - type = PurpleConversationTypeChannel; + type = PURPLE_CONVERSATION_TYPE_CHANNEL; } conversation = g_object_new(
--- a/protocols/ircv3/purpleircv3protocolconversation.c Mon Mar 25 21:43:28 2024 -0500 +++ b/protocols/ircv3/purpleircv3protocolconversation.c Mon Mar 25 22:25:49 2024 -0500 @@ -142,7 +142,7 @@ conversation = g_object_new( PURPLE_TYPE_CONVERSATION, "account", account, - "type", PurpleConversationTypeChannel, + "type", PURPLE_CONVERSATION_TYPE_CHANNEL, "id", name, "name", name, NULL);