/* Hybrid IRCD functions
*
* (C) 2003-2007 Anope Team
* Contact us at info@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
*
*/
#include "services.h"
#include "pseudo.h"
#include "hybrid.h"
IRCDVar myIrcd[] = {
{"HybridIRCd 7.*", /* ircd name */
"+o", /* nickserv mode */
"+o", /* chanserv mode */
"+o", /* memoserv mode */
NULL, /* hostserv mode */
"+io", /* operserv mode */
"+o", /* botserv mode */
"+h", /* helpserv mode */
"+i", /* Dev/Null mode */
"+io", /* Global mode */
"+o", /* nickserv alias mode */
"+o", /* chanserv alias mode */
"+o", /* memoserv alias mode */
NULL, /* hostserv alias mode */
"+io", /* operserv alias mode */
"+o", /* botserv alias mode */
"+h", /* helpserv alias mode */
"+i", /* Dev/Null alias mode */
"+io", /* Global alias mode */
"+", /* Used by BotServ Bots */
3, /* Chan Max Symbols */
"-ailmnpst", /* Modes to Remove */
"+o", /* Channel Umode used by Botserv bots */
0, /* SVSNICK */
0, /* Vhost */
0, /* Has Owner */
NULL, /* Mode to set for an owner */
NULL, /* Mode to unset for an owner */
NULL, /* Mode to set for admin */
NULL, /* Mode to unset for admin */
NULL, /* Mode On Reg */
NULL, /* Mode on ID for Roots */
NULL, /* Mode on ID for Admins */
NULL, /* Mode on ID for Opers */
NULL, /* Mode on UnReg */
NULL, /* Mode on Nick Change */
0, /* Supports SGlines */
0, /* Supports SQlines */
0, /* Supports SZlines */
1, /* Supports Halfop +h */
3, /* Number of server args */
1, /* Join 2 Set */
1, /* Join 2 Message */
1, /* Has exceptions +e */
0, /* TS Topic Forward */
0, /* TS Topci Backward */
0, /* Protected Umode */
0, /* Has Admin */
0, /* Chan SQlines */
0, /* Quit on Kill */
0, /* SVSMODE unban */
0, /* Has Protect */
0, /* Reverse */
0, /* Chan Reg */
0, /* Channel Mode */
0, /* vidents */
0, /* svshold */
0, /* time stamp on mode */
0, /* NICKIP */
0, /* UMODE */
0, /* O:LINE */
0, /* VHOST ON NICK */
0, /* Change RealName */
CMODE_p, /* No Knock */
0, /* Admin Only */
DEFAULT_MLOCK, /* Default MLOCK */
0, /* Vhost Mode */
0, /* +f */
0, /* +L */
0, /* +f Mode */
0, /* +L Mode */
0, /* On nick change check if they could be identified */
0, /* No Knock requires +i */
NULL, /* CAPAB Chan Modes */
0, /* We support TOKENS */
1, /* TOKENS are CASE inSensitive */
0, /* TIME STAMPS are BASE64 */
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
0, /* SJOIN invite char */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
NULL, /* vhost char */
0, /* ts6 */
0, /* support helper umode */
0, /* p10 */
NULL, /* character set */
0, /* reports sync state */
}
,
{NULL}
};
IRCDCAPAB myIrcdcap[] = {
{
CAPAB_NOQUIT, /* NOQUIT */
0, /* TSMODE */
0, /* UNCONNECT */
0, /* NICKIP */
0, /* SJOIN */
CAPAB_ZIP, /* ZIP */
0, /* BURST */
CAPAB_TS5, /* TS5 */
0, /* TS3 */
0, /* DKEY */
0, /* PT4 */
0, /* SCS */
CAPAB_QS, /* QS */
CAPAB_UID, /* UID */
CAPAB_KNOCK, /* KNOCK */
0, /* CLIENT */
0, /* IPV6 */
0, /* SSJ5 */
0, /* SN2 */
0, /* TOKEN */
0, /* VHOST */
0, /* SSJ3 */
0, /* NICK2 */
0, /* UMODE2 */
0, /* VL */
0, /* TLKEXT */
0, /* DODKEY */
0, /* DOZIP */
0, 0, 0}
};
void hybrid_set_umode(User * user, int ac, char **av)
{
int add = 1; /* 1 if adding modes, 0 if deleting */
char *modes = av[0];
ac--;
if (debug)
alog("debug: Changing mode for %s to %s", user->nick, modes);
while (*modes) {
/* This looks better, much better than "add ? (do_add) : (do_remove)".
* At least this is readable without paying much attention :) -GD
*/
if (add)
user->mode |= umodes[(int) *modes];
else
user->mode &= ~umodes[(int) *modes];
switch (*modes++) {
case '+':
add = 1;
break;
case '-':
add
|