Mon May 17 20:13:25 2010 UTC ()
Apply Matt Dunford's patch to track /nick change correctly, parse /topic
changes, and add a bunch of other commands.

Still needs to detect the topic when joining a group...


(sketch)
diff -r1.28 -r1.29 pkgsrc/chat/irssi-icb/Makefile
diff -r1.15 -r1.16 pkgsrc/chat/irssi-icb/distinfo
diff -r1.1 -r1.2 pkgsrc/chat/irssi-icb/patches/patch-ab
diff -r1.2 -r1.3 pkgsrc/chat/irssi-icb/patches/patch-ac

cvs diff -r1.28 -r1.29 pkgsrc/chat/irssi-icb/Makefile (expand / switch to unified diff)

--- pkgsrc/chat/irssi-icb/Makefile 2009/07/30 21:59:07 1.28
+++ pkgsrc/chat/irssi-icb/Makefile 2010/05/17 20:13:25 1.29
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1# $NetBSD: Makefile,v 1.28 2009/07/30 21:59:07 adrianp Exp $ 1# $NetBSD: Makefile,v 1.29 2010/05/17 20:13:25 sketch Exp $
2# 2#
3 3
4DISTNAME= irssi-icb-0.14 4DISTNAME= irssi-icb-0.14
5PKGREVISION= 15 5PKGREVISION= 16
6CATEGORIES= chat 6CATEGORIES= chat
7MASTER_SITES= http://www.irssi.org/files/plugins/icb/ 7MASTER_SITES= http://www.irssi.org/files/plugins/icb/
8DISTFILES= ${DISTNAME}.tar.gz ${IRSSI_DISTFILE} 8DISTFILES= ${DISTNAME}.tar.gz ${IRSSI_DISTFILE}
9 9
10MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
11HOMEPAGE= http://www.irssi.org/ 11HOMEPAGE= http://www.irssi.org/
12COMMENT= Irssi plugin to access ICB networks 12COMMENT= Irssi plugin to access ICB networks
13LICENSE= gnu-gpl-v2 13LICENSE= gnu-gpl-v2
14 14
15PKG_DESTDIR_SUPPORT= user-destdir 15PKG_DESTDIR_SUPPORT= user-destdir
16 16
17.include "../../mk/bsd.prefs.mk" 17.include "../../mk/bsd.prefs.mk"
18.include "../../chat/irssi/Makefile.common" 18.include "../../chat/irssi/Makefile.common"

cvs diff -r1.15 -r1.16 pkgsrc/chat/irssi-icb/distinfo (expand / switch to unified diff)

--- pkgsrc/chat/irssi-icb/distinfo 2010/04/18 06:29:16 1.15
+++ pkgsrc/chat/irssi-icb/distinfo 2010/05/17 20:13:25 1.16
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1$NetBSD: distinfo,v 1.15 2010/04/18 06:29:16 spz Exp $ 1$NetBSD: distinfo,v 1.16 2010/05/17 20:13:25 sketch Exp $
2 2
3SHA1 (irssi-0.8.15.tar.bz2) = b79ce8c2c98a76b004f63706e7868cd363000d89 3SHA1 (irssi-0.8.15.tar.bz2) = b79ce8c2c98a76b004f63706e7868cd363000d89
4RMD160 (irssi-0.8.15.tar.bz2) = 0c8fba8cf3409621f6c1883127e14538a58c3359 4RMD160 (irssi-0.8.15.tar.bz2) = 0c8fba8cf3409621f6c1883127e14538a58c3359
5Size (irssi-0.8.15.tar.bz2) = 948847 bytes 5Size (irssi-0.8.15.tar.bz2) = 948847 bytes
6SHA1 (irssi-icb-0.14.tar.gz) = 31d7a5d04a896e0e19db44b4d76b7ac85af1a5d4 6SHA1 (irssi-icb-0.14.tar.gz) = 31d7a5d04a896e0e19db44b4d76b7ac85af1a5d4
7RMD160 (irssi-icb-0.14.tar.gz) = dd104925ece6eabd0112b86b9eb6898846ba8f52 7RMD160 (irssi-icb-0.14.tar.gz) = dd104925ece6eabd0112b86b9eb6898846ba8f52
8Size (irssi-icb-0.14.tar.gz) = 172647 bytes 8Size (irssi-icb-0.14.tar.gz) = 172647 bytes
9SHA1 (patch-aa) = 8249c9ae3e5ae8b6110db030ee4280aa53ca1192 9SHA1 (patch-aa) = 8249c9ae3e5ae8b6110db030ee4280aa53ca1192
10SHA1 (patch-ab) = c270c35891164c9e42696e2ffc84d1e7ffaaaa2a 10SHA1 (patch-ab) = 768826fbd30ed66fff6ce45b7ca492b69c0c7437
11SHA1 (patch-ac) = 27f9148f68e2fb612dac51ac5d9401338e926d77 11SHA1 (patch-ac) = 68409b392f3212a8da9a79c2dfcc4dc265504d98
12SHA1 (patch-ad) = f5cf3b9294a1a8a450f8c380ff41bbaafd425337 12SHA1 (patch-ad) = f5cf3b9294a1a8a450f8c380ff41bbaafd425337
13SHA1 (patch-ae) = ee3ed714e2f1d136562b87cfd82bc4b58b7d80df 13SHA1 (patch-ae) = ee3ed714e2f1d136562b87cfd82bc4b58b7d80df

cvs diff -r1.1 -r1.2 pkgsrc/chat/irssi-icb/patches/Attic/patch-ab (expand / switch to unified diff)

--- pkgsrc/chat/irssi-icb/patches/Attic/patch-ab 2004/03/28 20:09:20 1.1
+++ pkgsrc/chat/irssi-icb/patches/Attic/patch-ab 2010/05/17 20:13:25 1.2
@@ -1,27 +1,120 @@ @@ -1,27 +1,120 @@
1$NetBSD: patch-ab,v 1.1 2004/03/28 20:09:20 wiz Exp $ 1$NetBSD: patch-ab,v 1.2 2010/05/17 20:13:25 sketch Exp $
2 2
3--- src/fe-common/fe-icb.c.orig Sat Apr 27 22:56:18 2002 3--- src/fe-common/fe-icb.c.orig 2002-04-27 21:56:18.000000000 +0100
4+++ src/fe-common/fe-icb.c 4+++ src/fe-common/fe-icb.c 2010-05-17 20:52:23.000000000 +0100
5@@ -18,6 +18,8 @@ 5@@ -18,12 +18,15 @@
6 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7 */ 7 */
8  8
9+#include <time.h> 9+#include <time.h>
10+ 10+
11 #include "module.h" 11 #include "module.h"
12 #include "module-formats.h" 12 #include "module-formats.h"
13 #include "signals.h" 13 #include "signals.h"
14@@ -84,12 +86,67 @@ static void event_personal(ICB_SERVER_RE 14 #include "commands.h"
 15 #include "servers-setup.h"
 16 #include "levels.h"
 17+#include "nicklist.h"
 18
 19 #include "icb.h"
 20 #include "icb-servers.h"
 21@@ -33,16 +36,84 @@
 22 #include "printtext.h"
 23 #include "themes.h"
 24
 25+static void icb_channel_change_topic(ICB_SERVER_REC *server,
 26+ const char *topic, const char *setby,
 27+ time_t settime)
 28+{
 29+ if (topic != NULL) {
 30+ g_free_not_null(server->group->topic);
 31+ server->group->topic = g_strdup(topic);
 32+ }
 33+
 34+ if (setby != NULL) {
 35+ g_free_not_null(server->group->topic_by);
 36+ server->group->topic_by = g_strdup(setby);
 37+ }
 38+
 39+ server->group->topic_time = settime;
 40+
 41+ signal_emit("channel topic changed", 1, server->group);
 42+}
 43+
 44 static void event_status(ICB_SERVER_REC *server, const char *data)
 45 {
 46 char **args;
 47+ int len;
 48+ char *oldnick, *newnick;
 49+ char *topic, *setby, *p1, *p2;
 50
 51 /* FIXME: status messages should probably divided into their own
 52 signals so irssi could track joins, parts, etc. */
 53 args = icb_split(data, 2);
 54 printformat(server, server->group->name, MSGLEVEL_CRAP,
 55 ICBTXT_STATUS, args[0], args[1]);
 56- icb_split_free(args);
 57+
 58+ len = strlen("Name");
 59+ if (strncmp(args[0],"Name",len) == 0) {
 60+ oldnick = g_strdup(args[1]);
 61+ p2 = strchr(oldnick, ' ');
 62+ if (p2 != NULL) {
 63+ *p2 = '\0';
 64+ /* make sure it's me changing the nick */
 65+ if (strcmp(oldnick, server->connrec->nick) == 0) {
 66+ newnick = strrchr(args[1], ' ');
 67+ if (newnick != NULL) {
 68+ newnick++; /* skip the space */
 69+ server_change_nick(SERVER(server), newnick);
 70+ nicklist_rename(SERVER(server), server->connrec->nick, newnick);
 71+ g_free(server->connrec->nick);
 72+ server->connrec->nick = g_strdup(newnick);
 73+ }
 74+ }
 75+ }
 76+ g_free(oldnick);
 77+ }
 78+
 79+ /* sample topic msg: nick changed the topic to \"test 1\" */
 80+ len = strlen("Topic");
 81+ if (strncmp(args[0],"Topic",len) == 0) {
 82+ p1 = strchr(args[1], '"');
 83+ p2 = strrchr(args[1], '"');
 84+
 85+ /* make sure there's something between those quotes */
 86+ if (p1) {
 87+ p1++;
 88+ topic = g_strdup(p1);
 89+ p2 = strrchr(topic, '"');
 90+ *p2 = '\0';
 91+
 92+ setby = g_strdup(args[1]);
 93+ p2 = strchr(setby, ' ');
 94+ *p2 = '\0';
 95+
 96+ icb_channel_change_topic(server, topic, setby, time(NULL));
 97+
 98+ g_free(topic);
 99+ g_free(setby);
 100+ }
 101+ }
 102+
 103+ icb_split_free(args);
 104 }
 105
 106 static void event_error(ICB_SERVER_REC *server, const char *data)
 107@@ -84,12 +155,67 @@
15 icb_split_free(args); 108 icb_split_free(args);
16 } 109 }
17  110
18+static void idle_time(char *buf, size_t bufsize, time_t idle) 111+static void idle_time(char *buf, size_t bufsize, time_t idle)
19+{ 112+{
20+#define MIN_LEN 60UL 113+#define MIN_LEN 60UL
21+#define HOUR_LEN 3600UL 114+#define HOUR_LEN 3600UL
22+#define DAY_LEN 86400UL 115+#define DAY_LEN 86400UL
23+#define WEEK_LEN 604800UL 116+#define WEEK_LEN 604800UL
24+ 117+
25+ if (idle >= WEEK_LEN) 118+ if (idle >= WEEK_LEN)
26+ snprintf(buf, bufsize, "%2dw%2dd", 119+ snprintf(buf, bufsize, "%2dw%2dd",
27+ (int)(idle/WEEK_LEN), (int)((idle%WEEK_LEN)/DAY_LEN)); 120+ (int)(idle/WEEK_LEN), (int)((idle%WEEK_LEN)/DAY_LEN));
@@ -70,29 +163,29 @@ $NetBSD: patch-ab,v 1.1 2004/03/28 20:09 @@ -70,29 +163,29 @@ $NetBSD: patch-ab,v 1.1 2004/03/28 20:09
70+ printtext(server, NULL, MSGLEVEL_CRAP, line); 163+ printtext(server, NULL, MSGLEVEL_CRAP, line);
71+} 164+}
72+ 165+
73 static void cmdout_default(ICB_SERVER_REC *server, char **args) 166 static void cmdout_default(ICB_SERVER_REC *server, char **args)
74 { 167 {
75 char *data; 168 char *data;
76  169
77 data = g_strjoinv(" ", args+1); 170 data = g_strjoinv(" ", args+1);
78- printtext(server, server->group->name, MSGLEVEL_CRAP, "%s", data); 171- printtext(server, server->group->name, MSGLEVEL_CRAP, "%s", data);
79+ printtext(server, NULL, MSGLEVEL_CRAP, "%s", data); 172+ printtext(server, NULL, MSGLEVEL_CRAP, "%s", data);
80 g_free(data); 173 g_free(data);
81 } 174 }
82  175
83@@ -115,6 +172,7 @@ void fe_icb_init(void) 176@@ -115,6 +241,7 @@
84 signal_add("icb event beep", (SIGNAL_FUNC) event_beep); 177 signal_add("icb event beep", (SIGNAL_FUNC) event_beep);
85 signal_add("icb event open", (SIGNAL_FUNC) event_open); 178 signal_add("icb event open", (SIGNAL_FUNC) event_open);
86 signal_add("icb event personal", (SIGNAL_FUNC) event_personal); 179 signal_add("icb event personal", (SIGNAL_FUNC) event_personal);
87+ signal_add("icb cmdout wl", (SIGNAL_FUNC) cmdout_wl); 180+ signal_add("icb cmdout wl", (SIGNAL_FUNC) cmdout_wl);
88 signal_add("default icb cmdout", (SIGNAL_FUNC) cmdout_default); 181 signal_add("default icb cmdout", (SIGNAL_FUNC) cmdout_default);
89  182
90 signal_add("server add fill", (SIGNAL_FUNC) sig_server_add_fill); 183 signal_add("server add fill", (SIGNAL_FUNC) sig_server_add_fill);
91@@ -131,6 +189,7 @@ void fe_icb_deinit(void) 184@@ -131,6 +258,7 @@
92 signal_remove("icb event beep", (SIGNAL_FUNC) event_beep); 185 signal_remove("icb event beep", (SIGNAL_FUNC) event_beep);
93 signal_remove("icb event open", (SIGNAL_FUNC) event_open); 186 signal_remove("icb event open", (SIGNAL_FUNC) event_open);
94 signal_remove("icb event personal", (SIGNAL_FUNC) event_personal); 187 signal_remove("icb event personal", (SIGNAL_FUNC) event_personal);
95+ signal_remove("icb cmdout wl", (SIGNAL_FUNC) cmdout_wl); 188+ signal_remove("icb cmdout wl", (SIGNAL_FUNC) cmdout_wl);
96 signal_remove("default icb cmdout", (SIGNAL_FUNC) cmdout_default); 189 signal_remove("default icb cmdout", (SIGNAL_FUNC) cmdout_default);
97  190
98 signal_remove("server add fill", (SIGNAL_FUNC) sig_server_add_fill); 191 signal_remove("server add fill", (SIGNAL_FUNC) sig_server_add_fill);

cvs diff -r1.2 -r1.3 pkgsrc/chat/irssi-icb/patches/Attic/patch-ac (expand / switch to unified diff)

--- pkgsrc/chat/irssi-icb/patches/Attic/patch-ac 2009/01/19 10:20:03 1.2
+++ pkgsrc/chat/irssi-icb/patches/Attic/patch-ac 2010/05/17 20:13:25 1.3
@@ -1,12 +1,13 @@ @@ -1,12 +1,13 @@
1$NetBSD: patch-ac,v 1.2 2009/01/19 10:20:03 sketch Exp $ 1$NetBSD: patch-ac,v 1.3 2010/05/17 20:13:25 sketch Exp $
2 2
3--- src/core/icb-commands.c.orig Sat May 4 18:21:43 2002 3--- src/core/icb-commands.c.orig 2002-05-04 18:21:43.000000000 +0100
4+++ src/core/icb-commands.c Mon Jan 19 10:16:27 2009 4+++ src/core/icb-commands.c 2010-05-17 20:40:28.000000000 +0100
5@@ -32,6 +32,7 @@ 5@@ -32,6 +32,8 @@
6  6
7 "invite", "v", "echoback", "name", "motd", "topic", "status", 7 "invite", "v", "echoback", "name", "motd", "topic", "status",
8 "boot", "pass", "drop", "shutdown", "wall", 8 "boot", "pass", "drop", "shutdown", "wall",
9+ "whereis", "brick", 9+ "whereis", "brick", "away", "noaway", "nobeep", "cancel",
 10+ "exclude", "news", "notify", "s_help", "shuttime", "talk", "hush",
10 NULL 11 NULL
11 }; 12 };
12  13