[wiki] [sites] wiki updated
changeset: 586:7a45682006e5
tag: tip
user: Evan Gates <evan.gates_AT_gmail.com>
date: Tue Jul 13 09:40:16 2010 -0700
files: tools.suckless.org/ii/patches/ii-1.4-autojoin.diff tools.suckless.org/ii/patches/ii-1.4-joinuser.diff
description:
some bug fixes for the ii patches
move add_channel() before fopen(outfile) to avoid race condition with pcw
if PART message is about us, don't print it, that reopens the channel
diff -r 469b087648af -r 7a45682006e5 tools.suckless.org/ii/patches/ii-1.4-autojoin.diff
--- a/tools.suckless.org/ii/patches/ii-1.4-autojoin.diff Thu Jul 08 17:05:41 2010 -0400
+++ b/tools.suckless.org/ii/patches/ii-1.4-autojoin.diff Tue Jul 13 09:40:16 2010 -0700
_AT_@ -1,11 +1,20 @@
diff -r d93eaacde742 ii.c
--- a/ii.c Fri Jun 25 10:55:05 2010 +0200
-+++ b/ii.c Fri Jun 25 10:59:35 2010 -0700
-_AT_@ -211,6 +211,7 @@
++++ b/ii.c Tue Jul 13 02:19:27 2010 -0700
+_AT_@ -210,6 +210,7 @@
+ if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
if(strstr(buf, server)) channel="";
create_filepath(outfile, sizeof(outfile), channel, "out");
++ if(channel && channel[0]) add_channel(channel);
if(!(out = fopen(outfile, "a"))) return;
-+ if(channel && channel[0]) add_channel(channel);
strftime(buft, sizeof(buft), "%F %R", localtime(&t));
- fprintf(out, "%s %s\n", buft, buf);
+_AT_@ -357,6 +358,8 @@
+ argv[TOK_CHAN] = argv[TOK_TEXT];
+ snprintf(message, PIPE_BUF, "-!- %s(%s) has joined %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT]);
+ } else if(!strncmp("PART", argv[TOK_CMD], 5)) {
++ if (!strcmp(nick, argv[TOK_NICKSRV]))
++ return;
+ snprintf(message, PIPE_BUF, "-!- %s(%s) has left %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
+ } else if(!strncmp("MODE", argv[TOK_CMD], 5))
+ snprintf(message, PIPE_BUF, "-!- %s changed mode/%s -> %s %s", argv[TOK_NICKSRV], argv[TOK_CMD + 1] ? argv[TOK_CMD + 1] : "" , argv[TOK_CMD + 2]? argv[TOK_CMD + 2] : "", argv[TOK_CMD + 3] ? argv[TOK_CMD + 3] : "");
diff -r 469b087648af -r 7a45682006e5 tools.suckless.org/ii/patches/ii-1.4-joinuser.diff
--- a/tools.suckless.org/ii/patches/ii-1.4-joinuser.diff Thu Jul 08 17:05:41 2010 -0400
+++ b/tools.suckless.org/ii/patches/ii-1.4-joinuser.diff Tue Jul 13 09:40:16 2010 -0700
_AT_@ -1,6 +1,6 @@
diff -r d93eaacde742 ii.c
--- a/ii.c Fri Jun 25 10:55:05 2010 +0200
-+++ b/ii.c Thu Jul 08 00:55:27 2010 -0700
++++ b/ii.c Tue Jul 13 09:29:23 2010 -0700
_AT_@ -105,6 +105,7 @@
return open(infile, O_RDONLY | O_NONBLOCK, 0);
}
_AT_@ -22,14 +22,14 @@
}
static void rm_channel(Channel *c) {
-_AT_@ -211,6 +218,7 @@
+_AT_@ -210,6 +217,7 @@
+ if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
if(strstr(buf, server)) channel="";
create_filepath(outfile, sizeof(outfile), channel, "out");
++ if(channel && channel[0]) add_channel(channel);
if(!(out = fopen(outfile, "a"))) return;
-+ if(channel && channel[0]) add_channel(channel);
strftime(buft, sizeof(buft), "%F %R", localtime(&t));
- fprintf(out, "%s %s\n", buft, buf);
_AT_@ -237,17 +245,14 @@
case 'j':
p = strchr(&buf[3], ' ');
_AT_@ -52,3 +52,12 @@
}
break;
case 't':
+_AT_@ -357,6 +362,8 @@
+ argv[TOK_CHAN] = argv[TOK_TEXT];
+ snprintf(message, PIPE_BUF, "-!- %s(%s) has joined %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_TEXT]);
+ } else if(!strncmp("PART", argv[TOK_CMD], 5)) {
++ if (!strcmp(nick, argv[TOK_NICKSRV]))
++ return;
+ snprintf(message, PIPE_BUF, "-!- %s(%s) has left %s", argv[TOK_NICKSRV], argv[TOK_USER], argv[TOK_CHAN]);
+ } else if(!strncmp("MODE", argv[TOK_CMD], 5))
+ snprintf(message, PIPE_BUF, "-!- %s changed mode/%s -> %s %s", argv[TOK_NICKSRV], argv[TOK_CMD + 1] ? argv[TOK_CMD + 1] : "" , argv[TOK_CMD + 2]? argv[TOK_CMD + 2] : "", argv[TOK_CMD + 3] ? argv[TOK_CMD + 3] : "");
Received on Tue Jul 13 2010 - 18:40:15 CEST
This archive was generated by hypermail 2.3.0
: Thu Sep 13 2012 - 19:31:22 CEST