summaryrefslogtreecommitdiff
path: root/src/protocol/inspircd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/inspircd.c')
-rw-r--r--src/protocol/inspircd.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/protocol/inspircd.c b/src/protocol/inspircd.c
index a4f320a86..3d51f1513 100644
--- a/src/protocol/inspircd.c
+++ b/src/protocol/inspircd.c
@@ -451,6 +451,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
m = createMessage("NOTICE", anope_event_null); addCoreMessage(IRCD,m);
+ m = createMessage("CAPAB", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
@@ -509,7 +510,7 @@ void inspircd_cmd_remove_akill(char *user, char *host)
void inspircd_cmd_topic(char *whosets, char *chan, char *whosetit,
char *topic, time_t when)
{
- send_cmd(ServerName, "FTOPIC %s %lu %s :%s", chan, (unsigned long int) when, whosetit, topic);
+ send_cmd(whosets, "FTOPIC %s %lu %s :%s", chan, (unsigned long int) when, whosetit, topic);
}
void inspircd_cmd_vhost_off(User * u)
@@ -566,7 +567,7 @@ void inspircd_cmd_376(char *source)
void inspircd_cmd_nick(char *nick, char *name, char *modes)
{
- // :test.chatspike.net NICK 1133519355 Brain synapse.brainbox.winbot.co.uk netadmin.chatspike.net ~brain +xwsioS 10.0.0.2 :Craig Edwards
+ /* :test.chatspike.net NICK 1133519355 Brain synapse.brainbox.winbot.co.uk netadmin.chatspike.net ~brain +xwsioS 10.0.0.2 :Craig Edwards */
send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s",(long int) time(NULL),nick,ServiceHost,ServiceHost,ServiceUser,modes,name);
send_cmd(ServerName, "OPERTYPE Service");
}
@@ -616,10 +617,15 @@ int anope_event_opertype(char* source, int ac, char**av)
{
/* opertype is equivalent to mode +o because servers
dont do this directly */
- char* newav[2];
- newav[0] = source;
- newav[1] = "+o";
- return anope_event_mode(source, 2, newav);
+ User* u;
+ u = finduser(source);
+ if (u && !is_oper(u)) {
+ char* newav[2];
+ newav[0] = source;
+ newav[1] = "+o";
+ return anope_event_mode(source, 2, newav);
+ }
+ else return MOD_CONT;
}
int anope_event_fmode(char *source, int ac, char **av)
@@ -1043,7 +1049,8 @@ void inspircd_cmd_svsnick(char *source, char *guest, time_t when)
if (!source || !guest) {
return;
}
- send_cmd(s_OperServ, "SANICK %s %s", source, guest);
+ /* Please note that inspircd will now echo back a nickchange for this SVSNICK */
+ send_cmd(ServerName, "SVSNICK %s %s :%lu", source, guest, (unsigned long)when);
}
/* Functions that use serval cmd functions */
@@ -1061,9 +1068,6 @@ void inspircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
void inspircd_cmd_connect(int servernum)
{
- me_server =
- new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
-
if (servernum == 1) {
inspircd_cmd_pass(RemotePassword);
}
@@ -1076,6 +1080,9 @@ void inspircd_cmd_connect(int servernum)
inspircd_cmd_server(ServerName, 0, ServerDesc);
send_cmd(NULL,"BURST");
send_cmd(ServerName, "VERSION :Anope-%s %s :%s - %s -- %s", version_number, ServerName, ircd->name, version_flags, version_build);
+
+ me_server =
+ new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
}
/* Events */
@@ -1320,11 +1327,11 @@ int anope_event_nick(char *source, int ac, char **av)
if (ac != 1) {
if (ac == 8) {
inet_aton(av[6],&addy);
- user = do_nick("", av[1], // nick
- av[4], // username
- av[2], // realhost
- source, // server
- av[7], // realname
+ user = do_nick("", av[1], /* nick */
+ av[4], /* username */
+ av[2], /* realhost */
+ source, /* server */
+ av[7], /* realname */
strtoul(av[0], NULL, 10),
0,
htonl(*ad),
@@ -1621,7 +1628,7 @@ void moduleAddAnopeCmds()
pmodule_cmd_connect(inspircd_cmd_connect);
pmodule_cmd_svshold(inspircd_cmd_svshold);
pmodule_cmd_release_svshold(inspircd_cmd_release_svshold);
- pmodule_cmd_unsgline(inspircd_cmd_unsgline);
+ pmodule_cmd_unsgline(inspircd_cmd_unsqline);
pmodule_cmd_unszline(inspircd_cmd_unszline);
pmodule_cmd_szline(inspircd_cmd_szline);
pmodule_cmd_sgline(inspircd_cmd_sgline);