mirror of
https://github.com/anope/anope.git
synced 2026-07-01 19:46:38 +02:00
Fix ratbox protocol to use TS6SID for sending (UN)RESV, and fix m_privmsg to correctly find the core pseudo-clients if the IRCd sends a UID instead of a nick.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2252 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+34
-25
@@ -165,32 +165,41 @@ int m_privmsg(const char *source, const char *receiver, const char *msg)
|
||||
|
||||
starttime = time(NULL);
|
||||
|
||||
if (!stricmp(receiver, s_OperServ)) {
|
||||
if (!is_oper(u) && OSOpersOnly) {
|
||||
notice_lang(s_OperServ, u, ACCESS_DENIED);
|
||||
if (WallBadOS)
|
||||
ircdproto->SendGlobops(s_OperServ,
|
||||
"Denied access to %s from %s!%s@%s (non-oper)",
|
||||
s_OperServ, u->nick, u->GetIdent().c_str(),
|
||||
u->host);
|
||||
} else {
|
||||
operserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
bi = findbot(receiver);
|
||||
|
||||
if (bi)
|
||||
{
|
||||
if (!stricmp(bi->nick, s_OperServ))
|
||||
{
|
||||
if (!is_oper(u) && OSOpersOnly)
|
||||
{
|
||||
notice_lang(s_OperServ, u, ACCESS_DENIED);
|
||||
if (WallBadOS)
|
||||
ircdproto->SendGlobops(s_OperServ, "Denied access to %s from %s!%s@%s (non-oper)", s_OperServ, u->nick, u->GetIdent().c_str(), u->host);
|
||||
}
|
||||
else
|
||||
operserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
}
|
||||
else if (!stricmp(bi->nick, s_NickServ))
|
||||
nickserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
else if (!stricmp(bi->nick, s_ChanServ))
|
||||
{
|
||||
if (!is_oper(u) && CSOpersOnly)
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
else
|
||||
chanserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
}
|
||||
else if (!stricmp(bi->nick, s_MemoServ))
|
||||
memoserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
else if (s_HostServ && !stricmp(bi->nick, s_HostServ))
|
||||
hostserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
else if (s_BotServ)
|
||||
{
|
||||
if (!stricmp(bi->nick, s_BotServ))
|
||||
botserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
else
|
||||
botmsgs(u, bi, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
}
|
||||
} else if (!stricmp(receiver, s_NickServ)) {
|
||||
nickserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
} else if (!stricmp(receiver, s_ChanServ)) {
|
||||
if (!is_oper(u) && CSOpersOnly)
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
else
|
||||
chanserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
} else if (!stricmp(receiver, s_MemoServ)) {
|
||||
memoserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
} else if (s_HostServ && !stricmp(receiver, s_HostServ)) {
|
||||
hostserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
} else if (s_BotServ && !stricmp(receiver, s_BotServ)) {
|
||||
botserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
} else if (s_BotServ && (bi = findbot(receiver))) {
|
||||
botmsgs(u, bi, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
}
|
||||
|
||||
/* Add to ignore list if the command took a significant amount of time. */
|
||||
|
||||
@@ -521,8 +521,7 @@ class RatboxProto : public IRCDTS6Proto
|
||||
|
||||
void SendSQLine(const char *mask, const char *reason)
|
||||
{
|
||||
BotInfo *bi = findbot(s_OperServ);
|
||||
send_cmd(bi ? bi->uid : s_OperServ, "RESV * %s :%s", mask, reason);
|
||||
send_cmd(TS6SID, "RESV * %s :%s", mask, reason);
|
||||
}
|
||||
|
||||
void SendSGLineDel(const char *mask)
|
||||
@@ -545,8 +544,7 @@ class RatboxProto : public IRCDTS6Proto
|
||||
|
||||
void SendSQLineDel(const char *user)
|
||||
{
|
||||
BotInfo *bi = findbot(s_OperServ);
|
||||
send_cmd(bi ? bi->uid : s_OperServ, "UNRESV * %s", user);
|
||||
send_cmd(TS6SID, "UNRESV * %s", user);
|
||||
}
|
||||
|
||||
void SendJoin(BotInfo *user, const char *channel, time_t chantime)
|
||||
|
||||
Reference in New Issue
Block a user