/soc/2013/ankitkv/gobjectification: 89233fea4432: Added function...

Ankit Vani a at nevitus.org
Sat Jun 22 18:21:21 EDT 2013


Changeset: 89233fea4432ddde17f3c98cbab2cd938720d191
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-06-23 03:50 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/89233fea4432

Description:

Added functions to find IM and Chat by account in the conversations API.
* Changed return type of IM new() and Chat new() to PurpleConversation
* Added purple_conversations_find_im_with_account()
* Added purple_conversations_find_chat_with_account()

diffstat:

 libpurple/conversations.h                     |  32 +++++++++++++++++++++-----
 libpurple/conversationtypes.h                 |   4 +-
 libpurple/plugins/perl/common/Conversation.xs |  17 ++++++++++---
 3 files changed, 41 insertions(+), 12 deletions(-)

diffs (117 lines):

diff --git a/libpurple/conversations.h b/libpurple/conversations.h
--- a/libpurple/conversations.h
+++ b/libpurple/conversations.h
@@ -61,17 +61,37 @@ GList *purple_conversations_get_ims(void
  */
 GList *purple_conversations_get_chats(void);
 
-/** TODO type
- * Finds a conversation with the specified type, name, and Purple account.
+/** TODO all
+ * Finds a conversation of any type with the specified name and Purple account.
  *
- * @param type The type of the conversation.
  * @param name The name of the conversation.
  * @param account The purple_account associated with the conversation.
  *
  * @return The conversation if found, or @c NULL otherwise.
  */
-PurpleConversation *purple_conversations_find_with_account(
-		GType type, const char *name,
+PurpleConversation *purple_conversations_find_with_account(const char *name,
+		const PurpleAccount *account);
+
+/** TODO IMs
+ * Finds an IM with the specified name and Purple account.
+ *
+ * @param name The name of the conversation.
+ * @param account The purple_account associated with the conversation.
+ *
+ * @return The conversation if found, or @c NULL otherwise.
+ */
+PurpleConversation *purple_conversations_find_im_with_account(const char *name,
+		const PurpleAccount *account);
+
+/** TODO chats
+ * Finds a chat with the specified name and Purple account.
+ *
+ * @param name The name of the conversation.
+ * @param account The purple_account associated with the conversation.
+ *
+ * @return The conversation if found, or @c NULL otherwise.
+ */
+PurpleConversation *purple_conversations_find_chat_with_account(const char *name,
 		const PurpleAccount *account);
 
 /**
@@ -82,7 +102,7 @@ PurpleConversation *purple_conversations
  *
  * @return The chat conversation.
  */
-PurpleChatConversation *purple_conversations_find_chat(const PurpleConnection *gc, int id);
+PurpleConversation *purple_conversations_find_chat(const PurpleConnection *gc, int id);
 
 /**
  * Sets the default conversation UI operations structure.
diff --git a/libpurple/conversationtypes.h b/libpurple/conversationtypes.h
--- a/libpurple/conversationtypes.h
+++ b/libpurple/conversationtypes.h
@@ -217,7 +217,7 @@ GType purple_im_conversation_get_type(vo
  *
  * @return The new conversation.
  */
-PurpleIMConversation *purple_im_conversation_new(PurpleAccount *account,
+PurpleConversation *purple_im_conversation_new(PurpleAccount *account,
 		const char *name);
 
 /**
@@ -389,7 +389,7 @@ GType purple_chat_conversation_get_type(
  *
  * @return The new conversation.
  */
-PurpleChatConversation *purple_chat_conversation_new(PurpleAccount *account,
+PurpleConversation *purple_chat_conversation_new(PurpleAccount *account,
 		const char *name);
 
 /**
diff --git a/libpurple/plugins/perl/common/Conversation.xs b/libpurple/plugins/perl/common/Conversation.xs
--- a/libpurple/plugins/perl/common/Conversation.xs
+++ b/libpurple/plugins/perl/common/Conversation.xs
@@ -118,8 +118,17 @@ PPCODE:
 	}
 
 Purple::Conversation
-purple_conversations_find_with_account(type, name, account)
-	GType type
+purple_conversations_find_with_account(name, account)
+	const char *name
+	Purple::Account account
+
+Purple::ChatConversation
+purple_conversations_find_chat_with_account(name, account)
+	const char *name
+	Purple::Account account
+
+Purple::IMConversation
+purple_conversations_find_im_with_account(name, account)
 	const char *name
 	Purple::Account account
 
@@ -225,7 +234,7 @@ purple_conversation_do_command(conv, cmd
 MODULE = Purple::Conversation  PACKAGE = Purple::IMConversation  PREFIX = purple_im_conversation_
 PROTOTYPES: ENABLE
 
-Purple::IMConversation
+Purple::Conversation
 purple_im_conversation_new(class, account, name)
 	Purple::Account account
 	const char *name
@@ -308,7 +317,7 @@ purple_conversation_custom_smiley_close(
 MODULE = Purple::Conversation  PACKAGE = Purple::ChatConversation  PREFIX = purple_chat_conversation_
 PROTOTYPES: ENABLE
 
-Purple::ChatConversation
+Purple::Conversation
 purple_chat_conversation_new(class, account, name)
 	Purple::Account account
 	const char *name



More information about the Commits mailing list