/soc/2013/ankitkv/gobjectification: 0b7f4cacdf8e: Used conversat...

Ankit Vani a at nevitus.org
Mon Oct 7 08:38:52 EDT 2013


Changeset: 0b7f4cacdf8e9758f4ef79b5f05a948069edf65e
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-10-07 18:07 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/0b7f4cacdf8e

Description:

Used conversation subtypes for conversation signals wherever appropriate

diffstat:

 doc/conversation-signals.dox |  71 ++++++++++++++++++++++---------------------
 libpurple/conversations.c    |  34 ++++++++++----------
 2 files changed, 53 insertions(+), 52 deletions(-)

diffs (truncated from 412 to 300 lines):

diff --git a/doc/conversation-signals.dox b/doc/conversation-signals.dox
--- a/doc/conversation-signals.dox
+++ b/doc/conversation-signals.dox
@@ -43,7 +43,7 @@
  @signaldef writing-im-msg
   @signalproto
 gboolean (*writing_im_msg)(PurpleAccount *account, const char *who,
-                           char **message, PurpleConversation *conv,
+                           char **message, PurpleIMConversation *im,
                            PurpleMessageFlags flags);
   @endsignalproto
   @signaldesc
@@ -55,7 +55,7 @@ gboolean (*writing_im_msg)(PurpleAccount
   @param account The account.
   @param who     The name of the user.
   @param message A pointer to the message.
-  @param conv    The conversation.
+  @param im      The IM conversation.
   @param flags   Flags for this message.
   @return @c TRUE if the message should be canceled, or @c FALSE otherwise.
  @endsignaldef
@@ -63,7 +63,7 @@ gboolean (*writing_im_msg)(PurpleAccount
  @signaldef wrote-im-msg
   @signalproto
 void (*wrote_im_msg)(PurpleAccount *account, const char *who,
-                     char *message, PurpleConversation *conv,
+                     char *message, PurpleIMConversation *im,
                      PurpleMessageFlags flags);
   @endsignalproto
   @signaldesc
@@ -71,7 +71,7 @@ void (*wrote_im_msg)(PurpleAccount *acco
   @param account The account.
   @param who     The name of the user.
   @param message The message.
-  @param conv    The conversation.
+  @param im      The IM conversation.
   @param flags   Flags for this message.
  @endsignaldef
 
@@ -105,7 +105,7 @@ void (*sent_im_msg)(PurpleAccount *accou
  @signaldef receiving-im-msg
   @signalproto
 gboolean (*receiving_im_msg)(PurpleAccount *account, char **sender,
-                             char **message, PurpleConversation *conv,
+                             char **message, PurpleIMConversation *im,
                              PurpleMessageFlags *flags);
   @endsignalproto
   @signaldesc
@@ -119,21 +119,21 @@ gboolean (*receiving_im_msg)(PurpleAccou
   @param account The account the message was received on.
   @param sender  A pointer to the username of the sender.
   @param message A pointer to the message that was sent.
-  @param conv    The IM conversation.
+  @param im      The IM conversation.
   @param flags   A pointer to the IM message flags.
  @endsignaldef
 
  @signaldef received-im-msg
   @signalproto
 void (*received_im_msg)(PurpleAccount *account, char *sender, char *message,
-                        PurpleConversation *conv, PurpleMessageFlags flags);
+                        PurpleIMConversation *im, PurpleMessageFlags flags);
   @endsignalproto
   @signaldesc
    Emitted after an IM is received.
   @param account The account the message was received on.
   @param sender  The username of the sender.
   @param message The message that was sent.
-  @param conv    The IM conversation.
+  @param im      The IM conversation.
   @param flags   The IM message flags.
  @endsignaldef
 
@@ -154,7 +154,7 @@ void (*blocked_im_msg)(PurpleAccount *ac
  @signaldef writing-chat-msg
   @signalproto
 gboolean (*writing_chat_msg)(PurpleAccount *account, const char *who,
-                             char **message, PurpleConversation *conv,
+                             char **message, PurpleChatConversation *chat,
                              PurpleMessageFlags flags);
   @endsignalproto
   @signaldesc
@@ -166,7 +166,7 @@ gboolean (*writing_chat_msg)(PurpleAccou
   @param account The account.
   @param who     The name of the user.
   @param message A pointer to the message.
-  @param conv    The conversation.
+  @param chat    The chat conversation.
   @param flags   Flags for this message.
   @return @c TRUE if the message should be canceled, or @c FALSE otherwise.
  @endsignaldef
@@ -174,7 +174,7 @@ gboolean (*writing_chat_msg)(PurpleAccou
  @signaldef wrote-chat-msg
   @signalproto
 void (*wrote_chat_msg)(PurpleAccount *account, const char *who,
-                       char *message, PurpleConversation *conv,
+                       char *message, PurpleChatConversation *chat,
                        PurpleMessageFlags flags);
   @endsignalproto
   @signaldesc
@@ -182,7 +182,7 @@ void (*wrote_chat_msg)(PurpleAccount *ac
   @param account The account.
   @param who     The name of the user.
   @param message The message.
-  @param conv    The conversation.
+  @param chat    The chat conversation.
   @param flags   Flags for this message.
  @endsignaldef
 
@@ -214,7 +214,7 @@ void (*sent_chat_msg)(PurpleAccount *acc
  @signaldef receiving-chat-msg
   @signalproto
 gboolean (*receiving_chat_msg)(PurpleAccount *account, char **sender,
-                              char **message, PurpleConversation *conv, int *flags);
+                      char **message, PurpleChatConversation *chat, int *flags);
   @endsignalproto
   @signaldesc
    Emitted when a chat message is received. The callback can replace the
@@ -227,21 +227,21 @@ gboolean (*receiving_chat_msg)(PurpleAcc
   @param account The account the message was received on.
   @param sender  A pointer to the username of the sender.
   @param message A pointer to the message that was sent.
-  @param conv    The chat conversation.
+  @param chat    The chat conversation.
   @param flags   A pointer to the chat message flags
  @endsignaldef
 
  @signaldef received-chat-msg
   @signalproto
 void (*received_chat_msg)(PurpleAccount *account, char *sender, char *message,
-                              PurpleConversation *conv, PurpleMessageFlags flags);
+                        PurpleChatConversation *chat, PurpleMessageFlags flags);
   @endsignalproto
   @signaldesc
    Emitted after a chat message is received.
   @param account The account the message was received on.
   @param sender  The username of the sender.
   @param message The message that was sent.
-  @param conv    The chat conversation.
+  @param chat    The chat conversation.
   @param flags   The chat message flags.
  @endsignaldef
 
@@ -296,27 +296,27 @@ void (*buddy_typing_stopped)(PurpleAccou
 
  @signaldef chat-user-joining
   @signalproto
-gboolean (*chat_user_joining)(PurpleConversation *conv, const char *name,
+gboolean (*chat_user_joining)(PurpleChatConversation *chat, const char *name,
                            PurpleChatUserFlags flags);
   @endsignalproto
   @signaldesc
    Emitted when a buddy is joining a chat, before the list of
    users in the chat updates to include the new user.
   @return @c TRUE if the join should be hidden, or @c FALSE otherwise.
-  @param conv The chat conversation.
+  @param chat The chat conversation.
   @param name The name of the user that is joining the conversation.
   @param flags The flags of the user that is joining the conversation.
  @endsignaldef
 
  @signaldef chat-user-joined
   @signalproto
-void (*chat_user_joined)(PurpleConversation *conv, const char *name,
+void (*chat_user_joined)(PurpleChatConversation *chat, const char *name,
                           PurpleChatUserFlags flags,
                           gboolean new_arrival);
   @endsignalproto
   @signaldesc
    Emitted when a buddy joined a chat, after the users list is updated.
-  @param conv The chat conversation.
+  @param chat The chat conversation.
   @param name The name of the user that has joined the conversation.
   @param flags The flags of the user that has joined the conversation.
   @param new_arrival If the buddy is a new arrival.
@@ -349,34 +349,34 @@ void (*chat_user_flags)(PurpleChatUser *
 
  @signaldef chat-user-leaving
   @signalproto
-gboolean (*chat_user_leaving)(PurpleConversation *conv, const char *name,
+gboolean (*chat_user_leaving)(PurpleChatConversation *chat, const char *name,
                            const char *reason);
   @endsignalproto
   @signaldesc
    Emitted when a user is leaving a chat, before the user list is updated.
    This may include an optional reason why the user is leaving.
   @return @c TRUE if the leave should be hidden, or @c FALSE otherwise.
-  @param conv   The chat conversation.
+  @param chat   The chat conversation.
   @param name   The name of the user that is leaving the chat.
   @param reason The optional reason why the user is leaving.
  @endsignaldef
 
  @signaldef chat-user-left
   @signalproto
-void (*chat_user_left)(PurpleConversation *conv, const char *name,
+void (*chat_user_left)(PurpleChatConversation *chat, const char *name,
                         const char *reason);
   @endsignalproto
   @signaldesc
    Emitted when a user leaves a chat, after the user list is updated.
    This may include an optional reason why the user is leaving.
-  @param conv   The chat conversation.
+  @param chat   The chat conversation.
   @param name   The name of the user that left the chat.
   @param reason The optional reason why the user left the chat.
  @endsignaldef
 
  @signaldef chat-inviting-user
   @signalproto
-void (*chat_inviting_user)(PurpleConversation *conv, const char *name,
+void (*chat_inviting_user)(PurpleChatConversation *chat, const char *name,
                            char **invite_message);
   @endsignalproto
   @signaldesc
@@ -385,7 +385,7 @@ void (*chat_inviting_user)(PurpleConvers
    the invite message.
   @note
    Make sure to free @a *invite_message before you replace it!
-  @param conv           The chat conversation.
+  @param chat           The chat conversation.
   @param name           The name of the user being invited.
   @param invite_message A pointer to the reason why a user is being
                         invited.
@@ -393,13 +393,13 @@ void (*chat_inviting_user)(PurpleConvers
 
  @signaldef chat-invited-user
   @signalproto
-void (*chat_invited_user)(PurpleConversation *conv, const char *name,
+void (*chat_invited_user)(PurpleChatConversation *conv, const char *name,
                           const char *invite_message);
   @endsignalproto
   @signaldesc
    Emitted when a user invited another user to a chat.
-  @param conv           The chat conversation.
-  @param conv           The name of the user that was invited.
+  @param chat           The chat conversation.
+  @param name           The name of the user that was invited.
   @param invite_message The message to be sent to the user when invited.
  @endsignaldef
 
@@ -438,29 +438,30 @@ void (*chat_invite_blocked)(PurpleAccoun
 
  @signaldef chat-joined
   @signalproto
-void (*chat_joined)(PurpleConversation *conv);
+void (*chat_joined)(PurpleChatConversation *chat);
   @endsignalproto
   @signaldesc
    Emitted when an account joins a chat room.
-  @param conv The conversation that joined the chat room.
+  @param chat The conversation that joined the chat room.
  @endsignaldef
 
  @signaldef chat-left
   @signalproto
-void (*chat_left)(PurpleConversation *conv);
+void (*chat_left)(PurpleChatConversation *chat);
   @endsignalproto
   @signaldesc
    Emitted when an account leaves a chat room.
-  @param conv The conversation that left the chat room.
+  @param chat The conversation that left the chat room.
  @endsignaldef
 
  @signaldef chat-topic-changed
   @signalproto
-void (*chat_topic_changed)(PurpleConversation *conv, const char *who, const char *topic);
+void (*chat_topic_changed)(PurpleChatConversation *chat, const char *who,
+                           const char *topic);
   @endsignalproto
   @signaldesc
    Emitted when the topic is changed in a chat.
-  @param conv  The conversation whose topic changed.
+  @param chat  The chat conversation whose topic changed.
   @param who   The name of the person that changed the topic.
   @param topic The new topic.
  @endsignaldef
diff --git a/libpurple/conversations.c b/libpurple/conversations.c
--- a/libpurple/conversations.c
+++ b/libpurple/conversations.c
@@ -287,12 +287,12 @@ purple_conversations_init(void)
 						 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT,
 						 G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
 						 G_TYPE_POINTER, /* pointer to a string */
-						 PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
+						 PURPLE_TYPE_IM_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "wrote-im-msg",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
 						 G_TYPE_NONE, 5, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
-						 G_TYPE_STRING, PURPLE_TYPE_CONVERSATION, G_TYPE_UINT);
+						 G_TYPE_STRING, PURPLE_TYPE_IM_CONVERSATION, G_TYPE_UINT);
 
 	purple_signal_register(handle, "sent-attention",
 						 purple_marshal_VOID__POINTER_POINTER_POINTER_UINT,
@@ -319,13 +319,13 @@ purple_conversations_init(void)
 						 G_TYPE_BOOLEAN, 5, PURPLE_TYPE_ACCOUNT,
 						 G_TYPE_POINTER, /* pointer to a string */
 						 G_TYPE_POINTER, /* pointer to a string */



More information about the Commits mailing list