/soc/2013/ankitkv/gobjectification: 9bd5bd903dc7: Renamed chat b...

Ankit Vani a at nevitus.org
Fri Jun 28 19:07:29 EDT 2013


Changeset: 9bd5bd903dc74843b5e806ec6a136012787b17c6
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-06-29 04:37 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/9bd5bd903dc7

Description:

Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
* Renamed PurpleIMConversationTypingState to PurpleIMTypingState
* Renamed PurpleChatConversationBuddy to PurpleChatUser
* Renamed PurpleChatConversationBuddyFlags to PurpleChatUserFlags
* Renamed purple_chat_conversation_buddy_ functions to purple_chat_user_ functions
* Replaced 'chat-buddy' with 'chat-user' in conversation signals

diffstat:

 finch/gntconv.c                               |   46 ++--
 finch/gntsound.c                              |   14 +-
 libpurple/conversation.h                      |    6 +-
 libpurple/conversations.c                     |   16 +-
 libpurple/conversationtypes.c                 |  294 +++++++++++++-------------
 libpurple/conversationtypes.h                 |  194 ++++++++--------
 libpurple/plugins/joinpart.c                  |   14 +-
 libpurple/plugins/perl/common/Conversation.xs |   18 +-
 libpurple/plugins/perl/common/Server.xs       |    4 +-
 libpurple/plugins/perl/common/module.h        |    6 +-
 libpurple/plugins/perl/common/typemap         |    6 +-
 libpurple/plugins/psychic.c                   |    2 +-
 libpurple/plugins/signals-test.c              |   50 ++--
 libpurple/pounce.c                            |    6 +-
 libpurple/protocols/gg/confer.c               |    4 +-
 libpurple/protocols/gg/gg.c                   |   12 +-
 libpurple/protocols/irc/msgs.c                |   50 ++--
 libpurple/protocols/jabber/chat.c             |    2 +-
 libpurple/protocols/jabber/chat.h             |    2 +-
 libpurple/protocols/jabber/libfacebook.c      |    2 +-
 libpurple/protocols/jabber/libgtalk.c         |    2 +-
 libpurple/protocols/jabber/libxmpp.c          |    2 +-
 libpurple/protocols/jabber/message.c          |   10 +-
 libpurple/protocols/jabber/message.h          |    2 +-
 libpurple/protocols/jabber/presence.c         |   10 +-
 libpurple/protocols/jabber/roster.c           |    2 +-
 libpurple/protocols/msn/msg.c                 |    4 +-
 libpurple/protocols/msn/msn.c                 |   10 +-
 libpurple/protocols/msn/switchboard.c         |    6 +-
 libpurple/protocols/mxit/multimx.c            |    4 +-
 libpurple/protocols/mxit/mxit.c               |    8 +-
 libpurple/protocols/mxit/protocol.c           |    2 +-
 libpurple/protocols/myspace/myspace.c         |   14 +-
 libpurple/protocols/novell/novell.c           |   12 +-
 libpurple/protocols/null/nullprpl.c           |   26 +-
 libpurple/protocols/oscar/odc.c               |   10 +-
 libpurple/protocols/oscar/oscar.c             |   12 +-
 libpurple/protocols/oscar/oscarcommon.h       |    2 +-
 libpurple/protocols/oscar/peer.h              |    2 +-
 libpurple/protocols/sametime/sametime.c       |   14 +-
 libpurple/protocols/silc/ops.c                |   14 +-
 libpurple/protocols/simple/simple.c           |   10 +-
 libpurple/protocols/yahoo/libymsg.c           |    8 +-
 libpurple/protocols/yahoo/libymsg.h           |    2 +-
 libpurple/protocols/yahoo/yahoochat.c         |   14 +-
 libpurple/protocols/yahoo/ycht.c              |    2 +-
 libpurple/protocols/zephyr/zephyr.c           |   10 +-
 libpurple/prpl.h                              |    4 +-
 libpurple/server.c                            |   14 +-
 libpurple/server.h                            |   16 +-
 libpurple/value.h                             |    3 +-
 pidgin/gtkconv.c                              |  126 +++++-----
 pidgin/gtksound.c                             |   14 +-
 53 files changed, 569 insertions(+), 570 deletions(-)

diffs (truncated from 3404 to 300 lines):

diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -122,7 +122,7 @@ send_typing_notification(GntWidget *w, F
 				unsigned int timeout;
 				timeout = serv_send_typing(purple_conversation_get_connection(conv),
 										   purple_conversation_get_name(conv),
-										   PURPLE_IM_CONVERSATION_TYPING);
+										   PURPLE_IM_TYPING);
 				purple_im_conversation_set_type_again(im, timeout);
 			}
 		} else {
@@ -130,7 +130,7 @@ send_typing_notification(GntWidget *w, F
 
 			serv_send_typing(purple_conversation_get_connection(conv),
 							 purple_conversation_get_name(conv),
-							 PURPLE_IM_CONVERSATION_NOT_TYPING);
+							 PURPLE_IM_NOT_TYPING);
 		}
 	}
 }
@@ -270,7 +270,7 @@ update_buddy_typing(PurpleAccount *accou
 	conv = PURPLE_CONVERSATION(im);
 	ggc = FINCH_CONV(conv);
 
-	if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_CONVERSATION_TYPING) {
+	if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_TYPING) {
 		int scroll;
 		str = get_conversation_title(conv, account);
 		title = g_strdup_printf(_("%s [%s]"), str,
@@ -994,7 +994,7 @@ finch_write_common(PurpleConversation *c
 	g_free(strip);
 
 	if (PURPLE_IS_IM_CONVERSATION(conv) && purple_im_conversation_get_typing_state(
-			PURPLE_IM_CONVERSATION(conv)) == PURPLE_IM_CONVERSATION_TYPING) {
+			PURPLE_IM_CONVERSATION(conv)) == PURPLE_IM_TYPING) {
 		strip = g_strdup_printf(_("\n%s is typing..."), purple_conversation_get_title(conv));
 		gnt_text_view_append_text_with_tag(GNT_TEXT_VIEW(ggconv->tv),
 					strip, GNT_TEXT_FLAG_DIM, "typing");
@@ -1062,15 +1062,15 @@ finch_write_conv(PurpleConversation *con
 }
 
 static const char *
-chat_flag_text(PurpleChatConversationBuddyFlags flags)
+chat_flag_text(PurpleChatUserFlags flags)
 {
-	if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_FOUNDER)
+	if (flags & PURPLE_CHAT_USER_FOUNDER)
 		return "~";
-	if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_OP)
+	if (flags & PURPLE_CHAT_USER_OP)
 		return "@";
-	if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_HALFOP)
+	if (flags & PURPLE_CHAT_USER_HALFOP)
 		return "%";
-	if (flags & PURPLE_CHAT_CONVERSATION_BUDDY_VOICE)
+	if (flags & PURPLE_CHAT_USER_VOICE)
 		return "+";
 	return " ";
 }
@@ -1093,11 +1093,11 @@ finch_chat_add_users(PurpleChatConversat
 				ngettext("List of %d user:\n", "List of %d users:\n", count), count);
 		for (iter = users; iter; iter = iter->next)
 		{
-			PurpleChatConversationBuddy *cbuddy = iter->data;
+			PurpleChatUser *chatuser = iter->data;
 			const char *str;
 
-			if ((str = purple_chat_conversation_buddy_get_alias(cbuddy)) == NULL)
-				str = purple_chat_conversation_buddy_get_name(cbuddy);
+			if ((str = purple_chat_user_get_alias(chatuser)) == NULL)
+				str = purple_chat_user_get_name(chatuser);
 			g_string_append_printf(string, "[ %s ]", str);
 		}
 
@@ -1108,12 +1108,12 @@ finch_chat_add_users(PurpleChatConversat
 
 	for (; users; users = users->next)
 	{
-		PurpleChatConversationBuddy *cbuddy = users->data;
+		PurpleChatUser *chatuser = users->data;
 		GntTree *tree = GNT_TREE(ggc->u.chat->userlist);
-		gnt_entry_add_suggest(entry, purple_chat_conversation_buddy_get_name(cbuddy));
-		gnt_entry_add_suggest(entry, purple_chat_conversation_buddy_get_alias(cbuddy));
-		gnt_tree_add_row_after(tree, g_strdup(purple_chat_conversation_buddy_get_name(cbuddy)),
-				gnt_tree_create_row(tree, chat_flag_text(purple_chat_conversation_buddy_get_flags(cbuddy)), purple_chat_conversation_buddy_get_alias(cbuddy)), NULL, NULL);
+		gnt_entry_add_suggest(entry, purple_chat_user_get_name(chatuser));
+		gnt_entry_add_suggest(entry, purple_chat_user_get_alias(chatuser));
+		gnt_tree_add_row_after(tree, g_strdup(purple_chat_user_get_name(chatuser)),
+				gnt_tree_create_row(tree, chat_flag_text(purple_chat_user_get_flags(chatuser)), purple_chat_user_get_alias(chatuser)), NULL, NULL);
 	}
 }
 
@@ -1124,7 +1124,7 @@ finch_chat_rename_user(PurpleChatConvers
 	FinchConv *ggc = FINCH_CONV(PURPLE_CONVERSATION(chat));
 	GntEntry *entry = GNT_ENTRY(ggc->entry);
 	GntTree *tree = GNT_TREE(ggc->u.chat->userlist);
-	PurpleChatConversationBuddy *cb = purple_chat_conversation_find_buddy(chat, new_n);
+	PurpleChatUser *cb = purple_chat_conversation_find_buddy(chat, new_n);
 
 	gnt_entry_remove_suggest(entry, old);
 	gnt_tree_remove(tree, (gpointer)old);
@@ -1132,7 +1132,7 @@ finch_chat_rename_user(PurpleChatConvers
 	gnt_entry_add_suggest(entry, new_n);
 	gnt_entry_add_suggest(entry, new_a);
 	gnt_tree_add_row_after(tree, g_strdup(new_n),
-			gnt_tree_create_row(tree, chat_flag_text(purple_chat_conversation_buddy_get_flags(cb)), new_a), NULL, NULL);
+			gnt_tree_create_row(tree, chat_flag_text(purple_chat_user_get_flags(cb)), new_a), NULL, NULL);
 }
 
 static void
@@ -1149,18 +1149,18 @@ finch_chat_remove_users(PurpleChatConver
 }
 
 static void
-finch_chat_update_user(PurpleChatConversationBuddy *cb)
+finch_chat_update_user(PurpleChatUser *cb)
 {
 	PurpleChatConversation *chat;
 	FinchConv *ggc;
 	if (!cb)
 		return;
 
-	chat = purple_chat_conversation_buddy_get_chat(cb);
+	chat = purple_chat_user_get_chat(cb);
 	ggc = FINCH_CONV(PURPLE_CONVERSATION(chat));
 	gnt_tree_change_text(GNT_TREE(ggc->u.chat->userlist),
-			(gpointer)purple_chat_conversation_buddy_get_name(cb), 0,
-			chat_flag_text(purple_chat_conversation_buddy_get_flags(cb)));
+			(gpointer)purple_chat_user_get_name(cb), 0,
+			chat_flag_text(purple_chat_user_get_flags(cb)));
 }
 
 static void
diff --git a/finch/gntsound.c b/finch/gntsound.c
--- a/finch/gntsound.c
+++ b/finch/gntsound.c
@@ -218,8 +218,8 @@ im_msg_sent_cb(PurpleAccount *account, c
 }
 
 static void
-chat_buddy_join_cb(PurpleChatConversation *chat, const char *name,
-				   PurpleChatConversationBuddyFlags flags, gboolean new_arrival,
+chat_user_join_cb(PurpleChatConversation *chat, const char *name,
+				   PurpleChatUserFlags flags, gboolean new_arrival,
 				   PurpleSoundEventID event)
 {
 	if (new_arrival && !chat_nick_matches_name(chat, name))
@@ -227,7 +227,7 @@ chat_buddy_join_cb(PurpleChatConversatio
 }
 
 static void
-chat_buddy_left_cb(PurpleChatConversation *chat, const char *name,
+chat_user_left_cb(PurpleChatConversation *chat, const char *name,
 				   const char *reason, PurpleSoundEventID event)
 {
 	if (!chat_nick_matches_name(chat, name))
@@ -398,11 +398,11 @@ finch_sound_init(void)
 	purple_signal_connect(conv_handle, "sent-im-msg",
 						gnt_sound_handle, PURPLE_CALLBACK(im_msg_sent_cb),
 						GINT_TO_POINTER(PURPLE_SOUND_SEND));
-	purple_signal_connect(conv_handle, "chat-buddy-joined",
-						gnt_sound_handle, PURPLE_CALLBACK(chat_buddy_join_cb),
+	purple_signal_connect(conv_handle, "chat-user-joined",
+						gnt_sound_handle, PURPLE_CALLBACK(chat_user_join_cb),
 						GINT_TO_POINTER(PURPLE_SOUND_CHAT_JOIN));
-	purple_signal_connect(conv_handle, "chat-buddy-left",
-						gnt_sound_handle, PURPLE_CALLBACK(chat_buddy_left_cb),
+	purple_signal_connect(conv_handle, "chat-user-left",
+						gnt_sound_handle, PURPLE_CALLBACK(chat_user_left_cb),
 						GINT_TO_POINTER(PURPLE_SOUND_CHAT_LEAVE));
 	purple_signal_connect(conv_handle, "sent-chat-msg",
 						gnt_sound_handle, PURPLE_CALLBACK(chat_msg_sent_cb),
diff --git a/libpurple/conversation.h b/libpurple/conversation.h
--- a/libpurple/conversation.h
+++ b/libpurple/conversation.h
@@ -194,7 +194,7 @@ struct _PurpleConversationUiOps
 	                   time_t mtime);
 
 	/** Add @a cbuddies to a chat.
-	 *  @param cbuddies      A @c GList of #PurpleChatConversationBuddy structs.
+	 *  @param cbuddies      A @c GList of #PurpleChatUser structs.
 	 *  @param new_arrivals  Whether join notices should be shown.
 	 *                       (Join notices are actually written to the
 	 *                       conversation by
@@ -216,9 +216,9 @@ struct _PurpleConversationUiOps
 	 */
 	void (*chat_remove_users)(PurpleChatConversation *chat, GList *users);
 	/** Called when a user's flags are changed.
-	 *  @see purple_chat_conversation_buddy_set_flags()
+	 *  @see purple_chat_user_set_flags()
 	 */
-	void (*chat_update_user)(PurpleChatConversationBuddy *cb);
+	void (*chat_update_user)(PurpleChatUser *cb);
 
 	/** Present this conversation to the user; for example, by displaying
 	 *  the IM dialog.
diff --git a/libpurple/conversations.c b/libpurple/conversations.c
--- a/libpurple/conversations.c
+++ b/libpurple/conversations.c
@@ -465,7 +465,7 @@ purple_conversations_init(void)
 										PURPLE_SUBTYPE_ACCOUNT),
 						 purple_value_new(PURPLE_TYPE_STRING));
 
-	purple_signal_register(handle, "chat-buddy-joining",
+	purple_signal_register(handle, "chat-user-joining",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_UINT,
 						 purple_value_new(PURPLE_TYPE_BOOLEAN), 3,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
@@ -473,7 +473,7 @@ purple_conversations_init(void)
 						 purple_value_new(PURPLE_TYPE_STRING),
 						 purple_value_new(PURPLE_TYPE_UINT));
 
-	purple_signal_register(handle, "chat-buddy-joined",
+	purple_signal_register(handle, "chat-user-joined",
 						 purple_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
 										PURPLE_SUBTYPE_CONVERSATION),
@@ -481,14 +481,14 @@ purple_conversations_init(void)
 						 purple_value_new(PURPLE_TYPE_UINT),
 						 purple_value_new(PURPLE_TYPE_BOOLEAN));
 
-	purple_signal_register(handle, "chat-buddy-flags",
+	purple_signal_register(handle, "chat-user-flags",
 						 purple_marshal_VOID__POINTER_UINT_UINT, NULL, 3,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CONVERSATION_BUDDY),
+										PURPLE_SUBTYPE_CHATUSER),
 						 purple_value_new(PURPLE_TYPE_UINT),
 						 purple_value_new(PURPLE_TYPE_UINT));
 
-	purple_signal_register(handle, "chat-buddy-leaving",
+	purple_signal_register(handle, "chat-user-leaving",
 						 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER,
 						 purple_value_new(PURPLE_TYPE_BOOLEAN), 3,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
@@ -496,17 +496,17 @@ purple_conversations_init(void)
 						 purple_value_new(PURPLE_TYPE_STRING),
 						 purple_value_new(PURPLE_TYPE_STRING));
 
-	purple_signal_register(handle, "chat-buddy-left",
+	purple_signal_register(handle, "chat-user-left",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
 										PURPLE_SUBTYPE_CONVERSATION),
 						 purple_value_new(PURPLE_TYPE_STRING),
 						 purple_value_new(PURPLE_TYPE_STRING));
 
-	purple_signal_register(handle, "deleting-chat-buddy",
+	purple_signal_register(handle, "deleting-chat-user",
 						 purple_marshal_VOID__POINTER, NULL, 1,
 						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_CHATBUDDY));
+										PURPLE_SUBTYPE_CHATUSER));
 
 	purple_signal_register(handle, "chat-inviting-user",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
diff --git a/libpurple/conversationtypes.c b/libpurple/conversationtypes.c
--- a/libpurple/conversationtypes.c
+++ b/libpurple/conversationtypes.c
@@ -39,11 +39,11 @@ typedef struct _PurpleChatConversationPr
 /** @copydoc _PurpleIMConversationPrivate */
 typedef struct _PurpleIMConversationPrivate       PurpleIMConversationPrivate;
 
-#define PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(obj) \
-	(G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_CHAT_CONVERSATION_BUDDY, PurpleChatConversationBuddyPrivate))
+#define PURPLE_CHAT_USER_GET_PRIVATE(obj) \
+	(G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_CHAT_CONVERSATION_BUDDY, PurpleChatUserPrivate))
 
-/** @copydoc _PurpleChatConversationBuddyPrivate */
-typedef struct _PurpleChatConversationBuddyPrivate  PurpleChatConversationBuddyPrivate;
+/** @copydoc _PurpleChatUserPrivate */
+typedef struct _PurpleChatUserPrivate  PurpleChatUserPrivate;
 
 /**
  * Data specific to Chats.
@@ -79,7 +79,7 @@ enum {
  */
 struct _PurpleIMConversationPrivate
 {
-	PurpleIMConversationTypingState typing_state;      /**< The current typing state.    */
+	PurpleIMTypingState typing_state;      /**< The current typing state.    */
 	guint  typing_timeout;             /**< The typing timer handle.     */
 	time_t type_again;                 /**< The type again time.         */
 	guint  send_typed_timeout;         /**< The type again timer handle. */
@@ -98,7 +98,7 @@ enum {
 /**
  * Data for "Chat Buddies"
  */
-struct _PurpleChatConversationBuddyPrivate
+struct _PurpleChatUserPrivate
 {
 	/** The chat */
 	PurpleChatConversation *chat;
@@ -126,7 +126,7 @@ struct _PurpleChatConversationBuddyPriva
 	 * A bitwise OR of flags for this participant, such as whether they
 	 * are a channel operator.
 	 */
-	PurpleChatConversationBuddyFlags flags;
+	PurpleChatUserFlags flags;



More information about the Commits mailing list