X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/ec1a68c8a2703555659265994f30e8f9156af21c..921592dd1adaed54948c030be0daceb7e0c9d5b7:/src/proto-common.c diff --git a/src/proto-common.c b/src/proto-common.c index a2342a1..0cff85a 100644 --- a/src/proto-common.c +++ b/src/proto-common.c @@ -1,7 +1,7 @@ /* proto-common.c - common IRC protocol parsing/sending support * Copyright 2000-2004 srvx Development Team * - * This file is part of srvx. + * This file is part of x3. * * srvx is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -373,7 +373,7 @@ static CMD_FUNC(cmd_version) log_module(MAIN_LOG, LOG_ERROR, "Could not find VERSION origin user %s", origin); return 0; } - irc_numeric(user, 351, "%s.%s %s :%s", PACKAGE_TARNAME, PACKAGE_VERSION, self->name, CODENAME); + irc_numeric(user, 351, "%s %s %s", PACKAGE_TARNAME, PACKAGE_VERSION, self->name); return 1; } @@ -440,8 +440,8 @@ privmsg_chan_helper(struct chanNode *cn, void *data) mn->idle_since = now; /* Never send a NOTICE to a channel to one of the services */ - if (!pd->is_notice && cf->func && - ((cn->modes & MODE_REGISTERED) || GetUserMode(cn, cf->service))) + if (!pd->is_notice && cf->func + && ((cn->modes & MODE_REGISTERED) || GetUserMode(cn, cf->service))) cf->func(pd->user, cn, pd->text+1, cf->service); /* This catches *all* text sent to the channel that the services server sees */ @@ -450,7 +450,7 @@ privmsg_chan_helper(struct chanNode *cn, void *data) if (!cf->func) break; /* end of list */ else - cf->func(pd->user, cn, pd->text, cf->service); + cf->func(pd->user, cn, pd->text, cf->service); } } @@ -570,9 +570,10 @@ mod_chanmode_apply(struct userNode *who, struct chanNode *channel, struct mod_ch * to be more specific than an existing ban. */ for (jj=0; jjbanlist.used; ++jj) { - if (match_ircglobs(change->args[ii].u.hostmask, channel->banlist.list[jj]->ban)) { - banList_remove(&channel->banlist, channel->banlist.list[jj]); - free(channel->banlist.list[jj]); + bn = channel->banlist.list[jj]; + if (match_ircglobs(change->args[ii].u.hostmask, bn->ban)) { + banList_remove(&channel->banlist, bn); + free(bn); jj--; } } @@ -587,10 +588,11 @@ mod_chanmode_apply(struct userNode *who, struct chanNode *channel, struct mod_ch break; case MODE_REMOVE|MODE_BAN: for (jj=0; jjbanlist.used; ++jj) { - if (strcmp(channel->banlist.list[jj]->ban, change->args[ii].u.hostmask)) + bn = channel->banlist.list[jj]; + if (strcmp(bn->ban, change->args[ii].u.hostmask)) continue; - free(channel->banlist.list[jj]); - banList_remove(&channel->banlist, channel->banlist.list[jj]); + free(bn); + banList_remove(&channel->banlist, bn); break; } break; @@ -735,7 +737,7 @@ generate_hostmask(struct userNode *user, int options) mask = ~0 << masklen; masked_ip = ntohl(user->ip.s_addr) & mask; hostname = alloca(32); - if (options & GENMASK_SRVXMASK) { + if (options & GENMASK_X3MASK) { sprintf(hostname, "%d.%d.%d.%d/%d", (masked_ip>>24)&0xFF, (masked_ip>>16)&0xFF, (masked_ip>>8)&0xFF, masked_ip&0xFF, masklen); } else { int ofs = 0;