mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-05 13:53:12 +02:00
moved svsmode and svs2mode to m_svsmode.so
This commit is contained in:
@@ -602,4 +602,4 @@ seen. gmtime warning still there
|
||||
- Fixed a /rehash bug dealing with echoing to stderr
|
||||
- Added MAXCONNECTIONS to configure
|
||||
- Added a little utility to make converting an m_* command to a module easier
|
||||
|
||||
- Moved m_svsmode and m_svs2mode to m_svsmode.so and updated modulize a bit
|
||||
|
||||
+21
-3
@@ -1,7 +1,25 @@
|
||||
/*
|
||||
* Module skeleton, by Carsten V. Munk 2001 <stskeeps@tspre.org>
|
||||
* May be used, modified, or changed by anyone, no license applies.
|
||||
* You may relicense this, to any license
|
||||
* IRC - Internet Relay Chat, src/modules/%FILE
|
||||
* (C) 2001 The UnrealIRCd Team
|
||||
*
|
||||
* %DESC%
|
||||
*
|
||||
* See file AUTHORS in IRC package for additional names of
|
||||
* the programmers.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 1, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "struct.h"
|
||||
|
||||
@@ -9,7 +9,10 @@ sed "s/%UCOMMAND%/$UCOMMAND/g" $1.tmp >$1.tmp.1
|
||||
mv $1.tmp.1 $1.tmp
|
||||
sed "s/%MAXPARA%/$4/g" $1.tmp >$1.tmp.1
|
||||
mv $1.tmp.1 $1.tmp
|
||||
|
||||
sed "s/%FILE%/$6/g" $1.tmp >$1.tmp.1
|
||||
mv $1.tmp.1 $1.tmp
|
||||
sed "s/%DESC%/$7/g" $1.tmp >$1.tmp.1
|
||||
mv $1.tmp.1 $1.tmp
|
||||
cat >> $1.tmp << __EOF__
|
||||
`cat $5`
|
||||
__EOF__
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
#*/
|
||||
|
||||
R_MODULES=m_sethost.so m_chghost.so m_chgident.so m_setname.so \
|
||||
m_setident.so m_sdesc.so scan.so scan_socks.so blackhole.so
|
||||
m_setident.so m_sdesc.so m_svsmode.so scan.so scan_socks.so blackhole.so
|
||||
|
||||
COMMANDS=m_sethost.c m_chghost.c m_chgident.c m_setname.c m_setident.c \
|
||||
m_sdesc.c
|
||||
m_sdesc.c m_svsmode.c
|
||||
|
||||
MODULES=commands.so $(R_MODULES)
|
||||
MODULEFLAGS=@MODULEFLAGS@
|
||||
@@ -60,6 +60,9 @@ m_sdesc.so: m_sdesc.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_sdesc.so m_sdesc.c
|
||||
|
||||
m_svsmode.so: m_svsmode.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
-o m_svsmode.so m_svsmode.c
|
||||
|
||||
scan.so: scan.c $(INCLUDES)
|
||||
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
|
||||
|
||||
@@ -86,6 +86,7 @@ void l_commands_init(void)
|
||||
m_chgident_init();
|
||||
m_setident_init();
|
||||
m_sdesc_init();
|
||||
m_svsmode_init();
|
||||
module_buffer = &l_commands_info;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
/*
|
||||
* IRC - Internet Relay Chat, src/modules/scan.c
|
||||
* (C) 2001 The UnrealIRCd Team
|
||||
*
|
||||
* SVSMODE and SVS2MODE commands
|
||||
*
|
||||
* See file AUTHORS in IRC package for additional names of
|
||||
* the programmers.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 1, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "struct.h"
|
||||
#include "common.h"
|
||||
#include "sys.h"
|
||||
#include "numeric.h"
|
||||
#include "msg.h"
|
||||
#include "channel.h"
|
||||
#include "userload.h"
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include "h.h"
|
||||
#ifdef STRIPBADWORDS
|
||||
#include "badwords.h"
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#include "version.h"
|
||||
#endif
|
||||
|
||||
DLLFUNC int m_svsmode(aClient *cptr, aClient *sptr, int parc, char *parv[]);
|
||||
DLLFUNC int m_svs2mode(aClient *cptr, aClient *sptr, int parc, char *parv[]);
|
||||
|
||||
extern ircstats IRCstats;
|
||||
extern int user_modes[];
|
||||
#define MSG_SVSMODE "SVSMODE"
|
||||
#define TOK_SVSMODE "n"
|
||||
#define MSG_SVS2MODE "SVS2MODE"
|
||||
#define TOK_SVS2MODE "v"
|
||||
|
||||
ModuleInfo m_svsmode_info
|
||||
= {
|
||||
1,
|
||||
"test",
|
||||
"$Id$",
|
||||
"command /svsmode and svs2mode",
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC void mod_init(void)
|
||||
#else
|
||||
void m_svsmode_init(void)
|
||||
#endif
|
||||
{
|
||||
module_buffer = &m_svsmode_info;
|
||||
add_Command(MSG_SVSMODE, TOK_SVSMODE, m_svsmode, MAXPARA);
|
||||
add_Command(MSG_SVS2MODE, TOK_SVS2MODE, m_svs2mode, MAXPARA);
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC void mod_load(void)
|
||||
#else
|
||||
void m_svsmode_load(void)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_LINKING
|
||||
DLLFUNC void mod_unload(void)
|
||||
#else
|
||||
void m_svsmode_unload(void)
|
||||
#endif
|
||||
{
|
||||
if (del_Command(MSG_SVSMODE, TOK_SVSMODE, m_svsmode) < 0 || del_Command(MSG_SVS2MODE, TOK_SVS2MODE, m_svs2mode) < 0)
|
||||
{
|
||||
sendto_realops("Failed to delete commands when unloading %s",
|
||||
m_svsmode_info.name);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* m_svsmode() added by taz
|
||||
* parv[0] - sender
|
||||
* parv[1] - username to change mode for
|
||||
* parv[2] - modes to change
|
||||
* parv[3] - Service Stamp (if mode == d)
|
||||
*/
|
||||
int m_svsmode(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
char *parv[];
|
||||
{
|
||||
int flag;
|
||||
int *s;
|
||||
char **p, *m;
|
||||
aClient *acptr;
|
||||
int what, setflags;
|
||||
|
||||
if (!IsULine(sptr))
|
||||
return 0;
|
||||
|
||||
what = MODE_ADD;
|
||||
|
||||
if (parc < 3)
|
||||
return 0;
|
||||
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
return 0;
|
||||
setflags = 0;
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (acptr->umodes & flag)
|
||||
setflags |= flag;
|
||||
/*
|
||||
* parse mode change string(s)
|
||||
*/
|
||||
for (p = &parv[2]; p && *p; p++)
|
||||
for (m = *p; *m; m++)
|
||||
switch (*m)
|
||||
{
|
||||
case '+':
|
||||
what = MODE_ADD;
|
||||
break;
|
||||
case '-':
|
||||
what = MODE_DEL;
|
||||
break;
|
||||
/* we may not get these,
|
||||
* but they shouldnt be in default
|
||||
*/
|
||||
case ' ':
|
||||
case '\n':
|
||||
case '\r':
|
||||
case '\t':
|
||||
break;
|
||||
case 'i':
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
IRCstats.invisible++;
|
||||
}
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
|
||||
IRCstats.invisible--;
|
||||
}
|
||||
goto setmodex;
|
||||
case 'o':
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators++;
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators--;
|
||||
goto setmodex;
|
||||
case 'd':
|
||||
if (parv[3] && isdigit(*parv[3]))
|
||||
{
|
||||
acptr->user->servicestamp =
|
||||
strtoul(parv[3], NULL, 10);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
setmodex:
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (*m == (char)(*(s + 1)))
|
||||
{
|
||||
if (what == MODE_ADD)
|
||||
acptr->umodes |= flag;
|
||||
else
|
||||
acptr->umodes &=
|
||||
~flag;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (parc > 3)
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVSMODE,
|
||||
TOK_SVSMODE, "%s %s %s", parv[1], parv[2], parv[3]);
|
||||
else
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVSMODE,
|
||||
TOK_SVSMODE, "%s %s", parv[1], parv[2]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* m_svs2mode() added by Potvin
|
||||
* parv[0] - sender
|
||||
* parv[1] - username to change mode for
|
||||
* parv[2] - modes to change
|
||||
* parv[3] - Service Stamp (if mode == d)
|
||||
*/
|
||||
int m_svs2mode(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
char *parv[];
|
||||
{
|
||||
int flag;
|
||||
int *s;
|
||||
char **p, *m;
|
||||
aClient *acptr;
|
||||
int what, setflags;
|
||||
char buf[BUFSIZE];
|
||||
|
||||
|
||||
if (!IsULine(sptr))
|
||||
return 0;
|
||||
|
||||
what = MODE_ADD;
|
||||
|
||||
if (parc < 3)
|
||||
return 0;
|
||||
setflags = 0;
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (acptr->umodes & flag)
|
||||
setflags |= flag;
|
||||
/*
|
||||
* parse mode change string(s)
|
||||
*/
|
||||
for (p = &parv[2]; p && *p; p++)
|
||||
for (m = *p; *m; m++)
|
||||
switch (*m)
|
||||
{
|
||||
case '+':
|
||||
what = MODE_ADD;
|
||||
break;
|
||||
case '-':
|
||||
what = MODE_DEL;
|
||||
break;
|
||||
/* we may not get these,
|
||||
* but they shouldnt be in default
|
||||
*/
|
||||
case ' ':
|
||||
case '\n':
|
||||
case '\r':
|
||||
case '\t':
|
||||
break;
|
||||
case 'd':
|
||||
if (parv[3] && (isdigit(*parv[3])))
|
||||
{
|
||||
acptr->user->servicestamp =
|
||||
strtoul(parv[3], NULL, 10);
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
IRCstats.invisible++;
|
||||
}
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
IRCstats.invisible--;
|
||||
}
|
||||
goto setmodey;
|
||||
case 'o':
|
||||
if (acptr->srvptr->flags & FLAGS_QUARANTINE)
|
||||
break;
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators++;
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators--;
|
||||
default:
|
||||
setmodey:
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (*m == (char)(*(s + 1)))
|
||||
{
|
||||
if (what == MODE_ADD)
|
||||
acptr->umodes |= flag;
|
||||
else
|
||||
acptr->umodes &=
|
||||
~flag;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (parc > 3)
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVS2MODE,
|
||||
TOK_SVS2MODE, "%s %s %s", parv[1], parv[2], parv[3]);
|
||||
else
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVS2MODE,
|
||||
TOK_SVS2MODE, "%s %s", parv[1], parv[2]);
|
||||
|
||||
send_umode(NULL, acptr, setflags, ALL_UMODES, buf);
|
||||
if (MyClient(acptr) && buf[0] && buf[1])
|
||||
sendto_one(acptr, ":%s MODE %s :%s", parv[0], parv[1], buf);
|
||||
return 0;
|
||||
}
|
||||
@@ -148,7 +148,6 @@ void init_CommandHash(void)
|
||||
add_Command(MSG_WATCH, TOK_WATCH, m_watch, 1);
|
||||
add_Command(MSG_USERHOST, TOK_USERHOST, m_userhost, 1);
|
||||
add_Command(MSG_SVSNICK, TOK_SVSNICK, m_svsnick, MAXPARA);
|
||||
add_Command(MSG_SVSMODE, TOK_SVSMODE, m_svsmode, MAXPARA);
|
||||
add_Command(MSG_LUSERS, TOK_LUSERS, m_lusers, MAXPARA);
|
||||
add_Command(MSG_IDENTIFY, TOK_IDENTIFY, m_identify, 1);
|
||||
add_Command(MSG_CHANSERV, TOK_CHANSERV, m_chanserv, 1);
|
||||
@@ -221,7 +220,6 @@ void init_CommandHash(void)
|
||||
add_Command(MSG_GLINE, TOK_GLINE, m_gline, MAXPARA);
|
||||
add_Command(MSG_REMGLINE, TOK_REMGLINE, m_remgline, MAXPARA);
|
||||
add_Command(MSG_DALINFO, TOK_DALINFO, m_dalinfo, MAXPARA);
|
||||
add_Command(MSG_SVS2MODE, TOK_SVS2MODE, m_svs2mode, MAXPARA);
|
||||
add_Command(MSG_MKPASSWD, TOK_MKPASSWD, m_mkpasswd, MAXPARA);
|
||||
add_Command(MSG_ADDLINE, TOK_ADDLINE, m_addline, 1);
|
||||
add_Command(MSG_ADMINCHAT, TOK_ADMINCHAT, m_admins, 1);
|
||||
|
||||
+1
-223
@@ -64,7 +64,7 @@ extern char *me_hash;
|
||||
extern ircstats IRCstats;
|
||||
extern char backupbuf[];
|
||||
static char buf[BUFSIZE], buf2[BUFSIZE];
|
||||
static int user_modes[] = { UMODE_OPER, 'o',
|
||||
int user_modes[] = { UMODE_OPER, 'o',
|
||||
UMODE_LOCOP, 'O',
|
||||
UMODE_INVISIBLE, 'i',
|
||||
UMODE_WALLOP, 'w',
|
||||
@@ -4653,228 +4653,6 @@ int m_umode2(cptr, sptr, parc, parv)
|
||||
m_umode(cptr, sptr, 3, xparv);
|
||||
}
|
||||
|
||||
/*
|
||||
* m_svs2mode() added by Potvin
|
||||
* parv[0] - sender
|
||||
* parv[1] - username to change mode for
|
||||
* parv[2] - modes to change
|
||||
* parv[3] - Service Stamp (if mode == d)
|
||||
*/
|
||||
int m_svs2mode(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
char *parv[];
|
||||
{
|
||||
int flag;
|
||||
int *s;
|
||||
char **p, *m;
|
||||
aClient *acptr;
|
||||
int what, setflags;
|
||||
|
||||
if (!IsULine(sptr))
|
||||
return 0;
|
||||
|
||||
what = MODE_ADD;
|
||||
|
||||
if (parc < 3)
|
||||
return 0;
|
||||
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
return 0;
|
||||
|
||||
setflags = 0;
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (acptr->umodes & flag)
|
||||
setflags |= flag;
|
||||
/*
|
||||
* parse mode change string(s)
|
||||
*/
|
||||
for (p = &parv[2]; p && *p; p++)
|
||||
for (m = *p; *m; m++)
|
||||
switch (*m)
|
||||
{
|
||||
case '+':
|
||||
what = MODE_ADD;
|
||||
break;
|
||||
case '-':
|
||||
what = MODE_DEL;
|
||||
break;
|
||||
/* we may not get these,
|
||||
* but they shouldnt be in default
|
||||
*/
|
||||
case ' ':
|
||||
case '\n':
|
||||
case '\r':
|
||||
case '\t':
|
||||
break;
|
||||
case 'l':
|
||||
if (parv[3] && isdigit(*parv[3]))
|
||||
max_global_count = atoi(parv[3]);
|
||||
break;
|
||||
case 'd':
|
||||
if (parv[3] && (isdigit(*parv[3])))
|
||||
{
|
||||
acptr->user->servicestamp =
|
||||
strtoul(parv[3], NULL, 10);
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
IRCstats.invisible++;
|
||||
}
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
IRCstats.invisible--;
|
||||
}
|
||||
goto setmodey;
|
||||
case 'o':
|
||||
if (acptr->srvptr->flags & FLAGS_QUARANTINE)
|
||||
break;
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators++;
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators--;
|
||||
default:
|
||||
setmodey:
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (*m == (char)(*(s + 1)))
|
||||
{
|
||||
if (what == MODE_ADD)
|
||||
acptr->umodes |= flag;
|
||||
else
|
||||
acptr->umodes &=
|
||||
~flag;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (parc > 3)
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVS2MODE,
|
||||
TOK_SVS2MODE, "%s %s %s", parv[1], parv[2], parv[3]);
|
||||
else
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVS2MODE,
|
||||
TOK_SVS2MODE, "%s %s", parv[1], parv[2]);
|
||||
|
||||
send_umode(NULL, acptr, setflags, ALL_UMODES, buf);
|
||||
if (MyClient(acptr) && buf[0] && buf[1])
|
||||
sendto_one(acptr, ":%s MODE %s :%s", parv[0], parv[1], buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* m_svsmode() added by taz
|
||||
* parv[0] - sender
|
||||
* parv[1] - username to change mode for
|
||||
* parv[2] - modes to change
|
||||
* parv[3] - Service Stamp (if mode == d)
|
||||
*/
|
||||
int m_svsmode(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
char *parv[];
|
||||
{
|
||||
int flag;
|
||||
int *s;
|
||||
char **p, *m;
|
||||
aClient *acptr;
|
||||
int what, setflags;
|
||||
|
||||
if (!IsULine(sptr))
|
||||
return 0;
|
||||
|
||||
what = MODE_ADD;
|
||||
|
||||
if (parc < 3)
|
||||
return 0;
|
||||
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
return 0;
|
||||
|
||||
setflags = 0;
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (acptr->umodes & flag)
|
||||
setflags |= flag;
|
||||
/*
|
||||
* parse mode change string(s)
|
||||
*/
|
||||
for (p = &parv[2]; p && *p; p++)
|
||||
for (m = *p; *m; m++)
|
||||
switch (*m)
|
||||
{
|
||||
case '+':
|
||||
what = MODE_ADD;
|
||||
break;
|
||||
case '-':
|
||||
what = MODE_DEL;
|
||||
break;
|
||||
/* we may not get these,
|
||||
* but they shouldnt be in default
|
||||
*/
|
||||
case ' ':
|
||||
case '\n':
|
||||
case '\r':
|
||||
case '\t':
|
||||
break;
|
||||
case 'i':
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
IRCstats.invisible++;
|
||||
}
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_INVISIBLE))
|
||||
{
|
||||
|
||||
IRCstats.invisible--;
|
||||
}
|
||||
goto setmodex;
|
||||
case 'o':
|
||||
if (what == MODE_ADD
|
||||
&& !(acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators++;
|
||||
if (what == MODE_DEL
|
||||
&& (acptr->umodes & UMODE_OPER))
|
||||
IRCstats.operators--;
|
||||
goto setmodex;
|
||||
case 'd':
|
||||
if (parv[3] && isdigit(*parv[3]))
|
||||
{
|
||||
acptr->user->servicestamp =
|
||||
strtoul(parv[3], NULL, 10);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
setmodex:
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
if (*m == (char)(*(s + 1)))
|
||||
{
|
||||
if (what == MODE_ADD)
|
||||
acptr->umodes |= flag;
|
||||
else
|
||||
acptr->umodes &=
|
||||
~flag;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (parc > 3)
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVSMODE,
|
||||
TOK_SVSMODE, "%s %s %s", parv[1], parv[2], parv[3]);
|
||||
else
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVSMODE,
|
||||
TOK_SVSMODE, "%s %s", parv[1], parv[2]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* send the MODE string for user (user) to connection cptr
|
||||
|
||||
Reference in New Issue
Block a user