pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/chat/irssi-icb Add another bunch of patches, including:
details: https://anonhg.NetBSD.org/pkgsrc/rev/64ab7fffa8b5
branches: trunk
changeset: 578669:64ab7fffa8b5
user: sketch <sketch%pkgsrc.org@localhost>
date: Tue Aug 10 20:26:36 2010 +0000
description:
Add another bunch of patches, including:
- implement commands via irssi signals
- detect /topic on join
- support /names, including on join
- build correctly as .so on OSX
diffstat:
chat/irssi-icb/Makefile | 4 +-
chat/irssi-icb/distinfo | 15 +-
chat/irssi-icb/patches/patch-aa | 25 +-
chat/irssi-icb/patches/patch-ab | 458 +++++++++++++++++++++++++++++++++------
chat/irssi-icb/patches/patch-af | 84 ++++++-
chat/irssi-icb/patches/patch-ag | 20 +-
chat/irssi-icb/patches/patch-ai | 13 +
chat/irssi-icb/patches/patch-aj | 41 +++
chat/irssi-icb/patches/patch-al | 14 +
chat/irssi-icb/patches/patch-am | 49 ++++
chat/irssi-icb/patches/patch-an | 38 +++
11 files changed, 650 insertions(+), 111 deletions(-)
diffs (truncated from 920 to 300 lines):
diff -r e3a2133b3dfa -r 64ab7fffa8b5 chat/irssi-icb/Makefile
--- a/chat/irssi-icb/Makefile Tue Aug 10 18:04:30 2010 +0000
+++ b/chat/irssi-icb/Makefile Tue Aug 10 20:26:36 2010 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.30 2010/05/18 21:38:49 sketch Exp $
+# $NetBSD: Makefile,v 1.31 2010/08/10 20:26:36 sketch Exp $
#
DISTNAME= irssi-icb-0.14
-PKGREVISION= 17
+PKGREVISION= 18
CATEGORIES= chat
MASTER_SITES= http://www.irssi.org/files/plugins/icb/
DISTFILES= ${DISTNAME}.tar.gz ${IRSSI_DISTFILE}
diff -r e3a2133b3dfa -r 64ab7fffa8b5 chat/irssi-icb/distinfo
--- a/chat/irssi-icb/distinfo Tue Aug 10 18:04:30 2010 +0000
+++ b/chat/irssi-icb/distinfo Tue Aug 10 20:26:36 2010 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2010/05/18 21:38:49 sketch Exp $
+$NetBSD: distinfo,v 1.18 2010/08/10 20:26:36 sketch Exp $
SHA1 (irssi-0.8.15.tar.bz2) = b79ce8c2c98a76b004f63706e7868cd363000d89
RMD160 (irssi-0.8.15.tar.bz2) = 0c8fba8cf3409621f6c1883127e14538a58c3359
@@ -6,11 +6,16 @@
SHA1 (irssi-icb-0.14.tar.gz) = 31d7a5d04a896e0e19db44b4d76b7ac85af1a5d4
RMD160 (irssi-icb-0.14.tar.gz) = dd104925ece6eabd0112b86b9eb6898846ba8f52
Size (irssi-icb-0.14.tar.gz) = 172647 bytes
-SHA1 (patch-aa) = 8249c9ae3e5ae8b6110db030ee4280aa53ca1192
-SHA1 (patch-ab) = 768826fbd30ed66fff6ce45b7ca492b69c0c7437
+SHA1 (patch-aa) = b94bae58a59f4d96a107ad123a6abe7ac0ca375a
+SHA1 (patch-ab) = 6ca4512785b91e7a05cccd8806dbcab969e91cca
SHA1 (patch-ac) = 68409b392f3212a8da9a79c2dfcc4dc265504d98
SHA1 (patch-ad) = f5cf3b9294a1a8a450f8c380ff41bbaafd425337
SHA1 (patch-ae) = ee3ed714e2f1d136562b87cfd82bc4b58b7d80df
-SHA1 (patch-af) = 8f68dadd44acd870b3e84fd561edbd5958305ef3
-SHA1 (patch-ag) = 4b0df5a1f59397455963888fbda1a57d56f90757
+SHA1 (patch-af) = 169f32783892241133df73b25817c562531c69c9
+SHA1 (patch-ag) = 2823b763c76c37e4f382cc09456cccb56f1007fc
SHA1 (patch-ah) = 097bab1ebd959372a0266fa5d9a99c78c3a2c1fe
+SHA1 (patch-ai) = 42ce6c309957c3e46c638e2599b932b6ea4065ee
+SHA1 (patch-aj) = 3a46a61b0bd5763f78e85d6a0bff1d1223e8da39
+SHA1 (patch-al) = 2a190b803f00beb83c123bc3416e23ec7c7edc69
+SHA1 (patch-am) = 832aa40a84afbfff303e6080bf420ca2ceec289f
+SHA1 (patch-an) = 0a936cbdb49f9a1bf65d5e92da5d37de65238d27
diff -r e3a2133b3dfa -r 64ab7fffa8b5 chat/irssi-icb/patches/patch-aa
--- a/chat/irssi-icb/patches/patch-aa Tue Aug 10 18:04:30 2010 +0000
+++ b/chat/irssi-icb/patches/patch-aa Tue Aug 10 20:26:36 2010 +0000
@@ -1,14 +1,13 @@
-$NetBSD: patch-aa,v 1.1 2003/12/04 10:48:09 veego Exp $
+$NetBSD: patch-aa,v 1.2 2010/08/10 20:26:36 sketch Exp $
---- src/fe-common/Makefile.in.orig 2002-11-24 14:18:08.000000000 +0100
-+++ src/fe-common/Makefile.in 2003-11-27 11:59:57.000000000 +0100
-@@ -103,7 +103,8 @@
- CPPFLAGS = @CPPFLAGS@
- LDFLAGS = @LDFLAGS@
- LIBS = @LIBS@
--libfe_icb_la_LIBADD =
-+libfe_icb_la_LIBADD = $(top_srcdir)/src/core/libicb_core.la
-+libfe_icb_la_DEPENDENCIES = $(top_srcdir)/src/core/libicb_core.la
- libfe_icb_la_OBJECTS = fe-icb.lo module-formats.lo
- CFLAGS = @CFLAGS@
- COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+--- src/fe-common/Makefile.in.orig 2002-11-24 13:18:08.000000000 +0000
++++ src/fe-common/Makefile.in 2010-08-10 20:57:17.000000000 +0100
+@@ -83,7 +83,7 @@
+ moduledir = $(libdir)/irssi/modules
+
+ module_LTLIBRARIES = libfe_icb.la
+-libfe_icb_la_LDFLAGS = -avoid-version
++libfe_icb_la_LDFLAGS = -module -avoid-version
+
+ INCLUDES = $(GLIB_CFLAGS) -I$(IRSSI_INCLUDE) -I$(IRSSI_INCLUDE)/src -I$(IRSSI_INCLUDE)/src/core -I$(IRSSI_INCLUDE)/src/fe-common/core -I$(top_srcdir)/src/core
+
diff -r e3a2133b3dfa -r 64ab7fffa8b5 chat/irssi-icb/patches/patch-ab
--- a/chat/irssi-icb/patches/patch-ab Tue Aug 10 18:04:30 2010 +0000
+++ b/chat/irssi-icb/patches/patch-ab Tue Aug 10 20:26:36 2010 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-ab,v 1.2 2010/05/17 20:13:25 sketch Exp $
+$NetBSD: patch-ab,v 1.3 2010/08/10 20:26:36 sketch Exp $
---- src/fe-common/fe-icb.c.orig 2002-04-27 21:56:18.000000000 +0100
-+++ src/fe-common/fe-icb.c 2010-05-17 20:52:23.000000000 +0100
-@@ -18,12 +18,15 @@
+--- src/fe-common/fe-icb.c (revision 5174)
++++ src/fe-common/fe-icb.c (working copy)
+@@ -18,33 +18,73 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -18,19 +18,29 @@
#include "icb.h"
#include "icb-servers.h"
-@@ -33,16 +36,84 @@
+ #include "icb-channels.h"
++#include "icb-nicklist.h"
+ #include "icb-protocol.h"
+
#include "printtext.h"
#include "themes.h"
-+static void icb_channel_change_topic(ICB_SERVER_REC *server,
-+ const char *topic, const char *setby,
-+ time_t settime)
-+{
+-static void event_status(ICB_SERVER_REC *server, const char *data)
++static void icb_change_topic(ICB_SERVER_REC *server, const char *topic,
++ const char *setby, time_t settime)
+ {
+- char **args;
+ if (topic != NULL) {
+ g_free_not_null(server->group->topic);
+ server->group->topic = g_strdup(topic);
+ }
-+
+
+- /* FIXME: status messages should probably divided into their own
+- signals so irssi could track joins, parts, etc. */
+- args = icb_split(data, 2);
+- printformat(server, server->group->name, MSGLEVEL_CRAP,
+- ICBTXT_STATUS, args[0], args[1]);
+- icb_split_free(args);
+ if (setby != NULL) {
+ g_free_not_null(server->group->topic_by);
+ server->group->topic_by = g_strdup(setby);
@@ -39,72 +49,42 @@
+ server->group->topic_time = settime;
+
+ signal_emit("channel topic changed", 1, server->group);
+ }
+
++/*
++ * ICB makes it hard to keep track of nicks:
++ *
++ * - moderators can come and go, and even return with a different nick, while
++ * still retaining their moderator status
++ *
++ * - group moderator can change at any time, if the moderator is off-group
++ * while changing nick
++ *
++ * - users can be moderator of multiple groups simultaneously, but can only
++ * be in one group at a time
++ *
++ * So for now we don't bother to track the moderator, just the group nicks
++ */
++static void icb_update_nicklist(ICB_SERVER_REC *server)
++{
++ /*
++ * In theory we should be able to just send '/who <group>' and parse,
++ * but the problem is that ICB does not send any kind of end-of-who
++ * marker when only listing one group, and sending a separate command
++ * isn't guaranteed to come back in the right order.
++ *
++ * So we're forced do perform a full /who and then match against our
++ * groupname. A full /who is terminated with a 'Total: ' line which we
++ * can use as EOF>
++ */
++ server->silentwho = TRUE;
++ icb_command(server, "w", "", NULL);
+}
+
- static void event_status(ICB_SERVER_REC *server, const char *data)
+ static void event_error(ICB_SERVER_REC *server, const char *data)
{
- char **args;
-+ int len;
-+ char *oldnick, *newnick;
-+ char *topic, *setby, *p1, *p2;
-
- /* FIXME: status messages should probably divided into their own
- signals so irssi could track joins, parts, etc. */
- args = icb_split(data, 2);
- printformat(server, server->group->name, MSGLEVEL_CRAP,
- ICBTXT_STATUS, args[0], args[1]);
-- icb_split_free(args);
-+
-+ len = strlen("Name");
-+ if (strncmp(args[0],"Name",len) == 0) {
-+ oldnick = g_strdup(args[1]);
-+ p2 = strchr(oldnick, ' ');
-+ if (p2 != NULL) {
-+ *p2 = '\0';
-+ /* make sure it's me changing the nick */
-+ if (strcmp(oldnick, server->connrec->nick) == 0) {
-+ newnick = strrchr(args[1], ' ');
-+ if (newnick != NULL) {
-+ newnick++; /* skip the space */
-+ server_change_nick(SERVER(server), newnick);
-+ nicklist_rename(SERVER(server), server->connrec->nick, newnick);
-+ g_free(server->connrec->nick);
-+ server->connrec->nick = g_strdup(newnick);
-+ }
-+ }
-+ }
-+ g_free(oldnick);
-+ }
-+
-+ /* sample topic msg: nick changed the topic to \"test 1\" */
-+ len = strlen("Topic");
-+ if (strncmp(args[0],"Topic",len) == 0) {
-+ p1 = strchr(args[1], '"');
-+ p2 = strrchr(args[1], '"');
-+
-+ /* make sure there's something between those quotes */
-+ if (p1) {
-+ p1++;
-+ topic = g_strdup(p1);
-+ p2 = strrchr(topic, '"');
-+ *p2 = '\0';
-+
-+ setby = g_strdup(args[1]);
-+ p2 = strchr(setby, ' ');
-+ *p2 = '\0';
-+
-+ icb_channel_change_topic(server, topic, setby, time(NULL));
-+
-+ g_free(topic);
-+ g_free(setby);
-+ }
-+ }
-+
-+ icb_split_free(args);
- }
-
- static void event_error(ICB_SERVER_REC *server, const char *data)
-@@ -84,12 +155,67 @@
+ printformat(server, NULL, MSGLEVEL_CRAP, ICBTXT_ERROR, data);
+@@ -84,15 +124,351 @@
icb_split_free(args);
}
@@ -131,6 +111,77 @@
+ snprintf(buf, bufsize, " %2ds", (int)idle);
+}
+
++static void cmdout_co(ICB_SERVER_REC *server, char **args)
++{
++ char *p, *group, *topic;
++ int len;
++
++ static const char match_group[] = "Group: ";
++ static const char match_topic[] = "Topic: ";
++ static const char match_topicunset[] = "(None)";
++ static const char match_topicis[] = "The topic is";
++ static const char match_total[] = "Total: ";
++
++ /*
++ * Use 'co' as the marker to denote wl lines have finished, so
++ * reset the nick updates
++ */
++ server->updatenicks = FALSE;
++
++ /* If we're running in silent mode, parse the output for nicks/topic */
++ if (server->silentwho) {
++
++ /* Match group lines */
++ len = strlen(match_group);
++ if (strncmp(args[0], match_group, len) == 0) {
++
++ group = g_strdup(args[0] + len);
++ p = strchr(group, ' ');
++ *p = '\0';
++
++ /* Check for our particular group */
++ len = strlen(group);
++ if (g_ascii_strncasecmp(group, server->group->name, len) == 0) {
++
++ /* Start matching nicks */
++ server->updatenicks = TRUE;
++
++ p = strstr(args[0], match_topic);
++ if (p != NULL && p != args[0]) {
++ topic = p + strlen(match_topic);
++ if (topic != NULL) {
++ len = strlen(match_topicunset);
++ if (strncmp(topic,
++ match_topicunset,
++ len) != 0) {
++
++ /* No way to find who set the topic, mark as unknown */
++ icb_change_topic(server, topic, "unknown", time(NULL));
++ }
++ }
++ }
++ }
++ g_free(group);
++ }
++
++ /*
++ * End of /who output, stop silent mode and signal front-end
++ * to display /names list
++ */
++ len = strlen(match_total);
++ if (strncmp(args[0], match_total, len) == 0) {
++ server->silentwho = FALSE;
++ signal_emit("channel joined", 1, server->group);
++ }
++ } else {
++ /* Now that /topic works correctly, ignore server output */
Home |
Main Index |
Thread Index |
Old Index