mirror of
https://github.com/anope/anope.git
synced 2026-06-30 15:26:38 +02:00
BUILD : 1.7.10 (824) BUGS : 389 NOTES : Added the possibility for protocol files to override the code setting mod_current_buffer, which is needed for InspIRCd
git-svn-id: svn://svn.anope.org/anope/trunk@824 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@577 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
e0cba0bb71
commit
ca25d6e252
@@ -1,6 +1,7 @@
|
||||
Anope Version S V N
|
||||
--------------------
|
||||
Provided by Anope Dev. <dev@anope.org> - 2005
|
||||
06/03 A Protocol files can now fill mod_current_buffer with custom code. [#389]
|
||||
06/03 F Moved checks for UseTokens, UseTS6, and Numeric. [#385]
|
||||
06/03 F Load protocol module before launching listnicks/listchans. [#391]
|
||||
05/29 F operserv opernews dispalys the correct help now. [#386]
|
||||
|
||||
@@ -583,6 +583,7 @@ E int init(int ac, char **av);
|
||||
E int servernum;
|
||||
|
||||
/**** ircd.c ****/
|
||||
E void pmodule_set_mod_current_buffer(void (*func) (int ac, char **av));
|
||||
E void pmodule_cmd_svsnoop(void (*func) (char *server, int set));
|
||||
E void pmodule_cmd_remove_akill(void (*func) (char *user, char *host));
|
||||
E void pmodule_cmd_topic(void (*func) (char *whosets, char *chan, char *whosetit, char *topic, time_t when));
|
||||
|
||||
@@ -1093,6 +1093,7 @@ struct session_ {
|
||||
* functions, we then call the correct function for the anope_ commands.
|
||||
**/
|
||||
typedef struct ircd_proto_ {
|
||||
void (*ircd_set_mod_current_buffer)(int ac, char **av);
|
||||
void (*ircd_cmd_svsnoop)(char *server, int set);
|
||||
void (*ircd_cmd_remove_akill)(char *user, char *host);
|
||||
void (*ircd_cmd_topic)(char *whosets, char *chan, char *whosetit, char *topic, time_t when);
|
||||
|
||||
+17
@@ -24,6 +24,7 @@ int UseTSMODE;
|
||||
**/
|
||||
void initIrcdProto()
|
||||
{
|
||||
ircdproto.ircd_set_mod_current_buffer = NULL;
|
||||
ircdproto.ircd_set_umode = NULL;
|
||||
ircdproto.ircd_cmd_svsnoop = NULL;
|
||||
ircdproto.ircd_cmd_remove_akill = NULL;
|
||||
@@ -96,6 +97,17 @@ void initIrcdProto()
|
||||
ircdproto.ircd_cmd_ctcp = NULL;
|
||||
}
|
||||
|
||||
/* Special function, returns 1 if executed, 0 if not */
|
||||
int anope_set_mod_current_buffer(int ac, char **av)
|
||||
{
|
||||
if (ircdproto.ircd_set_mod_current_buffer) {
|
||||
ircdproto.ircd_set_mod_current_buffer(ac, av);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void anope_set_umode(User * user, int ac, char **av)
|
||||
{
|
||||
ircdproto.ircd_set_umode(user, ac, av);
|
||||
@@ -601,6 +613,11 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
* Set routines for modules to set the prefered function for dealing with things.
|
||||
**/
|
||||
|
||||
void pmodule_set_mod_current_buffer(void (*func) (int ac, char **av))
|
||||
{
|
||||
ircdproto.ircd_set_mod_current_buffer = func;
|
||||
}
|
||||
|
||||
void pmodule_cmd_svsnoop(void (*func) (char *server, int set))
|
||||
{
|
||||
ircdproto.ircd_cmd_svsnoop = func;
|
||||
|
||||
+10
-7
@@ -248,18 +248,21 @@ void process()
|
||||
to the NICK and thus AV[0] is the message. The new logic is to check
|
||||
av[0] to see if its a service nick if so assign mod_current_buffer the
|
||||
value from AV[1] else just assign av[0] - TSL */
|
||||
if (av[0]) {
|
||||
if (nickIsServices(av[0], 1)) {
|
||||
if (av[1]) {
|
||||
mod_current_buffer = sstrdup(av[1]);
|
||||
/* First check if the ircd proto module overrides this -GD */
|
||||
if (!anope_set_mod_current_buffer(ac, av)) {
|
||||
if (av[0]) {
|
||||
if (nickIsServices(av[0], 1)) {
|
||||
if (av[1]) {
|
||||
mod_current_buffer = sstrdup(av[1]);
|
||||
} else {
|
||||
mod_current_buffer = sstrdup(av[0]);
|
||||
}
|
||||
} else {
|
||||
mod_current_buffer = sstrdup(av[0]);
|
||||
}
|
||||
} else {
|
||||
mod_current_buffer = sstrdup(av[0]);
|
||||
mod_current_buffer = NULL;
|
||||
}
|
||||
} else {
|
||||
mod_current_buffer = NULL;
|
||||
}
|
||||
/* Do something with the message. */
|
||||
m = find_message(cmd);
|
||||
|
||||
@@ -421,6 +421,15 @@ void inspircd_set_umode(User * user, int ac, char **av)
|
||||
}
|
||||
}
|
||||
|
||||
/* Set mod_current_buffer from here */
|
||||
void inspircd_set_mod_current_buffer(int ac, char **av)
|
||||
{
|
||||
if (ac >= 3)
|
||||
mod_current_buffer = sstrdup(av[2]);
|
||||
else
|
||||
mod_current_buffer = NULL;
|
||||
}
|
||||
|
||||
int anope_event_nickchange(char *source, int ac, char **av);
|
||||
int anope_event_servertopic(char *source, int ac, char **av);
|
||||
int anope_event_servermode(char *source, int ac, char **av);
|
||||
@@ -1424,6 +1433,7 @@ void inspircd_cmd_ctcp(char *source, char *dest, char *buf)
|
||||
* These prototypes must match what anope expects.
|
||||
**/
|
||||
void moduleAddAnopeCmds() {
|
||||
pmodule_set_mod_current_buffer(inspircd_set_mod_current_buffer);
|
||||
pmodule_cmd_svsnoop(inspircd_cmd_svsnoop);
|
||||
pmodule_cmd_remove_akill(inspircd_cmd_remove_akill);
|
||||
pmodule_cmd_topic(inspircd_cmd_topic);
|
||||
|
||||
+5
-1
@@ -8,10 +8,14 @@
|
||||
VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="10"
|
||||
VERSION_BUILD="823"
|
||||
VERSION_BUILD="824"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.10 (824)
|
||||
# BUGS : 389
|
||||
# NOTES : Added the possibility for protocol files to override the code setting mod_current_buffer, which is needed for InspIRCd
|
||||
#
|
||||
# BUILD : 1.7.10 (823)
|
||||
# BUGS : 385 391
|
||||
# NOTES : Moved checks for UseTokens, UseTS6, and Numeric into protocol_module_init because they need the ircd struct, and split init() into two functions to load the protocol module for listnicks/listchans.
|
||||
|
||||
Reference in New Issue
Block a user