commit 01c165d9c7cec58fe89316c691296120acfa9443
parent baf630b80db5bd7fae9fe74539eef569951626b0
Author: Claudio Alessi <smoppy@gmail.com>
Date: Sat, 21 Apr 2018 14:41:48 +0200
Move QUIT stuff into the new quit() function.
Diffstat:
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/circo.c b/circo.c
@@ -134,6 +134,7 @@ Buffer *newbuf(char *name);
void parsecmd(void);
void parsesrv(void);
void privmsg(char *to, char *txt);
+void quit(void);
void recv_busynick(char *u, char *u2, char *u3);
void recv_join(char *who, char *chan, char *txt);
void recv_mode(char *u, char *val, char *u2);
@@ -304,8 +305,7 @@ cmd_msg(char *cmd, char *s) {
void
cmd_quit(char *cmd, char *s) {
- if(srv)
- sout("QUIT :%s", s ? s : QUIT_MESSAGE);
+ quit();
running = 0;
}
@@ -333,10 +333,8 @@ cmd_server(char *cmd, char *s) {
t = host;
else
strncpy(host, t, sizeof host);
- if(srv) {
- sout("QUIT :%s", s ? s : QUIT_MESSAGE);
- hangsup();
- }
+ if(srv)
+ quit();
if(!*host)
bprintf(status, "No host specified.\n");
else if(!*port)
@@ -832,6 +830,13 @@ privmsg(char *to, char *txt) {
}
void
+quit(void) {
+ if(srv)
+ sout("QUIT :%s", s ? s : QUIT_MESSAGE);
+ hangsup();
+}
+
+void
recv_busynick(char *u, char *u2, char *u3) {
bprintf(status, "%s is busy, choose a different /nick\n", nick);
*nick = '\0';