Introduction
Introduction Statistics Contact Development Disclaimer Help
Support for nick changes with "n" command - irc - Unnamed repository; edit this…
git clone git://vernunftzentrum.de/irc.git
Log
Files
Refs
README
---
commit 43b931057b97856c20c11c587c3e0f5ac55aad7c
parent b9c8db79bf4902329e427dfae03e537f128df4c4
Author: Christian Kellermann <[email protected]>
Date: Wed, 28 Mar 2018 17:23:16 +0200
Support for nick changes with "n" command
Diffstat:
irc.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/irc.c b/irc.c
@@ -460,6 +460,19 @@ scmd(char *usr, char *cmd, char *par, char *data)
chl[c].new = 1;
tdrawbar();
}
+ } else if (!strcmp(cmd, "NICK")) {
+ if (!data || !pm)
+ return;
+ if (!strcmp(usr, nick)){
+ for (int c=0; c < nch; c++){
+ pushf(c, "-!- you are now known as %s", data);
+ }
+ strlcpy(nick, data, sizeof(nick));
+ } else {
+ pushf(chfind(pm), "%s - is now known as %s", usr, data…
+ }
+ tredraw();
+ return;
} else if (!strcmp(cmd, "PING")) {
sndf("PONG :%s", data ? data : "(null)");
} else if (!strcmp(cmd, "PART")) {
@@ -485,6 +498,12 @@ scmd(char *usr, char *cmd, char *par, char *data)
pushf(0, "-!- Cannot join channel %s (%s)", pm, cmd);
tredraw();
}
+ } else if( !strcmp(cmd, "432") || !strcmp(cmd, "433")
+ || !strcmp(cmd, "436")) { /* Nick change failed. */
+ if (!data)
+ return;
+ pushf(0, "-!- Cannot change to nick %s: %s", pm, data);
+ tredraw();
} else if (!strcmp(cmd, "QUIT")) { /* Commands we don't care about. */
return;
} else if (!strcmp(cmd, "NOTICE") || !strcmp(cmd, "375")
@@ -544,6 +563,13 @@ uparse(char *m)
*p++ = 0;
sndf("PRIVMSG %s :%s", m, p);
return;
+ case 'n': /* change nick */
+ p = p + 1 + (p[1]==' ');
+ p = strtok(p, " ");
+ if (p) {
+ sndf("NICK %s", p);
+ }
+ return;
case 'r': /* Send raw. */
if (p[1])
sndf("%s", &p[2]);
You are viewing proxied material from vernunftzentrum.de. 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.