/soc/2015/nakulgulati/main: 5209370e0990: Initial hangouts proto...

Nakul Gulati nakgulati at gmail.com
Tue Jun 23 02:53:40 EDT 2015


Changeset: 5209370e09904efb7ae65bea5d1f438207f0a96b
Author:	 Nakul Gulati <nakgulati at gmail.com>
Date:	 2015-06-14 03:30 +0800
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/soc/2015/nakulgulati/main/rev/5209370e0990

Description:

Initial hangouts protocol.

diffstat:

 configure.ac                                |    8 +-
 libpurple/protocols/Makefile.am             |    2 +-
 libpurple/protocols/Makefile.mingw          |    2 +-
 libpurple/protocols/hangouts/Makefile.am    |   35 ++++++
 libpurple/protocols/hangouts/Makefile.mingw |   79 +++++++++++++
 libpurple/protocols/hangouts/hangouts.c     |  161 ++++++++++++++++++++++++++++
 libpurple/protocols/hangouts/hangouts.h     |   52 +++++++++
 7 files changed, 335 insertions(+), 4 deletions(-)

diffs (truncated from 422 to 300 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1189,7 +1189,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 myspace mxit novell oscar sametime silc simple yahoo zephyr"
+	STATIC_PRPLS="bonjour gg hangouts irc jabber msn myspace mxit novell oscar sametime silc simple yahoo zephyr"
 fi
 if test "x$have_meanwhile" != "xyes" ; then
 	STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/sametime//'`
@@ -1235,6 +1235,7 @@ for i in $STATIC_PRPLS ; do
 	fi
 	case $i in
 		bonjour)	static_bonjour=yes ;;
+		hangouts)	static_hangouts=yes ;;
 		gg)			static_gg=yes ;;
 		irc)		static_irc=yes ;;
 		jabber)		static_jabber=yes ;;
@@ -1255,6 +1256,7 @@ for i in $STATIC_PRPLS ; do
 	esac
 done
 AM_CONDITIONAL(STATIC_BONJOUR, test "x$static_bonjour" = "xyes")
+AM_CONDITIONAL(STATIC_HANGOUTS, test "x$static_hangouts" = "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")
@@ -1274,7 +1276,7 @@ AC_DEFINE_UNQUOTED(STATIC_PROTO_INIT, $e
 
 AC_ARG_WITH(dynamic_prpls, [AC_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 myspace mxit novell oscar sametime silc simple yahoo zephyr"
+	DYNAMIC_PRPLS="bonjour gg hangouts irc jabber msn myspace mxit novell oscar sametime silc simple yahoo zephyr"
 fi
 if test "x$have_meanwhile" != "xyes"; then
 	DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/sametime//'`
@@ -1293,6 +1295,7 @@ for i in $DYNAMIC_PRPLS ; do
 	case $i in
 		bonjour)	dynamic_bonjour=yes ;;
 		gg)			dynamic_gg=yes ;;
+		hangouts)	dynamic_hangouts=yes ;;
 		irc)		dynamic_irc=yes ;;
 		jabber)		dynamic_jabber=yes ;;
 		msn)		dynamic_msn=yes ;;
@@ -2660,6 +2663,7 @@ AC_CONFIG_FILES([Makefile
 		   libpurple/protocols/Makefile
 		   libpurple/protocols/bonjour/Makefile
 		   libpurple/protocols/gg/Makefile
+		   libpurple/protocols/hangouts/Makefile
 		   libpurple/protocols/irc/Makefile
 		   libpurple/protocols/jabber/Makefile
 		   libpurple/protocols/msn/Makefile
diff --git a/libpurple/protocols/Makefile.am b/libpurple/protocols/Makefile.am
--- a/libpurple/protocols/Makefile.am
+++ b/libpurple/protocols/Makefile.am
@@ -1,5 +1,5 @@
 EXTRA_DIST = Makefile.mingw
 
-DIST_SUBDIRS = bonjour gg irc jabber msn myspace mxit novell null oscar sametime silc silc10 simple yahoo zephyr
+DIST_SUBDIRS = bonjour gg hangouts irc jabber msn myspace mxit novell null oscar sametime silc silc10 simple yahoo zephyr
 
 SUBDIRS = $(DYNAMIC_PRPLS) $(STATIC_PRPLS)
diff --git a/libpurple/protocols/Makefile.mingw b/libpurple/protocols/Makefile.mingw
--- a/libpurple/protocols/Makefile.mingw
+++ b/libpurple/protocols/Makefile.mingw
@@ -8,7 +8,7 @@
 PIDGIN_TREE_TOP := ../..
 include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
 
-SUBDIRS = gg irc jabber msn mxit novell null oscar sametime silc simple yahoo bonjour myspace
+SUBDIRS = gg hangouts irc jabber msn mxit novell null oscar sametime silc simple yahoo bonjour myspace
 
 .PHONY: all install clean
 
diff --git a/libpurple/protocols/hangouts/Makefile.am b/libpurple/protocols/hangouts/Makefile.am
new file mode 100644
--- /dev/null
+++ b/libpurple/protocols/hangouts/Makefile.am
@@ -0,0 +1,35 @@
+#EXTRA_DIST = \
+#	Makefile.mingw
+
+pkgdir = @PURPLE_PLUGINDIR@
+
+HANGOUTSSOURCES = \
+	hangouts.h \
+	hangouts.c
+
+AM_CFLAGS = $(st)
+
+libhangouts_la_LDFLAGS = -module @PLUGIN_LDFLAGS@
+
+if STATIC_HANGOUTS
+
+st = -DPURPLE_STATIC_PRPL
+noinst_LTLIBRARIES     = libhangouts.la
+libhangouts_la_SOURCES = $(HANGOUTSSOURCES)
+libhangouts_la_CFLAGS  = $(AM_CFLAGS)
+
+else
+
+st =
+pkg_LTLIBRARIES        = libhangouts.la
+libhangouts_la_SOURCES = $(HANGOUTSSOURCES)
+libhangouts_la_LIBADD  = @PURPLE_LIBS@
+
+endif
+
+AM_CPPFLAGS = \
+	-I$(top_srcdir)/libpurple \
+	-I$(top_builddir)/libpurple \
+	$(GLIB_CFLAGS) \
+	$(GPLUGIN_CFLAGS) \
+	$(DEBUG_CFLAGS)
diff --git a/libpurple/protocols/hangouts/Makefile.mingw b/libpurple/protocols/hangouts/Makefile.mingw
new file mode 100644
--- /dev/null
+++ b/libpurple/protocols/hangouts/Makefile.mingw
@@ -0,0 +1,79 @@
+#
+# Makefile.mingw
+#
+# Description: Makefile for win32 (mingw) version of libhangouts
+#
+
+PIDGIN_TREE_TOP := ../../..
+include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
+
+TARGET = libnovell
+TYPE = PLUGIN
+
+# Static or Plugin...
+ifeq ($(TYPE),STATIC)
+  DEFINES += -DSTATIC
+  DLL_INSTALL_DIR =	$(PURPLE_INSTALL_DIR)
+else
+ifeq ($(TYPE),PLUGIN)
+  DLL_INSTALL_DIR =	$(PURPLE_INSTALL_PLUGINS_DIR)
+endif
+endif
+
+##
+## INCLUDE PATHS
+##
+INCLUDE_PATHS +=	-I. \
+			-I$(GTK_TOP)/include \
+			-I$(GTK_TOP)/include/glib-2.0 \
+			-I$(GTK_TOP)/lib/glib-2.0/include \
+			-I$(PURPLE_TOP) \
+			-I$(PURPLE_TOP)/win32 \
+			-I$(PIDGIN_TREE_TOP)
+
+LIB_PATHS +=		-L$(GTK_TOP)/lib \
+			-L$(PURPLE_TOP)
+
+##
+##  SOURCES, OBJECTS
+##
+C_SRC =	\
+			hangouts.c
+
+OBJECTS = $(C_SRC:%.c=%.o)
+
+##
+## LIBRARIES
+##
+LIBS =	\
+			-lglib-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lpurple
+
+include $(PIDGIN_COMMON_RULES)
+
+##
+## TARGET DEFINITIONS
+##
+.PHONY: all install clean
+
+all: $(TARGET).dll
+
+install: all $(DLL_INSTALL_DIR)
+	cp $(TARGET).dll $(DLL_INSTALL_DIR)
+
+$(OBJECTS): $(PURPLE_CONFIG_H)
+
+$(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
+
+##
+## CLEAN RULES
+##
+clean:
+	rm -f $(OBJECTS)
+	rm -f $(TARGET).dll
+
+include $(PIDGIN_COMMON_TARGETS)
diff --git a/libpurple/protocols/hangouts/hangouts.c b/libpurple/protocols/hangouts/hangouts.c
new file mode 100644
--- /dev/null
+++ b/libpurple/protocols/hangouts/hangouts.c
@@ -0,0 +1,161 @@
+/* purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+#include "internal.h"
+
+#include "account.h"
+#include "connection.h"
+#include "plugins.h"
+#include "protocol.h"
+#include "protocols.h"
+#include "roomlist.h"
+#include "version.h"
+
+#include "hangouts.h"
+
+static PurpleProtocol *my_protocol = NULL;
+
+static void
+hangouts_login(PurpleAccount *acct)
+{
+
+}
+
+static void
+hangouts_close(PurpleConnection *gc)
+{
+
+}
+
+static GList *
+hangouts_status_types(PurpleAccount *acct)
+{
+ return NULL;
+}
+
+static const char *
+hangouts_list_icon(PurpleAccount *account, PurpleBuddy *buddy)
+{
+ return "hangouts";
+}
+
+static void
+hangouts_protocol_init(PurpleProtocol *protocol)
+{
+ protocol->id   = "prpl-hangouts";
+ protocol->name = "Hangouts";
+}
+
+static void
+hangouts_protocol_class_init(PurpleProtocolClass *klass)
+{
+ klass->login        = hangouts_login;
+ klass->close        = hangouts_close;
+ klass->status_types = hangouts_status_types;
+ klass->list_icon    = hangouts_list_icon;
+}
+
+static void
+hangouts_protocol_client_iface_init(PurpleProtocolClientIface *client_iface)
+{
+
+}
+
+static void
+hangouts_protocol_server_iface_init(PurpleProtocolServerIface *server_iface)
+{
+
+}
+
+static void
+hangouts_protocol_im_iface_init(PurpleProtocolIMIface *im_iface)
+{
+
+}
+
+static void
+hangouts_protocol_chat_iface_init(PurpleProtocolChatIface *chat_iface)
+{



More information about the Commits mailing list