1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 01:36:38 +02:00

BUILD : 1.7.6 (469) BUGS : N/A NOTES : 1. ultimate3 setting the wrong channel mode on botserv bots 2. helpserv.c is doxygen ready, did some code clean up 3. Services Clients (+S) now override channel modes (yeah no more deopping NeoStats), this only works on ircds where there is a clear services mode (Unreal, Viagra, Ultimeate2/3) 4. send.c is doxygen ready, did some code clean up 5. commands.c id doxygen ready, did some code clean up

git-svn-id: svn://svn.anope.org/anope/trunk@469 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@323 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-12-03 06:07:44 +00:00
parent f18d506cad
commit 1aaeba38f4
18 changed files with 266 additions and 59 deletions
+2
View File
@@ -8,6 +8,7 @@ Provided by Anope Dev. <dev@anope.org> - 2004
11/19 F Wrong string and missing registered nick check in bot change. [#221]
Provided by Trystan <trystan@nomadirc.net> - 2004
12/02 A Support for +S (services clients) mode to override channel modes [ #00]
11/28 A Support for Unreal's version of SVSHOLD [ #00]
11/28 A /OS SET LIST to list the set options [ #00]
11/27 A Solid IRCD support (Solid IRCD 3.4.6 or later) [ #00]
@@ -17,6 +18,7 @@ Provided by Trystan <trystan@nomadirc.net> - 2004
11/21 A Opened SGLINE to all ircd that support GEOS bans [ #00]
11/21 A Opened SZLINE to all ircd that support ZLINE's [ #00]
11/19 A Added anope_cmd_ctcp() to code API, for sending CTCP messages. [ #00]
12/02 F Ultimate3 botserv bots were getting wrong modes [ #00]
12/01 F ChanServ AKICK DEL (reordering) (pointed to freed memory) [ #00]
12/01 F del_session() warning messages when LimitSessions is disabled [ #00]
11/28 F NSSecureAdmins now restricts /NS SET EMAIL [#218]
+3
View File
@@ -258,6 +258,8 @@ struct ircdvars_ {
int invitemode; /* +I */
int sjoinbanchar; /* use single quotes to define it */
int sjoinexchar; /* use single quotes to define it */
uint32 servicesmode; /* Services Mode +S */
int p10; /* P10 ircd */
};
struct ircdcapab_ {
@@ -305,6 +307,7 @@ struct ircdcapab_ {
#define NICK_VERSION 13
#define PRE_NICK_VERSION 1
#define OPER_VERSION 13
#define HELP_VERSION 1
/*************************************************************************/
+2
View File
@@ -102,6 +102,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
0, /* Services Client mode */
0, /* not p10 */
}
,
{NULL}
+13
View File
@@ -235,6 +235,19 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
mode, chan->name, user->nick);
if (add) {
/*
Okay everyones biggest complaint is that NeoStats or any other
services clients are flagged as services but we still strip their
channel modes when strict is enabled. This lets them keep the mode and
we update our internal user/channel struct - TSL
*/
if (ircd->servicesmode) {
if (user->mode & ircd->servicesmode) {
chan_remove_user_status(chan, user, cum->status);
continue;
}
}
/* Fixes bug #68
- might be a bit ugly but it works, the idea is that since the
is_valid function strips out all of the modes there is no point
+66 -8
View File
@@ -18,33 +18,53 @@
/*************************************************************************/
/* Return the Command corresponding to the given name, or NULL if no such
/**
* Return the Command corresponding to the given name, or NULL if no such
* command exists.
* @param list Command struct
* @param cmd Command to look up
* @return Command Struct for the given cmd
*/
Command *lookup_cmd(Command * list, char *cmd)
{
Command *c;
for (c = list; c->name; c++) {
if (stricmp(c->name, cmd) == 0)
if (stricmp(c->name, cmd) == 0) {
return c;
}
}
return NULL;
}
/*************************************************************************/
/* Run the routine for the given command, if it exists and the user has
/**
* Run the routine for the given command, if it exists and the user has
* privilege to do so; if not, print an appropriate error message.
* @param services Services Client
* @param u User Struct
* @param list Command struct
* @param cmd Command
* @return void
*/
void run_cmd(char *service, User * u, Command * list, char *cmd)
{
Command *c = lookup_cmd(list, cmd);
do_run_cmd(service, u, c, cmd);
}
/*************************************************************************/
/**
* Run the routine for the given command, if it exists and the user has
* privilege to do so; if not, print an appropriate error message.
* @param services Services Client
* @param u User Struct
* @param Command Hash Table
* @param cmd Command
* @return void
*/
void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[],
const char *cmd)
{
@@ -52,6 +72,17 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[],
do_run_cmd(service, u, c, cmd);
}
/*************************************************************************/
/**
* Run the given command
* @param services Services Client
* @param u User Struct
* @param c Command Struct
* @param cmd Command
* @return void
*/
void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
{
int retVal = 0;
@@ -86,15 +117,22 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
}
}
} else {
if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u))
if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u)) {
notice_lang(service, u, UNKNOWN_COMMAND_HELP, cmd, service);
}
}
}
/*************************************************************************/
/* Print a help message for the given command. */
/**
* Print a help message for the given command.
* @param services Services Client
* @param u User Struct
* @param c Command Struct
* @param cmd Command
* @return void
*/
void do_help_cmd(char *service, User * u, Command * c, const char *cmd)
{
Command *current;
@@ -158,12 +196,32 @@ void do_help_cmd(char *service, User * u, Command * c, const char *cmd)
}
}
/*************************************************************************/
/**
* Find the Help Command
* @param services Services Client
* @param u User Struct
* @param c Command Struct
* @param cmd Command
* @return void
*/
void help_cmd(char *service, User * u, Command * list, char *cmd)
{
Command *c = lookup_cmd(list, cmd);
do_help_cmd(service, u, c, cmd);
}
/*************************************************************************/
/**
* Find the Help Command
* @param services Services Client
* @param u User Struct
* @param Command Hash Table
* @param cmd Command
* @return void
*/
void mod_help_cmd(char *service, User * u, CommandHash * cmdTable[],
const char *cmd)
{
+2
View File
@@ -100,6 +100,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
0, /* Services Client mode */
0, /* not p10 */
}
,
{NULL}
+28 -12
View File
@@ -16,13 +16,15 @@
#include "services.h"
#include "pseudo.h"
#define HELP_VERSION 1
void helpserv_init(void);
static int do_help(User * u);
void moduleAddHelpServCmds(void);
/*************************************************************************/
/**
* Setup the commands for HelpServ
* @return void
*/
void moduleAddHelpServCmds(void)
{
Command *c;
@@ -32,15 +34,23 @@ void moduleAddHelpServCmds(void)
/*************************************************************************/
/*************************************************************************/
/* HelpServ initialization. */
/**
* HelpServ initialization.
* @return void
*/
void helpserv_init(void)
{
moduleAddHelpServCmds();
}
/*************************************************************************/
/* Main HelpServ routine. */
/**
* Main HelpServ routine.
* @param u User Struct of the user sending the PRIVMSG
* @param buf Buffer containing the PRIVMSG data
* @return void
*/
void helpserv(User * u, char *buf)
{
char *cmd, *s;
@@ -60,11 +70,15 @@ void helpserv(User * u, char *buf)
}
/*************************************************************************/
/* Display the HelpServ help. */
/* This core function has been embed in the source for a long time, but */
/* it moved into it's own file so we now all can enjoy the joy of */
/* modules for HelpServ. */
/**
* Display the HelpServ help.
* This core function has been embed in the source for a long time, but
* it moved into it's own file so we now all can enjoy the joy of
* modules for HelpServ.
* @param u User Struct of the user looking for help
* @return MOD_CONT
*/
static int do_help(User * u)
{
char *cmd = strtok(NULL, "");
@@ -72,10 +86,12 @@ static int do_help(User * u)
if (!cmd) {
notice_help(s_HelpServ, u, HELP_HELP, s_NickServ, s_ChanServ,
s_MemoServ);
if (s_BotServ)
if (s_BotServ) {
notice_help(s_HelpServ, u, HELP_HELP_BOT, s_BotServ);
if (s_HostServ)
}
if (s_HostServ) {
notice_help(s_HelpServ, u, HELP_HELP_HOST, s_HostServ);
}
moduleDisplayHelp(7, u);
} else {
mod_help_cmd(s_HelpServ, u, HELPSERV, cmd);
+2
View File
@@ -100,6 +100,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
0, /* Services Client mode */
0, /* not p10 */
}
,
{NULL}
+2
View File
@@ -100,6 +100,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
0, /* Services Client mode */
0, /* not p10 */
}
,
{NULL}
+2
View File
@@ -101,6 +101,8 @@ IRCDVar ircd[] = {
1, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
0, /* Services Client mode */
0, /* not p10 */
},
{NULL}
};
+94 -16
View File
@@ -16,9 +16,14 @@
/*************************************************************************/
/* Send a command to the server. The two forms here are like
* printf()/vprintf() and friends. */
/**
* Send a command to the server. The two forms here are like
* printf()/vprintf() and friends.
* @param source Orgin of the Message (some times NULL)
* @param fmt Format of the Message
* @param ... any number of parameters
* @return void
*/
void send_cmd(const char *source, const char *fmt, ...)
{
va_list args;
@@ -30,6 +35,15 @@ void send_cmd(const char *source, const char *fmt, ...)
}
}
/*************************************************************************/
/**
* actually Send a command to the server.
* @param source Orgin of the Message (some times NULL)
* @param fmt Format of the Message
* @param args List of the arguments
* @return void
*/
void vsend_cmd(const char *source, const char *fmt, va_list args)
{
char buf[BUFSIZE];
@@ -44,18 +58,28 @@ void vsend_cmd(const char *source, const char *fmt, va_list args)
if (source) {
sockprintf(servsock, ":%s %s\r\n", source, buf);
if (debug)
if (debug) {
alog("debug: Sent: :%s %s", source, buf);
}
} else {
sockprintf(servsock, "%s\r\n", buf);
if (debug)
if (debug) {
alog("debug: Sent: %s", buf);
}
}
}
}
/*************************************************************************/
/**
* Send a server notice
* @param source Orgin of the Message
* @param s Server Struct
* @param fmt Format of the Message
* @param ... any number of parameters
* @return void
*/
void notice_server(char *source, Server * s, char *fmt, ...)
{
va_list args;
@@ -67,6 +91,7 @@ void notice_server(char *source, Server * s, char *fmt, ...)
vsnprintf(buf, BUFSIZE - 1, fmt, args);
if (!buf) {
va_end(args);
return;
}
@@ -81,6 +106,14 @@ void notice_server(char *source, Server * s, char *fmt, ...)
/*************************************************************************/
/**
* Send a notice to a user
* @param source Orgin of the Message
* @param u User Struct
* @param fmt Format of the Message
* @param ... any number of parameters
* @return void
*/
void notice_user(char *source, User * u, const char *fmt, ...)
{
va_list args;
@@ -92,6 +125,7 @@ void notice_user(char *source, User * u, const char *fmt, ...)
vsnprintf(buf, BUFSIZE - 1, fmt, args);
if (!buf) {
va_end(args);
return;
}
@@ -106,7 +140,13 @@ void notice_user(char *source, User * u, const char *fmt, ...)
/*************************************************************************/
/* Send a NULL-terminated array of text as NOTICEs. */
/**
* Send a NULL-terminated array of text as NOTICEs.
* @param source Orgin of the Message
* @param dest Destination of the Notice
* @param text Array of text to send
* @return void
*/
void notice_list(char *source, char *dest, char **text)
{
while (*text) {
@@ -114,25 +154,34 @@ void notice_list(char *source, char *dest, char **text)
* no text, it is ignored, so we replace blank lines by lines
* with a single space.
*/
if (**text)
if (**text) {
anope_cmd_notice2(source, dest, *text);
else
} else {
anope_cmd_notice2(source, dest, " ");
}
text++;
}
}
/*************************************************************************/
/* Send a message in the user's selected language to the user using NOTICE. */
/**
* Send a message in the user's selected language to the user using NOTICE.
* @param source Orgin of the Message
* @param u User Struct
* @param int Index of the Message
* @param ... any number of parameters
* @return void
*/
void notice_lang(char *source, User * dest, int message, ...)
{
va_list args;
char buf[4096]; /* because messages can be really big */
char *s, *t;
const char *fmt;
if (!dest || !message)
if (!dest || !message) {
return;
}
va_start(args, message);
fmt = getstring(dest->na, message);
if (!fmt)
@@ -156,9 +205,15 @@ void notice_lang(char *source, User * dest, int message, ...)
/*************************************************************************/
/* Like notice_lang(), but replace %S by the source. This is an ugly hack
/**
* Like notice_lang(), but replace %S by the source. This is an ugly hack
* to simplify letting help messages display the name of the pseudoclient
* that's sending them.
* @param source Orgin of the Message
* @param u User Struct
* @param int Index of the Message
* @param ... any number of parameters
* @return void
*/
void notice_help(char *source, User * dest, int message, ...)
{
@@ -167,8 +222,9 @@ void notice_help(char *source, User * dest, int message, ...)
char *s, *t;
const char *fmt;
if (!dest || !message)
if (!dest || !message) {
return;
}
va_start(args, message);
fmt = getstring(dest->na, message);
if (!fmt)
@@ -198,7 +254,14 @@ void notice_help(char *source, User * dest, int message, ...)
/*************************************************************************/
/* Send a NOTICE from the given source to the given nick. */
/**
* Send a NOTICE from the given source to the given nick.
* @param source Orgin of the Message
* @param dest Destination of the Message
* @param fmt Format of the Message
* @param ... any number of parameters
* @return void
*/
void notice(char *source, char *dest, const char *fmt, ...)
{
va_list args;
@@ -210,6 +273,7 @@ void notice(char *source, char *dest, const char *fmt, ...)
vsnprintf(buf, BUFSIZE - 1, fmt, args);
if (!buf) {
va_end(args);
return;
}
@@ -224,7 +288,14 @@ void notice(char *source, char *dest, const char *fmt, ...)
/*************************************************************************/
/* Send a PRIVMSG from the given source to the given nick. */
/**
* Send a PRIVMSG from the given source to the given nick.
* @param source Orgin of the Message
* @param dest Destination of the Message
* @param fmt Format of the Message
* @param ... any number of parameters
* @return void
*/
void privmsg(char *source, char *dest, const char *fmt, ...)
{
va_list args;
@@ -243,8 +314,15 @@ void privmsg(char *source, char *dest, const char *fmt, ...)
anope_cmd_privmsg2(source, dest, buf);
}
/* cause #defines just bitched to much, its back and hooks to
a legacy in the ircd protocol files - TSL */
/*************************************************************************/
/**
* Send out a WALLOP, this is here for legacy only, same day we will pull it out
* @param source Orgin of the Message
* @param fmt Format of the Message
* @param ... any number of parameters
* @return void
*/
void wallops(char *source, const char *fmt, ...)
{
va_list args;
+2
View File
@@ -102,6 +102,8 @@ IRCDVar ircd[] = {
1, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
0, /* Services Client mode */
0, /* not p10 */
}
,
{NULL}
+4 -4
View File
@@ -100,6 +100,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
UMODE_S, /* Services Client mode */
0, /* not p10 */
}
,
{NULL}
@@ -194,22 +196,20 @@ void anope_set_umode(User * user, int ac, char **av)
case 'o':
if (add) {
opcnt++;
if (WallOper)
if (WallOper) {
anope_cmd_global(s_OperServ,
"\2%s\2 is now an IRC operator.",
user->nick);
}
display_news(user, NEWS_OPER);
if (is_services_oper(user)) {
common_svsmode(user, "+a", NULL);
user->mode |= UMODE_a;
}
if (is_services_admin(user)) {
common_svsmode(user, "+P", NULL);
user->mode |= UMODE_P;
}
if (is_services_root(user)) {
common_svsmode(user, "+R", NULL);
user->mode |= UMODE_R;
+9 -9
View File
@@ -48,7 +48,7 @@ IRCDVar ircd[] = {
"+S", /* Used by BotServ Bots */
5, /* Chan Max Symbols */
"-ilmnpqstRKAO", /* Modes to Remove */
"+ao", /* Channel Umode used by Botserv bots */
"+o", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
0, /* Has Owner */
@@ -102,6 +102,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
UMODE_S, /* Services Client mode */
0, /* not p10 */
},
{NULL}
};
@@ -194,25 +196,23 @@ void anope_set_umode(User * user, int ac, char **av)
case 'o':
if (add) {
opcnt++;
if (WallOper)
if (WallOper) {
anope_cmd_global(s_OperServ,
"\2%s\2 is now an IRC operator.",
user->nick);
}
display_news(user, NEWS_OPER);
if (is_services_oper(user)) {
send_cmd(ServerName, "SVSMODE %s +a", user->nick);
common_svsmode(user, "+a", NULL);
user->mode |= UMODE_a;
}
if (is_services_admin(user)) {
send_cmd(ServerName, "SVSMODE %s +P", user->nick);
common_svsmode(user, "+P", NULL);
user->mode |= UMODE_P;
}
if (is_services_root(user)) {
send_cmd(ServerName, "SVSMODE %s +Z", user->nick);
user->mode |= UMODE_Z;
common_svsmode(user, "+R", NULL);
user->mode |= UMODE_R;
}
} else {
opcnt--;
+4 -2
View File
@@ -103,6 +103,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
UMODE_S, /* Services Client mode */
0, /* not p10 */
},
{NULL}
};
@@ -394,11 +396,11 @@ void anope_set_umode(User * user, int ac, char **av)
case 'o':
if (add) {
opcnt++;
if (WallOper)
if (WallOper) {
anope_cmd_global(s_OperServ,
"\2%s\2 is now an IRC operator.",
user->nick);
}
display_news(user, NEWS_OPER);
} else {
opcnt--;
+17 -5
View File
@@ -102,6 +102,8 @@ IRCDVar ircd[] = {
0, /* +I support */
'&', /* SJOIN ban char */
'\"', /* SJOIN except char */
UMODE_S, /* Services Client mode */
0, /* not p10 */
},
{NULL}
};
@@ -429,11 +431,21 @@ void anope_set_umode(User * user, int ac, char **av)
if (add) {
opcnt++;
if (WallOper)
anope_cmd_global(s_OperServ,
"\2%s\2 is now an IRC operator.",
user->nick);
display_news(user, NEWS_OPER);
/* No need to display news to a services client */
if (user->mode & ircd->servicesmode) {
if (WallOper) {
anope_cmd_global(s_OperServ,
"\2%s\2 is now a Network Service.",
user->nick);
}
} else {
if (WallOper) {
anope_cmd_global(s_OperServ,
"\2%s\2 is now an IRC operator.",
user->nick);
}
display_news(user, NEWS_OPER);
}
} else {
opcnt--;
}
+4 -2
View File
@@ -100,6 +100,8 @@ IRCDVar ircd[] = {
0, /* +I support */
0, /* SJOIN ban char */
0, /* SJOIN except char */
UMODE_S, /* Services Client mode */
0, /* not p10 */
}
,
{NULL}
@@ -179,11 +181,11 @@ void anope_set_umode(User * user, int ac, char **av)
case 'o':
if (add) {
opcnt++;
if (WallOper)
if (WallOper) {
anope_cmd_global(s_OperServ,
"\2%s\2 is now an IRC operator.",
user->nick);
}
display_news(user, NEWS_OPER);
} else {
opcnt--;
+10 -1
View File
@@ -8,10 +8,19 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="6"
VERSION_BUILD="468"
VERSION_BUILD="469"
# $Log$
#
# BUILD : 1.7.6 (469)
# BUGS : N/A
# NOTES : 1. ultimate3 setting the wrong channel mode on botserv bots
# 2. helpserv.c is doxygen ready, did some code clean up
# 3. Services Clients (+S) now override channel modes (yeah no more deopping NeoStats), this only
# works on ircds where there is a clear services mode (Unreal, Viagra, Ultimeate2/3)
# 4. send.c is doxygen ready, did some code clean up
# 5. commands.c id doxygen ready, did some code clean up
#
# BUILD : 1.7.6 (468)
# BUGS : N/A
# NOTES : 1. fixes del_session() warning when LimitSessions is disabled