Introduction
Introduction Statistics Contact Development Disclaimer Help
ii-1.4-joinuser.diff - sites - public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log
Files
Refs
---
ii-1.4-joinuser.diff (2213B)
---
1 diff -r d93eaacde742 ii.c
2 --- a/ii.c Fri Jun 25 10:55:05 2010 +0200
3 +++ b/ii.c Tue Jul 13 09:29:23 2010 -0700
4 @@ -105,6 +105,7 @@
5 return open(infile, O_RDONLY | O_NONBLOCK, 0);
6 }
7
8 +static void print_out(char *channel, char *buf); // needs to be declared
9 static void add_channel(char *name) {
10 Channel *c;
11 int fd;
12 @@ -130,6 +131,12 @@
13 }
14 c->fd = fd;
15 c->name = strdup(name);
16 +
17 + if(name[0] && !((name[0]=='#')||(name[0]=='&')||(name[0]=='+')|…
18 + char msg[128];
19 + snprintf(msg, sizeof(msg), "-!- %s has joined %s", nick…
20 + print_out(name, msg);
21 + }
22 }
23
24 static void rm_channel(Channel *c) {
25 @@ -210,6 +217,7 @@
26 if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
27 if(strstr(buf, server)) channel="";
28 create_filepath(outfile, sizeof(outfile), channel, "out");
29 + if(channel && channel[0]) add_channel(channel);
30 if(!(out = fopen(outfile, "a"))) return;
31
32 strftime(buft, sizeof(buft), "%F %R", localtime(&t));
33 @@ -237,17 +245,14 @@
34 case 'j':
35 p = strchr(&buf[3], ' ');
36 if(p) *p = 0;
37 + add_channel(&buf[3]);
38 if((buf[3]=='#')||(buf[3]=='&')||(buf[3]=='+')|…
39 if(p) snprintf(message, PIPE_BUF, "JOIN…
40 else snprintf(message, PIPE_BUF, "JOIN …
41 - add_channel(&buf[3]);
42 }
43 - else {
44 - if(p){
45 - add_channel(&buf[3]);
46 - proc_channels_privmsg(&buf[3], …
47 - return;
48 - }
49 + else if(p) {
50 + proc_channels_privmsg(&buf[3], p + 1);
51 + return;
52 }
53 break;
54 case 't':
55 @@ -357,6 +362,8 @@
56 argv[TOK_CHAN] = argv[TOK_TEXT];
57 snprintf(message, PIPE_BUF, "-!- %s(%s) has joined %s",…
58 } else if(!strncmp("PART", argv[TOK_CMD], 5)) {
59 + if (!strcmp(nick, argv[TOK_NICKSRV]))
60 + return;
61 snprintf(message, PIPE_BUF, "-!- %s(%s) has left %s", a…
62 } else if(!strncmp("MODE", argv[TOK_CMD], 5))
63 snprintf(message, PIPE_BUF, "-!- %s changed mode/%s -> …
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.