/soc/2013/ankitkv/gobjectification: a7c26ee6e466: Merged soc.201...

Ankit Vani a at nevitus.org
Mon Sep 16 08:46:08 EDT 2013


Changeset: a7c26ee6e466a829a5a111b0ef0800262e48c807
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-16 18:08 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/a7c26ee6e466

Description:

Merged soc.2013.gobjectification branch

diffstat:

 libpurple/Makefile.mingw                 |     1 +
 libpurple/plugins/perl/common/Request.xs |    39 +-
 libpurple/protocols/gg/Makefile.am       |    77 +-
 libpurple/protocols/gg/Makefile.mingw    |    12 +-
 libpurple/protocols/gg/avatar.c          |    29 +-
 libpurple/protocols/gg/chat.c            |   619 +++++++++++++++
 libpurple/protocols/gg/chat.h            |    34 +
 libpurple/protocols/gg/confer.c          |   169 ----
 libpurple/protocols/gg/confer.h          |    93 --
 libpurple/protocols/gg/edisc.c           |  1175 ++++++++++++++++++++++++++++++
 libpurple/protocols/gg/edisc.h           |    22 +
 libpurple/protocols/gg/gg.c              |   806 +++++---------------
 libpurple/protocols/gg/gg.h              |    40 +-
 libpurple/protocols/gg/html.c            |   158 ++++
 libpurple/protocols/gg/html.h            |    32 +
 libpurple/protocols/gg/image.c           |   330 ++++---
 libpurple/protocols/gg/image.h           |    21 +-
 libpurple/protocols/gg/libgadu-events.c  |    45 +
 libpurple/protocols/gg/libgadu-events.h  |     6 +
 libpurple/protocols/gg/libgaduw.c        |    69 +
 libpurple/protocols/gg/libgaduw.h        |     6 +-
 libpurple/protocols/gg/message-prpl.c    |   805 ++++++++++++++++++++
 libpurple/protocols/gg/message-prpl.h    |    22 +
 libpurple/protocols/gg/multilogon.c      |    12 +-
 libpurple/protocols/gg/multilogon.h      |     1 -
 libpurple/protocols/gg/purplew.c         |    14 +-
 libpurple/protocols/gg/roster.c          |     2 +-
 libpurple/protocols/gg/servconn.c        |     6 +-
 libpurple/protocols/gg/status.c          |    22 +-
 libpurple/protocols/gg/tcpsocket.c       |   113 ++
 libpurple/protocols/gg/tcpsocket.h       |    13 +
 libpurple/protocols/gg/utils.c           |    64 +-
 libpurple/protocols/gg/utils.h           |    19 +-
 libpurple/protocols/jabber/auth_cyrus.c  |     2 +-
 valgrind-suppressions                    |    69 +
 35 files changed, 3792 insertions(+), 1155 deletions(-)

diffs (truncated from 5938 to 300 lines):

diff --git a/libpurple/Makefile.mingw b/libpurple/Makefile.mingw
--- a/libpurple/Makefile.mingw
+++ b/libpurple/Makefile.mingw
@@ -156,6 +156,7 @@ LIBS =	\
 		-lnss3 \
 		-lnspr4 \
 		-lgnutls \
+		-lz \
 		$(VV_LIBS)
 
 include $(PIDGIN_COMMON_RULES)
diff --git a/libpurple/plugins/perl/common/Request.xs b/libpurple/plugins/perl/common/Request.xs
--- a/libpurple/plugins/perl/common/Request.xs
+++ b/libpurple/plugins/perl/common/Request.xs
@@ -287,41 +287,48 @@ Purple::Request::Field
 purple_request_field_choice_new(class, id, text, default_value = 0)
 	const char *id
 	const char *text
-	int default_value
+	gpointer default_value
 	C_ARGS: id, text, default_value
 
 void
-purple_request_field_choice_add(field, label)
+purple_request_field_choice_add(field, label, value)
 	Purple::Request::Field field
 	const char *label
+	gpointer value
 
-int
+gpointer
 purple_request_field_choice_get_default_value(field)
 	Purple::Request::Field field
 
-void
-purple_request_field_choice_get_labels(field)
-	Purple::Request::Field field
-PREINIT:
-	GList *l;
-PPCODE:
-	for (l = purple_request_field_choice_get_labels(field); l != NULL; l = l->next) {
-		XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
-	}
+ # I'm not sure, if this is the correct implementation - if anyone will need it,
+ # he will add this back to API.
+ #void
+ #purple_request_field_choice_get_elements(field)
+ #	Purple::Request::Field field
+ #PREINIT:
+ #	GList *l;
+ #PPCODE:
+ #	for (l = purple_request_field_choice_get_elements(field); l != NULL; l = l->next) {
+ #		XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
+ #		l = l->next;
+ #		if (l == NULL)
+ #			break;
+ #		XPUSHs(l->data);
+ #	}
 
-int
+gpointer
 purple_request_field_choice_get_value(field)
 	Purple::Request::Field field
 
 void
 purple_request_field_choice_set_default_value(field, default_value)
 	Purple::Request::Field field
-	int default_value
+	gpointer default_value
 
 void
 purple_request_field_choice_set_value(field, value)
 	Purple::Request::Field field
-	int value
+	gpointer value
 
 MODULE = Purple::Request  PACKAGE = Purple::Request::Field  PREFIX = purple_request_field_
 PROTOTYPES: ENABLE
@@ -604,7 +611,7 @@ purple_request_fields_get_bool(fields, i
 	Purple::Request::Fields fields
 	const char *id
 
-int
+gpointer
 purple_request_fields_get_choice(fields, id)
 	Purple::Request::Fields fields
 	const char *id
diff --git a/libpurple/protocols/gg/Makefile.am b/libpurple/protocols/gg/Makefile.am
--- a/libpurple/protocols/gg/Makefile.am
+++ b/libpurple/protocols/gg/Makefile.am
@@ -1,5 +1,7 @@
 #V=0
-#GADU_EXTRA_WARNINGS = -Wall -Wextra -Werror
+#CFLAGS = -g -O0
+GADU_EXTRA = -Wall -Wextra -fno-inline
+#GADU_EXTRA += -Werror
 
 pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
@@ -49,46 +51,56 @@ GADU_LIBS += $(GNUTLS_LIBS)
 GADU_CFLAGS += $(GNUTLS_CFLAGS)
 endif
 
+GADU_LIBS += $(JSON_LIBS)
+
 GGSOURCES = \
 	$(INTGGSOURCES) \
-	utils.h \
-	utils.c \
-	confer.h \
-	confer.c \
+	account.c \
+	account.h \
+	avatar.c \
+	avatar.h \
+	blist.c \
 	blist.h \
-	blist.c \
+	chat.c \
+	chat.h \
+	deprecated.c \
+	deprecated.h \
+	edisc.c \
+	edisc.h \
+	gg.c \
 	gg.h \
-	gg.c \
+	html.c \
+	html.h \
+	image.c \
+	image.h \
+	libgadu-events.c \
+	libgadu-events.h \
+	libgaduw.c \
+	libgaduw.h \
+	message-prpl.c \
+	message-prpl.h \
+	multilogon.c \
+	multilogon.h \
+	pubdir-prpl.c \
+	pubdir-prpl.h \
+	purplew.c \
+	purplew.h \
+	resolver-purple.c \
 	resolver-purple.h \
-	resolver-purple.c \
-	image.h \
-	image.c \
-	account.h \
-	account.c \
-	deprecated.h \
-	deprecated.c \
-	purplew.h \
-	purplew.c \
-	libgaduw.h \
-	libgaduw.c \
-	avatar.h \
-	avatar.c \
-	libgadu-events.h \
-	libgadu-events.c \
 	roster.c \
 	roster.h \
+	servconn.c \
+	servconn.h \
+	status.c \
+	status.h \
+	tcpsocket.c \
+	tcpsocket.h \
+	utils.c \
+	utils.h \
 	validator.c \
 	validator.h \
 	xml.c \
 	xml.h \
-	multilogon.c \
-	multilogon.h \
-	status.c \
-	status.h \
-	servconn.c \
-	servconn.h \
-	pubdir-prpl.c \
-	pubdir-prpl.h \
 	oauth/oauth.c \
 	oauth/oauth.h \
 	oauth/oauth-parameter.c \
@@ -118,10 +130,11 @@ libgg_la_LIBADD  = $(GLIB_LIBS) $(GADU_L
 endif
 
 AM_CPPFLAGS = \
-	$(GADU_EXTRA_WARNINGS) \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	$(INTGG_CFLAGS) \
 	$(GLIB_CFLAGS) \
+	$(JSON_CFLAGS) \
 	$(GPLUGIN_CFLAGS) \
-	$(DEBUG_CFLAGS)
+	$(DEBUG_CFLAGS) \
+	$(GADU_EXTRA)
diff --git a/libpurple/protocols/gg/Makefile.mingw b/libpurple/protocols/gg/Makefile.mingw
--- a/libpurple/protocols/gg/Makefile.mingw
+++ b/libpurple/protocols/gg/Makefile.mingw
@@ -32,11 +32,13 @@ INCLUDE_PATHS +=\
 			-I$(GTK_TOP)/include \
 			-I$(GTK_TOP)/include/glib-2.0 \
 			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(GNUTLS_TOP)/include
+			-I$(GNUTLS_TOP)/include \
+			-I$(JSON_GLIB_TOP)/include/json-glib-1.0
 
 LIB_PATHS += \
 			-L$(GTK_TOP)/lib \
 			-L$(GNUTLS_TOP)/lib \
+			-L$(JSON_GLIB_TOP)/lib \
 			-L$(PURPLE_TOP)
 
 ##
@@ -46,9 +48,11 @@ C_SRC =	\
 	account.c \
 	avatar.c \
 	buddylist.c \
-	confer.c \
+	chat.c \
 	deprecated.c \
+	edisc.c \
 	gg.c \
+	html.c \
 	image.c \
 	lib/common.c \
 	lib/dcc.c \
@@ -68,6 +72,7 @@ C_SRC =	\
 	lib/sha1.c \
 	libgadu-events.c \
 	libgaduw.c \
+	message-prpl.c \
 	multilogon.c \
 	oauth/oauth.c \
 	oauth/oauth-parameter.c \
@@ -78,6 +83,7 @@ C_SRC =	\
 	roster.c \
 	servconn.c \
 	status.c \
+	tcpsocket.c \
 	utils.c \
 	validator.c \
 	xml.c
@@ -89,8 +95,10 @@ OBJECTS = $(C_SRC:%.c=%.o)
 ##
 LIBS =	\
 			-lglib-2.0 \
+			-lgobject-2.0 \
 			-lgnutls \
 			-lintl \
+			-ljson-glib-1.0 \
 			-lpurple \
 			-lws2_32 \
 			-lz
diff --git a/libpurple/protocols/gg/avatar.c b/libpurple/protocols/gg/avatar.c
--- a/libpurple/protocols/gg/avatar.c
+++ b/libpurple/protocols/gg/avatar.c
@@ -151,10 +151,12 @@ void ggp_avatar_buddy_update(PurpleConne
 {
 	ggp_avatar_session_data *avdata = ggp_avatar_get_avdata(gc);
 	ggp_avatar_buddy_update_req *pending_update =
-		g_new(ggp_avatar_buddy_update_req, 1);
+		g_new(ggp_avatar_buddy_update_req, 1); //TODO: leak?
 
-	purple_debug_misc("gg", "ggp_avatar_buddy_update(%p, %u, %lu)\n", gc,
-		uin, timestamp);
+	if (purple_debug_is_verbose()) {
+		purple_debug_misc("gg", "ggp_avatar_buddy_update(%p, %u, %lu)\n", gc,
+			uin, timestamp);
+	}
 
 	pending_update->uin = uin;
 	pending_update->timestamp = timestamp;
@@ -165,7 +167,9 @@ void ggp_avatar_buddy_update(PurpleConne
 
 void ggp_avatar_buddy_remove(PurpleConnection *gc, uin_t uin)
 {
-	purple_debug_info("gg", "ggp_avatar_buddy_remove(%p, %u)\n", gc, uin);
+	if (purple_debug_is_verbose()) {
+		purple_debug_misc("gg", "ggp_avatar_buddy_remove(%p, %u)\n", gc, uin);
+	}
 
 	purple_buddy_icons_set_for_user(purple_connection_get_account(gc),
 		ggp_uin_to_str(uin), NULL, 0, NULL);
@@ -218,10 +222,12 @@ static gboolean ggp_avatar_buddy_update_
 		old_timestamp_str, NULL, 10) : 0;
 	if (old_timestamp == pending_update->timestamp)
 	{
-		purple_debug_misc("gg",
-			"ggp_avatar_buddy_update_next(%p): "
-			"%u have up to date avatar with ts=%lu\n", gc,
-			pending_update->uin, pending_update->timestamp);
+		if (purple_debug_is_verbose()) {
+			purple_debug_misc("gg",
+				"ggp_avatar_buddy_update_next(%p): "
+				"%u have up to date avatar with ts=%lu\n", gc,
+				pending_update->uin, pending_update->timestamp);



More information about the Commits mailing list