soc.2009.telepathy: 9f2df692: Initial commit. Added telepathy.c skelet...

sttwister at soc.pidgin.im sttwister at soc.pidgin.im
Wed Apr 22 07:56:20 EDT 2009


-----------------------------------------------------------------
Revision: 9f2df692f65cef28256c0dd673877a6509ed5704
Ancestor: aa4b8ad0fd74e3f29df8b583c30594e034d55cb3
Author: sttwister at soc.pidgin.im
Date: 2009-04-22T11:50:56
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/9f2df692f65cef28256c0dd673877a6509ed5704

Added files:
        libpurple/protocols/telepathy/Makefile.am
        libpurple/protocols/telepathy/Makefile.mingw
        libpurple/protocols/telepathy/telepathy.c
Added directories:
        libpurple/protocols/telepathy
Modified files:
        configure.ac libpurple/protocols/Makefile.am

ChangeLog: 

Initial commit. Added telepathy.c skeleton. Modified build system files to include the telepathy prpl

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/Makefile.am	c597e4f864d5141932dad3dcf1121411df668c83
+++ libpurple/protocols/telepathy/Makefile.am	c597e4f864d5141932dad3dcf1121411df668c83
@@ -0,0 +1,21 @@
+EXTRA_DIST = \
+	Makefile.mingw
+
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
+
+TELEPATHYSOURCES = telepathy.c
+
+AM_CFLAGS = $(st)
+
+libtelepathy_la_LDFLAGS = -module -avoid-version
+
+st =
+pkg_LTLIBRARIES    = libtelepathy.la
+libtelepathy_la_SOURCES = $(TELEPATHYSOURCES)
+libtelepathy_la_LIBADD  = $(GLIB_LIBS)
+
+AM_CPPFLAGS = \
+	-I$(top_srcdir)/libpurple \
+	-I$(top_builddir)/libpurple \
+	$(GLIB_CFLAGS) \
+	$(DEBUG_CFLAGS)
============================================================
--- libpurple/protocols/telepathy/Makefile.mingw	b110ba9c3c0d85bf0d12445f5dc0606926905b5b
+++ libpurple/protocols/telepathy/Makefile.mingw	b110ba9c3c0d85bf0d12445f5dc0606926905b5b
@@ -0,0 +1,78 @@
+#
+# Makefile.mingw
+#
+# Description: Makefile for win32 (mingw) version of libtelapthy
+#
+
+PIDGIN_TREE_TOP := ../../..
+include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
+
+TARGET = libtelepathy
+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 =			telepathy.c
+
+OBJECTS = $(C_SRC:%.c=%.o)
+
+##
+## LIBRARIES
+##
+LIBS =			\
+			-lglib-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)
============================================================
--- libpurple/protocols/telepathy/telepathy.c	d56cd589eee2f61f17a5b22834855ab4a104448b
+++ libpurple/protocols/telepathy/telepathy.c	d56cd589eee2f61f17a5b22834855ab4a104448b
@@ -0,0 +1,261 @@
+/**
+ * purple - Telepathy Protocol Plugin
+ *
+ * Copyright (C) 2009, Felix Kerekes <sttwister at soc.pidgin.im>
+ *
+ * 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 <glib.h>
+
+#include "internal.h"
+
+#include "accountopt.h"
+#include "debug.h"
+#include "notify.h"
+#include "plugin.h"
+#include "version.h"
+
+#define TELEPATHY_ID "prpl-sttwister-telepathy"
+#define TELEPATHY_DISPLAY_VERSION "1.0"
+
+#define TELEPATHY_STATUS_ONLINE   "online"
+#define TELEPATHY_STATUS_AWAY     "away"
+#define TELEPATHY_STATUS_OFFLINE  "offline"
+
+static void
+telepathy_input_user_info(PurplePluginAction *action)
+{
+    	PurpleConnection *gc = (PurpleConnection *)action->context;
+	PurpleAccount *acct = purple_connection_get_account(gc);
+	purple_debug_info("telepathy", "showing 'Set User Info' dialog for %s\n",
+		acct->username);
+
+	purple_account_request_change_user_info(acct);
+}
+
+static GList *
+telepathy_actions(PurplePlugin *plugin, gpointer context)
+{
+	PurplePluginAction *action;
+    	purple_debug_info("telepathy", "Setting actions...\n");
+	action = purple_plugin_action_new(
+		_("Set User Info..."), telepathy_input_user_info);
+	return g_list_append(NULL, action);
+}
+
+
+static gboolean
+telepathy_plugin_load(PurplePlugin *plugin)
+{
+	purple_debug_info("telepathy", "Loading prpl...\n");
+
+	return TRUE;
+}
+
+static const char *
+telepathy_list_icon(PurpleAccount *acct, PurpleBuddy *buddy)
+{
+	return "null";
+}
+
+static GList *
+telepathy_status_types(PurpleAccount *acct)
+{
+	GList *types = NULL;
+	PurpleStatusType *type;
+
+	purple_debug_info("telepathy", "Returning status types for %s: %s, %s, %s\n",
+		acct->username,
+		TELEPATHY_STATUS_ONLINE, TELEPATHY_STATUS_AWAY, TELEPATHY_STATUS_OFFLINE);
+
+	type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE,
+		TELEPATHY_STATUS_ONLINE, NULL, TRUE, TRUE, FALSE,
+		"message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
+		NULL);
+	types = g_list_prepend(types, type);
+
+	type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY,
+		TELEPATHY_STATUS_AWAY, NULL, TRUE, TRUE, FALSE,
+		"message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
+		NULL);
+	types = g_list_prepend(types, type);
+
+	type = purple_status_type_new_with_attrs(PURPLE_STATUS_OFFLINE,
+		NULL, NULL, TRUE, TRUE, FALSE,
+		"message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
+		NULL);
+	types = g_list_prepend(types, type);
+
+	return g_list_reverse(types);
+}
+
+static void
+telepathy_login(PurpleAccount *acct)
+{
+	PurpleConnection *gc = purple_account_get_connection(acct);
+
+	purple_debug_info("telepathy", "Logging in as %s\n", acct->username);
+
+	purple_connection_update_progress(gc, _("Connecting"),
+		0,   /* which connection step this is */
+		2);  /* total number of steps */
+
+	purple_connection_update_progress(gc, _("Connected"),
+		1,   /* which connection step this is */
+		2);  /* total number of steps */
+	purple_connection_set_state(gc, PURPLE_CONNECTED);
+}
+
+static void
+telepathy_close(PurpleConnection *gc)
+{
+	purple_debug_info("telepathy", "We're closing, sorry :(\n");
+}
+
+static void
+telepathy_destroy(PurplePlugin *plugin) {
+	purple_debug_info("telepathy", "Shutting down\n");
+}
+
+static PurplePluginProtocolInfo telepathy_prpl_info =
+{
+	OPT_PROTO_CHAT_TOPIC,  /* options */
+	NULL,               /* user_splits, initialized in nullprpl_init() */
+	NULL,               /* protocol_options, initialized in nullprpl_init() */
+	{   /* icon_spec, a PurpleBuddyIconSpec */
+	    	"png,jpg,gif",                   /* format */
+		0,                               /* min_width */
+		0,                               /* min_height */
+		128,                             /* max_width */
+		128,                             /* max_height */
+		10000,                           /* max_filesize */
+		PURPLE_ICON_SCALE_DISPLAY,       /* scale_rules */
+	},
+	telepathy_list_icon,                  /* list_icon */
+	NULL,                                /* list_emblem */
+	NULL,                /* status_text */
+	NULL,               /* tooltip_text */
+	telepathy_status_types,               /* status_types */
+	NULL,            /* blist_node_menu */
+	NULL,                  /* chat_info */
+	NULL,         /* chat_info_defaults */
+	telepathy_login,                      /* login */
+	telepathy_close,                      /* close */
+	NULL,                    /* send_im */
+	NULL,                   /* set_info */
+	NULL,                /* send_typing */
+	NULL,                   /* get_info */
+	NULL,                 /* set_status */
+	NULL,                   /* set_idle */
+	NULL,              /* change_passwd */
+	NULL,                  /* add_buddy */
+	NULL,                /* add_buddies */
+	NULL,               /* remove_buddy */
+	NULL,             /* remove_buddies */
+	NULL,                 /* add_permit */
+	NULL,                   /* add_deny */
+	NULL,                 /* rem_permit */
+	NULL,                   /* rem_deny */
+	NULL,            /* set_permit_deny */
+	NULL,                  /* join_chat */
+	NULL,                /* reject_chat */
+	NULL,              /* get_chat_name */
+	NULL,                /* chat_invite */
+	NULL,                 /* chat_leave */
+	NULL,               /* chat_whisper */
+	NULL,                  /* chat_send */
+	NULL,                                /* keepalive */
+	NULL,              /* register_user */
+	NULL,                /* get_cb_info */
+	NULL,                                /* get_cb_away */
+	NULL,                /* alias_buddy */
+	NULL,                /* group_buddy */
+	NULL,               /* rename_group */
+	NULL,                                /* buddy_free */
+	NULL,               /* convo_closed */
+	NULL,                  /* normalize */
+	NULL,             /* set_buddy_icon */
+	NULL,               /* remove_group */
+	NULL,                                /* get_cb_real_name */
+	NULL,             /* set_chat_topic */
+	NULL,                                /* find_blist_chat */
+	NULL,          /* roomlist_get_list */
+	NULL,            /* roomlist_cancel */
+	NULL,   /* roomlist_expand_category */
+	NULL,           /* can_receive_file */
+	NULL,                                /* send_file */
+	NULL,                                /* new_xfer */
+	NULL,            /* offline_message */
+	NULL,                                /* whiteboard_prpl_ops */
+	NULL,                                /* send_raw */
+	NULL,                                /* roomlist_room_serialize */
+	NULL,	                               /* unregister_user */
+	NULL,                                /* send_attention */
+	NULL,                                /* attention_types */
+	sizeof(PurplePluginProtocolInfo),    /* struct_size */
+	NULL,                                /* get_account_text_table */
+	NULL,                                /* initiate_media */
+	NULL,                                /* get_media_caps */
+};
+
+static PurplePluginInfo telepathy_info =
+{
+	PURPLE_PLUGIN_MAGIC,
+	PURPLE_MAJOR_VERSION,
+	PURPLE_MINOR_VERSION,
+	PURPLE_PLUGIN_PROTOCOL,
+	NULL,
+	0,
+	NULL,
+	PURPLE_PRIORITY_DEFAULT,
+
+	TELEPATHY_ID,
+	"Telepathy",
+	TELEPATHY_DISPLAY_VERSION,
+
+	N_("Telepathy Protocol Plugin"),
+	N_("Telepathy Protocol Plugin"),
+	"Felix Kerekes <sttwister [at] yahoo [dot] com>",                          
+	"http://google.com",     
+
+	telepathy_plugin_load,                   
+	NULL,                          
+	telepathy_destroy,                          
+
+	NULL,                          
+	&telepathy_prpl_info,                          
+	NULL,                        
+
+	telepathy_actions,                   
+
+	NULL,                          
+	NULL,                          
+	NULL,                          
+	NULL                           
+};                               
+
+static void                        
+telepathy_init(PurplePlugin *plugin)
+{                                  
+	PurpleAccountOption *option;
+
+	purple_debug_info("telepathy", "Initing plugin...\n");
+
+	option = purple_account_option_string_new(_("Test option"), "test", "this is default");
+	telepathy_prpl_info.protocol_options = g_list_append(telepathy_prpl_info.protocol_options, option);
+}
+
+PURPLE_INIT_PLUGIN(telepathy, telepathy_init, telepathy_info)
============================================================
--- configure.ac	606db4e035429fd867582ad952d32fa3ea2ec9e1
+++ configure.ac	0f86af02293563357b67705eb6f3585417b263f9
@@ -1052,7 +1052,7 @@ if test "x$STATIC_PRPLS" = "xall" ; then
 fi
 
 if test "x$STATIC_PRPLS" = "xall" ; then
-	STATIC_PRPLS="bonjour gg irc jabber msn myspace novell oscar qq sametime silc simple yahoo zephyr"
+	STATIC_PRPLS="bonjour gg irc jabber msn myspace novell oscar qq sametime silc simple telepathy yahoo zephyr"
 fi
 if test "x$have_meanwhile" != "xyes" ; then
 	STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/sametime//'`
@@ -1112,6 +1112,7 @@ for i in $STATIC_PRPLS ; do
 		silc)		static_silc=yes ;;
 		silc10)		static_silc=yes ;;
 		simple)		static_simple=yes ;;
+		telepathy)		static_telepathy=yes ;;
 		yahoo)		static_yahoo=yes ;;
 		zephyr)		static_zephyr=yes ;;
 		*)			echo "Invalid static protocol $i!!" ; exit ;;
@@ -1129,6 +1130,7 @@ AM_CONDITIONAL(STATIC_SIMPLE, test "x$st
 AM_CONDITIONAL(STATIC_SAMETIME, test "x$static_sametime" = "xyes" -a "x$have_meanwhile" = "xyes")
 AM_CONDITIONAL(STATIC_SILC, test "x$static_silc" = "xyes" -a "x$have_silc" = "xyes")
 AM_CONDITIONAL(STATIC_SIMPLE, test "x$static_simple" = "xyes")
+AM_CONDITIONAL(STATIC_TELEPATHY, test "x$static_telepathy" = "xyes")
 AM_CONDITIONAL(STATIC_YAHOO, test "x$static_yahoo" = "xyes")
 AM_CONDITIONAL(STATIC_ZEPHYR, test "x$static_zephyr" = "xyes")
 AC_SUBST(STATIC_LINK_LIBS)
@@ -1137,7 +1139,7 @@ if test "x$DYNAMIC_PRPLS" = "xall" ; the
 
 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 novell oscar qq sametime silc simple yahoo zephyr"
+	DYNAMIC_PRPLS="bonjour gg irc jabber msn myspace novell oscar qq sametime silc simple telepathy yahoo zephyr"
 fi
 if test "x$have_meanwhile" != "xyes"; then
 	DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/sametime//'`
@@ -1174,6 +1176,7 @@ for i in $DYNAMIC_PRPLS ; do
 		silc)		dynamic_silc=yes ;;
 		silc10)		dynamic_silc=yes ;;
 		simple)		dynamic_simple=yes ;;
+		telepathy)		dynamic_telepathy=yes ;;
 		yahoo)		dynamic_yahoo=yes ;;
 		zephyr)		dynamic_zephyr=yes ;;
 		*)			echo "Invalid dynamic protocol $i!!" ; exit ;;
@@ -2511,6 +2514,7 @@ AC_OUTPUT([Makefile
 		   libpurple/protocols/silc/Makefile
 		   libpurple/protocols/silc10/Makefile
 		   libpurple/protocols/simple/Makefile
+		   libpurple/protocols/telepathy/Makefile
 		   libpurple/protocols/yahoo/Makefile
 		   libpurple/protocols/zephyr/Makefile
 		   libpurple/tests/Makefile
============================================================
--- libpurple/protocols/Makefile.am	02ee6ae176579285e0489736da976433ff5b7129
+++ libpurple/protocols/Makefile.am	d8ab6b5b68870b7ec32bfd0d27e013550779edcc
@@ -1,5 +1,5 @@ EXTRA_DIST = Makefile.mingw
 EXTRA_DIST = Makefile.mingw
 
-DIST_SUBDIRS = bonjour gg irc jabber msn msnp9 myspace novell null oscar qq sametime silc silc10 simple yahoo zephyr
+DIST_SUBDIRS = bonjour gg irc jabber msn msnp9 myspace novell null oscar qq sametime silc silc10 simple telepathy yahoo zephyr
 
 SUBDIRS = $(DYNAMIC_PRPLS) $(STATIC_PRPLS)


More information about the Commits mailing list