pidgin/purple-plugin-pack
propagate from branch 'org.guifications.plugins' (head f7feec3a47e878a362c15119cc79c4595747076b)
to branch 'org.guifications.plugins.smartear' (head e6bb8a70d56c097bc6c4320d195ff37d45d35639)
--- a/ChangeLog Wed Jul 11 03:30:51 2007 -0400
+++ b/ChangeLog Sun Jul 22 05:26:37 2007 -0400
@@ -1,4 +1,7 @@
+ * Added the Pidgin-SNPP protocol plugin as snpp * Blistops now offers the ability to stretch the display of screen names
or aliases into the buddy icon column when no icon exists
* Blistops now shows the menu bar when hovering near the top of the buddy
@@ -20,6 +23,7 @@
* Fixed potential crashes in some other plugins when using Pidgin 2.0.2 or
* Fixed potential random crashes in irssi plugin
+ * Fixed make distcheck in the development code * Updated for Pidgin 2.0.0
--- a/VERSION Wed Jul 11 03:30:51 2007 -0400
+++ b/VERSION Sun Jul 22 05:26:37 2007 -0400
@@ -1,1 +1,1 @@
--- a/configure.ac Wed Jul 11 03:30:51 2007 -0400
+++ b/configure.ac Sun Jul 22 05:26:37 2007 -0400
@@ -1,4 +1,4 @@
-AC_INIT([purple-plugin_pack], [1.1], [guifications-devel@lists.sourceforge.net])
+AC_INIT([purple-plugin_pack], [2.1.0mtn], [guifications-devel@lists.sourceforge.net]) AM_CONFIG_HEADER(pre_config.h)
@@ -335,6 +335,7 @@
--- a/napster/Makefile.am Wed Jul 11 03:30:51 2007 -0400
+++ b/napster/Makefile.am Sun Jul 22 05:26:37 2007 -0400
@@ -1,4 +1,9 @@
-EXTRA_DIST = .purple-plugin .incomplete
napsterdir = $(PURPLE_LIBDIR)
@@ -15,9 +20,22 @@
-napsterpixdir=$(PURPLE_PIXAMPSDIR)/status/default
+napsterpix16x16dir=$(PIDGIN_PIXMAPSDIR)/protocols/16 +napsterpix16x16_DATA=napster16x16.png +napsterpix22x22dir=$(PIDGIN_PIXMAPSDIR)/protocols/22 +napsterpix22x22_DATA=napster22x22.png -napsterpix_DATA=napster.png
+napsterpix48x48dir=$(PIDGIN_PIXMAPSDIR)/protocols/48 +napsterpix48x48_DATA=napster48x48.png + mv $(PIDGIN_PIXMAPSDIR)/protocols/16/napster16x16.png $(PIDGIN_PIXMAPSDIR)//protocols/16/napster.png + mv $(PIDGIN_PIXMAPSDIR)/protocols/22/napster22x22.png $(PIDGIN_PIXMAPSDIR)//protocols/22/napster.png + mv $(PIDGIN_PIXMAPSDIR)/protocols/48/napster48x48.png $(PIDGIN_PIXMAPSDIR)//protocols/48/napster.png Binary file napster/napster.png has changed
Binary file napster/napster16x16.png has changed
Binary file napster/napster22x22.png has changed
Binary file napster/napster48x48.png has changed
--- a/po/POTFILES.in Wed Jul 11 03:30:51 2007 -0400
+++ b/po/POTFILES.in Sun Jul 22 05:26:37 2007 -0400
@@ -44,6 +44,7 @@
showoffline/showoffline.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/snpp/Makefile.am Sun Jul 22 05:26:37 2007 -0400
@@ -0,0 +1,26 @@
+libsnppdir = $(PURPLE_LIBDIR) +libsnpp_la_LDFLAGS = -module -avoid-version +libsnpp_LTLIBRARIES = libsnpp.la +libsnpp_la_SOURCES = snpp.c + -DLIBDIR=\"$(PURPLE_LIBDIR)\" \ + -DDATADIR=\"$(PURPLE_DATADIR)\" \ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/snpp/Makefile.mingw Sun Jul 22 05:26:37 2007 -0400
@@ -0,0 +1,11 @@
+# Description: Makefile for snpp plugin. +include $(PP_TOP)/win_pp.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/snpp/snpp.c Sun Jul 22 05:26:37 2007 -0400
@@ -0,0 +1,597 @@
+ * gaim-snpp Protocol Plugin + * Copyright (C) 2004, Don Seiler <don@seiler.us> + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# include "../pp_config.h" +#include "../common/pp_internal.h" +#include <libc_interface.h> +#include <conversation.h> +#define SNPP_DEFAULT_SERVER "localhost" +#define SNPP_DEFAULT_PORT 444 +#define SNPP_INITIAL_BUFSIZE 1024 + PurpleAccount *account; + struct snpp_page *current_page; +static PurplePlugin *_snpp_plugin = NULL; +static struct snpp_page *snpp_page_new() + purple_debug_info("snpp", "snpp_page_new\n"); + sp = g_new0(struct snpp_page, 1); +static void snpp_page_destroy(struct snpp_page *sp) + purple_debug_info("snpp", "snpp_page_destroy\n"); + if (sp->message != NULL) +static void snpp_send(gint fd, const char *buf) + purple_debug_info("snpp", "snpp_send\n"); + purple_debug_info("snpp", "snpp_send: sending %s\n", buf); + if (!write(fd,buf,strlen(buf))) { + purple_debug_warning("snpp", "snpp_send: Error sending message\n"); +static void snpp_reset(PurpleConnection *gc, struct snpp_data *sd) + purple_debug_info("snpp", "snpp_reset\n"); + purple_input_remove(gc->inpa); + if (sd->current_page != NULL) + snpp_page_destroy(sd->current_page); +static int snpp_cmd_logi(struct snpp_data *sd) + char command[SNPP_INITIAL_BUFSIZE]; + purple_debug_info("snpp", "snpp_cmd_logi\n"); + if ((password = purple_account_get_password(sd->account)) == NULL) + /* If LOGI is unsupported, this should return 500 */ + sd->current_page->state = LOGI; + g_snprintf(command, sizeof(command), "LOGI %s %s\n", + purple_account_get_username(sd->account), + snpp_send(sd->fd, command); +static int snpp_cmd_page(struct snpp_data *sd) + char command[SNPP_INITIAL_BUFSIZE]; + purple_debug_info("snpp", "snpp_cmd_page\n"); + sd->current_page->state = PAGE; + g_snprintf(command, sizeof(command), "PAGE %s\n", sd->current_page->pager); + snpp_send(sd->fd, command); +static int snpp_cmd_mess(struct snpp_data *sd) + char command[SNPP_INITIAL_BUFSIZE]; + purple_debug_info("snpp", "snpp_cmd_mess\n"); + sd->current_page->state = MESS; + g_snprintf(command, sizeof(command), "MESS %s\n", sd->current_page->message); + snpp_send(sd->fd, command); +static int snpp_cmd_send(struct snpp_data *sd) + char command[SNPP_INITIAL_BUFSIZE]; + purple_debug_info("snpp", "snpp_cmd_send\n"); + sd->current_page->state = SEND; + g_snprintf(command, sizeof(command), "SEND\n"); + snpp_send(sd->fd, command); +static int snpp_cmd_quit(struct snpp_data *sd) + char command[SNPP_INITIAL_BUFSIZE]; + purple_debug_info("snpp", "snpp_cmd_quit\n"); + sd->current_page->state = QUIT; + g_snprintf(command, sizeof(command), "QUIT\n"); + snpp_send(sd->fd, command); +static void snpp_callback(gpointer data, gint source, PurpleInputCondition cond) + char buf[SNPP_INITIAL_BUFSIZE]; + PurpleConversation *conv; + purple_debug_info("snpp", "snpp_callback\n"); + if ((len = read(sd->fd, buf, SNPP_INITIAL_BUFSIZE - 1)) < 0) { + purple_debug_warning("snpp", "snpp_callback: Read error\n"); + /* purple_connection_error(gc, _("Read error")); */ + /* Remote closed the connection, probably */ + purple_debug_info("snpp", "snpp_callback: Recv: %s\n", buf); + retcode = g_strndup(buf,3); + if (sd->current_page != NULL) { + purple_debug_info("snpp", "snpp_callback: Current page found.\n"); + * Evaluate state and return code and call appropriate function + * to faciliate processing of pages. + switch (sd->current_page->state) { + purple_debug_info("snpp", "snpp_callback: State is CONN, return code was %s\n", retcode); + if (!g_ascii_strcasecmp(retcode,"220")) + purple_notify_error(gc, NULL, buf, NULL); + purple_debug_info("snpp", "snpp_callback: State is LOGI, return code was %s\n", retcode); + /* If LOGI is unsupported, server should return 500 + XXX 230 is crutch for HylaFAX breaking the protocol */ + if (!g_ascii_strcasecmp(retcode,"250") + || !g_ascii_strcasecmp(retcode, "500") + || !g_ascii_strcasecmp(retcode, "230")) + purple_notify_error(gc, NULL, buf, NULL); + purple_debug_info("snpp", "snpp_callback: State is PAGE, return code was %s\n", retcode); + if (!g_ascii_strcasecmp(retcode,"250")) + purple_notify_error(gc, NULL, buf, NULL); + purple_debug_info("snpp", "snpp_callback: State is MESS, return code was %s\n", retcode); + if (!g_ascii_strcasecmp(retcode,"250")) + purple_notify_error(gc, NULL, buf, NULL); + purple_debug_info("snpp", "snpp_callback: State is SEND, return code was %s\n", retcode); + if (!g_ascii_strcasecmp(retcode,"250") + || !g_ascii_strcasecmp(retcode,"860") + || !g_ascii_strcasecmp(retcode,"960")) { + /* Print status message (buf) to window */ + if ((conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, sd->current_page->pager, sd->account))) { + purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL)); + purple_notify_error(gc, NULL, buf, NULL); + /* Not sure if we should ever get here */ + purple_debug_info("snpp", "snpp_callback: State is QUIT, return code was %s\n", retcode); + if (g_ascii_strcasecmp(retcode,"221")) + purple_debug_info("snpp", "snpp_callback: Return code of 221 expected, not received\n"); + purple_debug_info("snpp", "snpp_callback: current_page in unknown state\n"); + purple_notify_error(gc, NULL, buf, NULL); + purple_debug_info("snpp", "snpp_callback: No current page to process\n"); +static void snpp_connect_cb(gpointer data, gint source, const gchar *error_message) + purple_debug_info("snpp", "snpp_connect_cb\n"); + connections = purple_connections_get_all(); + if (!g_list_find(connections, gc)) { + gc->inpa = purple_input_add(sd->fd, PURPLE_INPUT_READ, snpp_callback, gc); +static void snpp_connect(PurpleConnection *gc) + PurpleProxyConnectData *ppcd = NULL; + purple_debug_info("snpp", "snpp_connect\n"); + ppcd = purple_proxy_connect(gc->account, gc->account, + purple_account_get_string(gc->account, "server", SNPP_DEFAULT_SERVER), + purple_account_get_int(gc->account, "port", SNPP_DEFAULT_PORT), + if (!ppcd || !gc->account->gc) { + purple_connection_error(gc, _("Couldn't connect to SNPP server")); +static int snpp_process(PurpleConnection *gc, struct snpp_data *sd) + purple_debug_info("snpp", "snpp_process\n"); + if (sd->current_page->message && (strlen(sd->current_page->message) > 0)) { + /* Just completed proxy_connect, ready to send data to server */ + purple_debug_info("snpp", "snpp_page: Sending SNPP Request:\n\n%s\n\n", sd->current_page->message); + /* Get ball rolling, snpp_callback will take over */ +static int snpp_send_im(PurpleConnection *gc, + PurpleMessageFlags flags) + purple_debug_info("snpp", "snpp_send_im\n"); + sp->pager = g_strdup(who); + sp->message = g_strdup(what); +static const char *snpp_icon(PurpleAccount *a, PurpleBuddy *b) + /* purple_debug_info("snpp", "snpp_icon\n"); */ +static void fake_buddy_signons(PurpleAccount *account) + PurpleBlistNode *node = purple_get_blist()->root; + if (PURPLE_BLIST_NODE_IS_BUDDY(node)) + PurpleBuddy *buddy = (PurpleBuddy *)node; + if (buddy->account == account) + purple_prpl_got_user_status(account, buddy->name, "available", NULL); + node = purple_blist_node_next(node, FALSE); +static void snpp_login(PurpleAccount *account) + purple_debug_info("snpp", "snpp_login\n"); + gc = purple_account_get_connection(account); + gc->proto_data = sd = g_new0(struct snpp_data, 1); + purple_connection_set_state(gc, PURPLE_CONNECTED); + fake_buddy_signons(account); +static void snpp_close(PurpleConnection *gc) + purple_debug_info("snpp", "snpp_close\n"); +static void snpp_add_buddy(PurpleConnection *gc, PurpleBuddy *b, PurpleGroup *group) + purple_debug_info("snpp", "snpp_add_buddy\n"); + purple_prpl_got_user_status(purple_connection_get_account(gc), b->name, "available", NULL); +static void snpp_remove_buddy(PurpleConnection *gc, PurpleBuddy *b, PurpleGroup *group) + purple_debug_info("snpp", "snpp_remove_buddy\n"); +static GList *snpp_status_types(PurpleAccount *account) + PurpleStatusType *status; + status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, + NULL, NULL, FALSE, TRUE, FALSE); + types = g_list_append(types, status); + status = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, + NULL, NULL, FALSE, TRUE, FALSE); + types = g_list_append(types, status); +static PurplePluginProtocolInfo prpl_info = + OPT_PROTO_PASSWORD_OPTIONAL, /* options */ + NULL, /* user_splits */ + NULL, /* protocol_options */ + NO_BUDDY_ICONS, /* icon_spec */ + snpp_icon, /* list_icon */ + NULL, /* list_emblems */ + NULL, /* status_text */ + NULL, /* tooltip_text */ + snpp_status_types, /* status_types */ + NULL, /* blist_node_menu */ + NULL, /* chat_info_defaults */ + snpp_login, /* login */ + snpp_close, /* close */ + snpp_send_im, /* send_im */ + NULL, /* send_typing */ + NULL, /* change_password */ + snpp_add_buddy, /* add_buddy */ + NULL, /* add_buddies */ + snpp_remove_buddy, /* remove_buddy */ + NULL, /* remove_buddies */ + NULL, /* set_permit_deny */ + NULL, /* reject_chat */ + NULL, /* chat_invite */ + NULL, /* chat_whisper */ + NULL, /* register_user */ + NULL, /* get_cb_info */ + NULL, /* get_cb_away */ + NULL, /* alias_buddy */ + NULL, /* group_buddy */ + NULL, /* rename_group */ + NULL, /* convo_closed */ + 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_catagory */ + NULL, /* can_receive_file */ +static PurplePluginInfo info = + PURPLE_PLUGIN_MAGIC, /* magic */ + PURPLE_MAJOR_VERSION, /* purple major */ + PURPLE_MINOR_VERSION, /* purple minor */ + PURPLE_PLUGIN_PROTOCOL, /* type */ + NULL, /* ui_requirement */ + NULL, /* dependencies */ + PURPLE_PRIORITY_DEFAULT, /* priority */ + NULL, /* description */ + "Don Seiler <don@seiler.us>", /* author */ + PP_WEBSITE, /* homepage */ + &prpl_info, /* extra_info */ +static void _init_plugin(PurplePlugin *plugin) + PurpleAccountOption *option; + option = purple_account_option_string_new(_("Server"), "server", SNPP_DEFAULT_SERVER); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + option = purple_account_option_int_new(_("Port"), "port", SNPP_DEFAULT_PORT); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + info.name = _("SNPP Plugin"); + info.summary = _("SNPP Plugin"); + _("Allows libpurple to send messages over the Simple Network Paging " +PURPLE_INIT_PLUGIN(snpp, _init_plugin, info); Binary file snpp/snpp16.png has changed