/soc/2013/ankitkv/gobjectification: 250f77369396: Replaced chatn...
Ankit Vani
a at nevitus.org
Fri Jun 28 18:10:36 EDT 2013
Changeset: 250f77369396356f5381617d96922ab256d30d3b
Author: Ankit Vani <a at nevitus.org>
Date: 2013-06-29 03:40 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/250f77369396
Description:
Replaced chatname, buddyname arguments of "chat-buddy-flags" signal with PurpleChatConversationBuddy *
diffstat:
libpurple/conversations.c | 5 ++---
libpurple/conversationtypes.c | 2 +-
libpurple/plugins/signals-test.c | 8 +++++---
libpurple/signals.c | 11 +++++++++++
libpurple/signals.h | 2 ++
libpurple/value.h | 1 +
6 files changed, 22 insertions(+), 7 deletions(-)
diffs (92 lines):
diff --git a/libpurple/conversations.c b/libpurple/conversations.c
--- a/libpurple/conversations.c
+++ b/libpurple/conversations.c
@@ -482,10 +482,9 @@ purple_conversations_init(void)
purple_value_new(PURPLE_TYPE_BOOLEAN));
purple_signal_register(handle, "chat-buddy-flags",
- purple_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4,
+ purple_marshal_VOID__POINTER_UINT_UINT, NULL, 3,
purple_value_new(PURPLE_TYPE_SUBTYPE,
- PURPLE_SUBTYPE_CONVERSATION),
- purple_value_new(PURPLE_TYPE_STRING),
+ PURPLE_SUBTYPE_CONVERSATION_BUDDY),
purple_value_new(PURPLE_TYPE_UINT),
purple_value_new(PURPLE_TYPE_UINT));
diff --git a/libpurple/conversationtypes.c b/libpurple/conversationtypes.c
--- a/libpurple/conversationtypes.c
+++ b/libpurple/conversationtypes.c
@@ -1759,7 +1759,7 @@ purple_chat_conversation_buddy_set_flags
ops->chat_update_user(cb);
purple_signal_emit(purple_conversations_get_handle(),
- "chat-buddy-flags", priv->chat, priv->name, oldflags, flags); /* TODO use ChatBuddy object */
+ "chat-buddy-flags", cb, oldflags, flags);
}
PurpleChatConversationBuddyFlags
diff --git a/libpurple/plugins/signals-test.c b/libpurple/plugins/signals-test.c
--- a/libpurple/plugins/signals-test.c
+++ b/libpurple/plugins/signals-test.c
@@ -446,11 +446,13 @@ chat_buddy_joined_cb(PurpleConversation
}
static void
-chat_buddy_flags_cb(PurpleConversation *conv, const char *user,
- PurpleChatConversationBuddyFlags oldflags, PurpleChatConversationBuddyFlags newflags, void *data)
+chat_buddy_flags_cb(PurpleChatConversationBuddy *cb, PurpleChatConversationBuddyFlags oldflags,
+ PurpleChatConversationBuddyFlags newflags, void *data)
{
purple_debug_misc("signals test", "chat-buddy-flags (%s, %s, %d, %d)\n",
- purple_conversation_get_name(conv), user, oldflags, newflags);
+ purple_conversation_get_name(PURPLE_CONVERSATION(
+ purple_chat_conversation_buddy_get_chat(cb))),
+ purple_chat_conversation_buddy_get_name(cb), oldflags, newflags);
}
static gboolean
diff --git a/libpurple/signals.c b/libpurple/signals.c
--- a/libpurple/signals.c
+++ b/libpurple/signals.c
@@ -693,6 +693,17 @@ purple_marshal_VOID__POINTER_POINTER_UIN
}
void
+purple_marshal_VOID__POINTER_UINT_UINT(PurpleCallback cb, va_list args,
+ void *data, void **return_val)
+{
+ void *arg1 = va_arg(args, void *);
+ guint arg2 = va_arg(args, guint);
+ guint arg3 = va_arg(args, guint);
+
+ ((void (*)(void *, guint, guint, void *))cb)(arg1, arg2, arg3, data);
+}
+
+void
purple_marshal_VOID__POINTER_POINTER_POINTER(PurpleCallback cb, va_list args,
void *data, void **return_val)
{
diff --git a/libpurple/signals.h b/libpurple/signals.h
--- a/libpurple/signals.h
+++ b/libpurple/signals.h
@@ -309,6 +309,8 @@ void purple_marshal_VOID__POINTER_POINTE
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_UINT_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
+void purple_marshal_VOID__POINTER_UINT_UINT(
+ PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER(
diff --git a/libpurple/value.h b/libpurple/value.h
--- a/libpurple/value.h
+++ b/libpurple/value.h
@@ -69,6 +69,7 @@ typedef enum
PURPLE_SUBTYPE_BUDDY_ICON,
PURPLE_SUBTYPE_CONNECTION,
PURPLE_SUBTYPE_CONVERSATION,
+ PURPLE_SUBTYPE_CONVERSATION_BUDDY,
PURPLE_SUBTYPE_PLUGIN,
PURPLE_SUBTYPE_BLIST_NODE,
PURPLE_SUBTYPE_CIPHER,
More information about the Commits
mailing list