aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2017-01-22 06:31:21 +0000
committerepochqwert <epoch@hacking.allowed.org>2017-01-22 06:31:21 +0000
commit991dced81da59a793a5cf709205f7c097d9499ad (patch)
treec07d6bea895bb3c99f70756a62dcc715bc5bc6fa
parent1af804bc9afedfdfefdb527ae78534b0b0af1e7d (diff)
downloadsegfault-991dced81da59a793a5cf709205f7c097d9499ad.tar.gz
segfault-991dced81da59a793a5cf709205f7c097d9499ad.zip
made some special handler aliases prefix with ; instead of nothing to help prevent accidental usage
-rw-r--r--segfault.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/segfault.c b/segfault.c
index ebf3c74..084a97f 100644
--- a/segfault.c
+++ b/segfault.c
@@ -1088,8 +1088,8 @@ void message_handler(int fd,char *from,struct user *user,char *msg,int redones)
if(!oldcommand) exit(72);
command=oldcommand;
if(*command == '\x01') {
- command[strlen(command)-1]=0;
- command++;
+ command[strlen(command)-1]=0;//remove the end \x01
+ *command=';';
}
if(!strncmp(command,"s/",2)) {
command[1]=' ';
@@ -1202,15 +1202,15 @@ void line_handler(int fd,char *line) {//this should be built into the libary?
}
}
if(a[0] && user->nick && a[1]) {
+ strcpy(tmp,";");
+ strcat(tmp,a[0]);
if((ht_getnode(&alias,a[0])) != NULL) {
- strcpy(tmp,a[0]);
for(i=0;a[i];i++) {
strcat(tmp," ");
strcat(tmp,a[i]);
}
message_handler(fd,"#cmd",user,tmp,1);
}
-
if(!strcmp(a[0],"JOIN")) {
irc_mode(fd,a[1],"+o",user->nick);
}