Introduction
Introduction Statistics Contact Development Disclaimer Help
Add topic support - irc - Unnamed repository; edit this file 'description' to n…
git clone git://vernunftzentrum.de/irc.git
Log
Files
Refs
README
---
commit 8ba4cb0d85f3f438fb3768c0339c43bd16feb6c2
parent 43b931057b97856c20c11c587c3e0f5ac55aad7c
Author: Christian Kellermann <[email protected]>
Date: Wed, 28 Mar 2018 21:55:04 +0200
Add topic support
Diffstat:
irc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/irc.c b/irc.c
@@ -491,6 +491,13 @@ scmd(char *usr, char *cmd, char *par, char *data)
chl[s].name[0] = 0;
strncat(chl[s].name, fch, ChanLen - 1);
tdrawbar();
+ } else if (!strcmp(cmd, "TOPIC") || !strcmp(cmd, "332")
+ || !strcmp(cmd, "331")) {
+ char *chan = !strcmp(cmd, "TOPIC") ? pm : strtok(0, " ");
+ if (!data || !pm || !chan)
+ return;
+ pushf(chfind(chan), "Topic for %s: %s", chan, data);
+ tredraw();
} else if (!strcmp(cmd, "471") || !strcmp(cmd, "473")
|| !strcmp(cmd, "474") || !strcmp(cmd, "475")) { /* Join er…
if ((pm = strtok(0, " "))) {
@@ -574,6 +581,13 @@ uparse(char *m)
if (p[1])
sndf("%s", &p[2]);
return;
+ case 't':
+ p = p + 1 + (p[1]==' ');
+ if (*p == '\0')
+ sndf("TOPIC %s", chl[ch].name);
+ else
+ sndf("TOPIC %s :%s", chl[ch].name, p);
+ return;
case 'q': /* Quit. */
quit = 1;
return;
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.