/* 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
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;
}
mn->idle_since = now;
/* Never send a NOTICE to a channel to one of the services */
- if (!pd->is_notice && cf->func && GetUserMode(cn, cf->service))
- cf->func(pd->user, cn, pd->text+1, 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 */
for (x = 0; x < ALLCHANMSG_FUNCS_MAX; x++) {
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);
}
}
* to be more specific than an existing ban.
*/
for (jj=0; jj<channel->banlist.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--;
}
}
break;
case MODE_REMOVE|MODE_BAN:
for (jj=0; jj<channel->banlist.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;