/pidgin/main: 8059ab4da709: Merge GSoC 2015 Facebook branch

Jorge Villase?or salinasv at pidgin.im
Sun Oct 18 14:30:34 EDT 2015


Changeset: 8059ab4da709d116ee4d96d91441b383729e69d0
Author:	 Jorge Villase?or <salinasv at pidgin.im>
Date:	 2015-10-18 11:28 -0700
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/8059ab4da709

Description:

Merge GSoC 2015 Facebook branch

This branch brings the new implementation of Facebook prpl to
our 3.0 release.

diffstat:

 .hgignore                                          |     1 +
 COPYRIGHT                                          |     1 +
 configure.ac                                       |    11 +-
 doc/reference/Makefile.am                          |     2 +-
 doc/reference/protocols/Makefile.am                |     2 +
 doc/reference/protocols/facebook/Makefile.am       |   126 +
 doc/reference/protocols/facebook/facebook-docs.xml |    32 +
 doc/reference/protocols/version.xml.in             |     1 +
 libpurple/glibcompat.h                             |    47 +
 libpurple/http.c                                   |     7 +
 libpurple/http.h                                   |    10 +
 libpurple/protocols/Makefile.am                    |     2 +-
 libpurple/protocols/Makefile.mingw                 |     2 +-
 libpurple/protocols/facebook/Makefile.am           |    66 +
 libpurple/protocols/facebook/Makefile.mingw        |   101 +
 libpurple/protocols/facebook/api.c                 |  3074 ++++++++++++++++++++
 libpurple/protocols/facebook/api.h                 |   849 +++++
 libpurple/protocols/facebook/data.c                |   588 +++
 libpurple/protocols/facebook/data.h                |   398 ++
 libpurple/protocols/facebook/facebook.c            |  1563 ++++++++++
 libpurple/protocols/facebook/facebook.h            |    83 +
 libpurple/protocols/facebook/http.c                |   360 ++
 libpurple/protocols/facebook/http.h                |   292 +
 libpurple/protocols/facebook/id.h                  |   131 +
 libpurple/protocols/facebook/json.c                |   660 ++++
 libpurple/protocols/facebook/json.h                |   517 +++
 libpurple/protocols/facebook/marshaller.list       |     6 +
 libpurple/protocols/facebook/mqtt.c                |  1013 ++++++
 libpurple/protocols/facebook/mqtt.h                |   626 ++++
 libpurple/protocols/facebook/thrift.c              |   706 ++++
 libpurple/protocols/facebook/thrift.h              |   600 +++
 libpurple/protocols/facebook/util.c                |   599 +++
 libpurple/protocols/facebook/util.h                |   344 ++
 libpurple/protocols/jabber/Makefile.am             |     4 -
 libpurple/protocols/jabber/Makefile.mingw          |     2 -
 libpurple/protocols/jabber/facebook.c              |   213 -
 libpurple/protocols/jabber/facebook.h              |    54 -
 libpurple/protocols/jabber/facebook_roster.c       |   135 -
 libpurple/protocols/jabber/facebook_roster.h       |    35 -
 libpurple/protocols/jabber/jabber.c                |    16 +-
 libpurple/protocols/jabber/jabber.h                |     5 -
 libpurple/protocols/jabber/roster.c                |     8 -
 pidgin/plugins/xmppconsole.c                       |     2 +-
 po/POTFILES.in                                     |     2 -
 po/af.po                                           |     3 -
 po/am.po                                           |     3 -
 po/ar.po                                           |     3 -
 po/as.po                                           |     3 -
 po/ast.po                                          |     3 -
 po/az.po                                           |     3 -
 po/be at latin.po                                     |     3 -
 po/bg.po                                           |     3 -
 po/bn.po                                           |     3 -
 po/bn_IN.po                                        |     3 -
 po/br.po                                           |     4 -
 po/brx.po                                          |     4 -
 po/bs.po                                           |     3 -
 po/ca.po                                           |     3 -
 po/ca at valencia.po                                  |     3 -
 po/cs.po                                           |     3 -
 po/da.po                                           |     3 -
 po/dz.po                                           |     3 -
 po/el.po                                           |     3 -
 po/en_AU.po                                        |     3 -
 po/en_CA.po                                        |     3 -
 po/en_GB.po                                        |     3 -
 po/eo.po                                           |     3 -
 po/es.po                                           |     9 -
 po/es_AR.po                                        |     4 -
 po/et.po                                           |     3 -
 po/eu.po                                           |     3 -
 po/fa.po                                           |     3 -
 po/fi.po                                           |     3 -
 po/fr.po                                           |     3 -
 po/ga.po                                           |     3 -
 po/gl.po                                           |     3 -
 po/gu.po                                           |     3 -
 po/he.po                                           |     3 -
 po/hi.po                                           |     3 -
 po/hr.po                                           |     3 -
 po/hu.po                                           |     3 -
 po/hy.po                                           |     4 -
 po/id.po                                           |     3 -
 po/it.po                                           |     3 -
 po/ja.po                                           |     3 -
 po/ka.po                                           |     3 -
 po/kk.po                                           |     3 -
 po/km.po                                           |     3 -
 po/kn.po                                           |     3 -
 po/ko.po                                           |     3 -
 po/ks.po                                           |     4 -
 po/ku.po                                           |     3 -
 po/ku_IQ.po                                        |     3 -
 po/lt.po                                           |     3 -
 po/lv.po                                           |     3 -
 po/mai.po                                          |     3 -
 po/mhr.po                                          |     3 -
 po/mk.po                                           |     3 -
 po/ml.po                                           |     3 -
 po/mn.po                                           |     3 -
 po/mr.po                                           |     3 -
 po/ms_MY.po                                        |     4 -
 po/my_MM.po                                        |     3 -
 po/nb.po                                           |     3 -
 po/ne.po                                           |     3 -
 po/nl.po                                           |     3 -
 po/nn.po                                           |     3 -
 po/oc.po                                           |     3 -
 po/or.po                                           |     3 -
 po/pa.po                                           |     3 -
 po/pl.po                                           |    12 -
 po/ps.po                                           |     3 -
 po/pt.po                                           |     3 -
 po/pt_BR.po                                        |     3 -
 po/ro.po                                           |     3 -
 po/ru.po                                           |     3 -
 po/sd.po                                           |     4 -
 po/si.po                                           |     3 -
 po/sk.po                                           |     3 -
 po/sl.po                                           |     3 -
 po/sq.po                                           |     3 -
 po/sr.po                                           |     3 -
 po/sr at latin.po                                     |     3 -
 po/sv.po                                           |     3 -
 po/sw.po                                           |     3 -
 po/ta.po                                           |     3 -
 po/te.po                                           |     3 -
 po/th.po                                           |     3 -
 po/tr.po                                           |     3 -
 po/tt.po                                           |     3 -
 po/uk.po                                           |     3 -
 po/ur.po                                           |     3 -
 po/uz.po                                           |     4 -
 po/vi.po                                           |     3 -
 po/xh.po                                           |     3 -
 po/zh_CN.po                                        |     3 -
 po/zh_HK.po                                        |     3 -
 po/zh_TW.po                                        |     3 -
 138 files changed, 12818 insertions(+), 783 deletions(-)

diffs (truncated from 15073 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -83,6 +83,7 @@ libpurple/plugins/perl/common/Makefile.o
 libpurple/plugins/perl/common/const-c.inc
 libpurple/plugins/perl/common/const-xs.inc
 libpurple/plugins/perl/common/lib
+libpurple/protocols/facebook/marshal.[ch]
 libpurple/purple-client-bindings.[ch]
 libpurple/purple-client-example
 libpurple/purple.h$
diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -201,6 +201,7 @@ François Gagné
 Andrew Gaul
 Evgueni V. Gavrilov
 Ignacy Gawedzki
+James Geboski
 Georgi Georgiev
 Brian Geppert
 Emanuele Giaquinta
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1414,7 +1414,7 @@ if test "x$STATIC_PRPLS" != "x" -a "x$DY
 fi
 
 if test "x$STATIC_PRPLS" = "xall" ; then
-	STATIC_PRPLS="bonjour gg irc jabber msn mxit novell oscar sametime silc simple yahoo zephyr"
+	STATIC_PRPLS="bonjour facebook gg irc jabber msn mxit novell oscar sametime silc simple yahoo zephyr"
 fi
 if test "x$have_meanwhile" != "xyes" ; then
 	STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/sametime//'`
@@ -1448,6 +1448,7 @@ for i in $STATIC_PRPLS ; do
 
 	case $i in
 		bonjour)	static_bonjour=yes ;;
+		facebook)	static_facebook=yes ;;
 		gg)			static_gg=yes ;;
 		irc)		static_irc=yes ;;
 		jabber)		static_jabber=yes ;;
@@ -1466,6 +1467,7 @@ for i in $STATIC_PRPLS ; do
 	esac
 done
 AM_CONDITIONAL(STATIC_BONJOUR, test "x$static_bonjour" = "xyes")
+AM_CONDITIONAL(STATIC_FACEBOOK, test "x$static_facebook" = "xyes")
 AM_CONDITIONAL(STATIC_GG, test "x$static_gg" = "xyes")
 AM_CONDITIONAL(STATIC_IRC, test "x$static_irc" = "xyes")
 AM_CONDITIONAL(STATIC_JABBER, test "x$static_jabber" = "xyes")
@@ -1486,7 +1488,7 @@ AC_DEFINE_UNQUOTED(STATIC_PROTO_UNLOAD, 
 
 AC_ARG_WITH(dynamic_prpls, [AS_HELP_STRING([--with-dynamic-prpls], [specify which protocols to build dynamically])], [DYNAMIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`])
 if test "x$DYNAMIC_PRPLS" = "xall" ; then
-	DYNAMIC_PRPLS="bonjour gg irc jabber msn mxit novell oscar sametime silc simple yahoo zephyr"
+	DYNAMIC_PRPLS="bonjour facebook gg irc jabber msn mxit novell oscar sametime silc simple yahoo zephyr"
 fi
 if test "x$have_meanwhile" != "xyes"; then
 	DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/sametime//'`
@@ -1504,6 +1506,7 @@ AC_SUBST(DYNAMIC_PRPLS)
 for i in $DYNAMIC_PRPLS ; do
 	case $i in
 		bonjour)	dynamic_bonjour=yes ;;
+		facebook)	dynamic_facebook=yes ;;
 		gg)			dynamic_gg=yes ;;
 		irc)		dynamic_irc=yes ;;
 		jabber)		dynamic_jabber=yes ;;
@@ -2393,6 +2396,9 @@ AC_CONFIG_FILES([Makefile
 		   doc/reference/finch/version.xml
 		   doc/reference/libpurple/Makefile
 		   doc/reference/libpurple/version.xml
+		   doc/reference/protocols/Makefile
+		   doc/reference/protocols/facebook/Makefile
+		   doc/reference/protocols/version.xml
 		   doc/reference/pidgin/Makefile
 		   doc/reference/pidgin/version.xml
 		   m4macros/Makefile
@@ -2426,6 +2432,7 @@ AC_CONFIG_FILES([Makefile
 		   libpurple/Makefile
 		   libpurple/protocols/Makefile
 		   libpurple/protocols/bonjour/Makefile
+		   libpurple/protocols/facebook/Makefile
 		   libpurple/protocols/gg/Makefile
 		   libpurple/protocols/irc/Makefile
 		   libpurple/protocols/jabber/Makefile
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -6,4 +6,4 @@ if ENABLE_GNT
 GNT_DIR=finch
 endif
 
-SUBDIRS = libpurple $(GNT_DIR) $(GTK_DIR)
+SUBDIRS = libpurple protocols $(GNT_DIR) $(GTK_DIR)
diff --git a/doc/reference/protocols/Makefile.am b/doc/reference/protocols/Makefile.am
new file mode 100644
--- /dev/null
+++ b/doc/reference/protocols/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST = version.xml.in
+SUBDIRS = facebook
diff --git a/doc/reference/protocols/facebook/Makefile.am b/doc/reference/protocols/facebook/Makefile.am
new file mode 100644
--- /dev/null
+++ b/doc/reference/protocols/facebook/Makefile.am
@@ -0,0 +1,126 @@
+## Process this file with automake to produce Makefile.in
+
+# We require automake 1.6 at least.
+AUTOMAKE_OPTIONS = 1.6
+
+# This is a blank Makefile.am for using gtk-doc.
+# Copy this to your project's API docs directory and modify the variables to
+# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
+# of using the various options.
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=facebook
+
+# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
+#DOC_MODULE_VERSION=2
+
+# The top-level XML file (SGML in the past). You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR=$(top_srcdir)/libpurple/protocols/$(DOC_MODULE)
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
+SCAN_OPTIONS=\
+	--deprecated-guards="PURPLE_DISABLE_DEPRECATED" \
+	--rebuild-types \
+	--rebuild-sections
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
+MKDB_OPTIONS=--xml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-mktmpl
+# e.g. MKTMPL_OPTIONS=--only-section-tmpl
+MKTMPL_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkhtml
+MKHTML_OPTIONS=
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB=$(top_srcdir)/libpurple/protocols/$(DOC_MODULE)/*.h
+CFILE_GLOB=$(top_srcdir)/libpurple/protocols/$(DOC_MODULE)/*.c
+
+# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
+# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
+# TODO: those files are not properly scanned when building out-of-tree
+EXTRA_HFILES =
+
+# Header files or dirs to ignore when scanning. Use base file/dir names
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
+IGNORE_HFILES=marshal.h
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files = ../version.xml
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+# e.g. expand_content_files=running.sgml
+expand_content_files=
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+GTKDOC_CFLAGS = \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/libpurple/protocols/$(DOC_MODULE) \
+	$(GLIB_CFLAGS) \
+	$(GPLUGIN_CFLAGS) \
+	$(DEBUG_CFLAGS) \
+	$(JSON_CFLAGS) \
+	$(ZLIB_CFLAGS) \
+	$(INTROSPECTION_CFLAGS)
+
+GTKDOC_LIBS = \
+	$(top_builddir)/libpurple/protocols/$(DOC_MODULE)/lib$(DOC_MODULE).la \
+	$(STATIC_LINK_LIBS) \
+	$(GLIB_LIBS) \
+	$(GPLUGIN_LIBS) \
+	$(INTLLIBS) \
+	$(JSON_LIBS) \
+	$(ZLIB_LIBS) \
+	$(INTROSPECTION_LIBS)
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST += version.xml.in
+
+# Files not to distribute
+# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
+# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
+DISTCLEANFILES = $(DOC_MODULE).types $(DOC_MODULE)-sections.txt
+
+dist-hook: html-build.stamp
+
+# Comment this out if you want 'make check' to test you doc status
+# and run some sanity checks
+if ENABLE_GTK_DOC
+TESTS_ENVIRONMENT = \
+  DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
+  SRCDIR=$(abs_srcdir)
+#TODO: fix and enable
+#TESTS = $(GTKDOC_CHECK)
+endif
diff --git a/doc/reference/protocols/facebook/facebook-docs.xml b/doc/reference/protocols/facebook/facebook-docs.xml
new file mode 100644
--- /dev/null
+++ b/doc/reference/protocols/facebook/facebook-docs.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+
+<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
+<!ENTITY version SYSTEM "../version.xml">
+]>
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+  <bookinfo>
+    <title>Facebook Protocol Reference Manual</title>
+    <abstract>
+      <title>Facebook Plugin &version;</title>
+      <para>
+        The Facebook Messenger protocol plugin for libpurple.
+      </para>
+    </abstract>
+  </bookinfo>
+
+  <reference label="II">
+    <title>API Reference</title>
+
+    <xi:include href="xml/api.xml" />
+    <xi:include href="xml/data.xml" />
+    <xi:include href="xml/facebook.xml" />
+    <xi:include href="xml/http.xml" />
+    <xi:include href="xml/id.xml" />
+    <xi:include href="xml/json.xml" />
+    <xi:include href="xml/mqtt.xml" />
+    <xi:include href="xml/thrift.xml" />
+    <xi:include href="xml/util.xml" />
+  </reference>
+</book>
diff --git a/doc/reference/protocols/version.xml.in b/doc/reference/protocols/version.xml.in
new file mode 100644
--- /dev/null
+++ b/doc/reference/protocols/version.xml.in
@@ -0,0 +1,1 @@
+ at PURPLE_VERSION@
diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
--- a/libpurple/glibcompat.h
+++ b/libpurple/glibcompat.h
@@ -76,6 +76,23 @@ static inline gboolean g_close(gint fd, 
 	g_signal_handlers_disconnect_matched((instance), G_SIGNAL_MATCH_DATA, \
 			0, 0, NULL, NULL, (data))
 
+static inline GByteArray * g_byte_array_new_take(guint8 *data, gsize len)
+{
+	GByteArray *array;
+
+	array = g_byte_array_new();
+	g_byte_array_append(array, data, len);
+	g_free(data);
+
+	return array;
+}
+
+static inline void g_queue_free_full(GQueue *queue, GDestroyNotify free_func)
+{
+	g_queue_foreach(queue, (GFunc)free_func, NULL);
+	g_queue_free(queue);
+}
+
 static inline GThread * g_thread_try_new(const gchar *name, GThreadFunc func,



More information about the Commits mailing list