summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-26 22:57:51 -0500
committerAdam <Adam@anope.org>2012-11-26 23:09:26 -0500
commit8a6962fc363410928dc8d7c197fd3fbf3e315597 (patch)
tree7eac6e127be5e4b691e96a1053f114870cc449aa /modules
parentf23bad140b3abf3350c552c27c4e1d995337ce79 (diff)
Keep track on what ircds we can svsjoin, add an svspart method
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/ns_ajoin.cpp5
-rw-r--r--modules/commands/ns_recover.cpp4
-rw-r--r--modules/protocol/inspircd11.cpp13
-rw-r--r--modules/protocol/inspircd12.cpp12
-rw-r--r--modules/protocol/inspircd20.cpp4
-rw-r--r--modules/protocol/plexus.cpp10
-rw-r--r--modules/protocol/unreal.cpp21
7 files changed, 52 insertions, 17 deletions
diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp
index 54e37ad36..ce92582f6 100644
--- a/modules/commands/ns_ajoin.cpp
+++ b/modules/commands/ns_ajoin.cpp
@@ -233,6 +233,9 @@ class NSAJoin : public Module
{
this->SetAuthor("Anope");
+ if (!IRCD->CanSVSJoin)
+ throw ModuleException("Your IRCd does not support SVSJOIN");
+
Implementation i[] = { I_OnNickIdentify };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
}
@@ -317,7 +320,7 @@ class NSAJoin : public Module
IRCD->SendInvite(NickServ, c, u);
}
- IRCD->SendSVSJoin(NickServ, u->nick, entry->channel, key);
+ IRCD->SendSVSJoin(NickServ, u, entry->channel, key);
}
}
};
diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp
index 287224a1b..419857eee 100644
--- a/modules/commands/ns_recover.cpp
+++ b/modules/commands/ns_recover.cpp
@@ -243,8 +243,8 @@ class NSRecover : public Module
/* User might already be on the channel */
if (u->FindChannel(c))
this->OnJoinChannel(u, c);
- else
- IRCD->SendSVSJoin(NickServ, u->GetUID(), cname, "");
+ else if (IRCD->CanSVSJoin)
+ IRCD->SendSVSJoin(NickServ, u, cname, "");
}
}
}
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 14ac8fde7..2b4851fcd 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -26,6 +26,7 @@ class InspIRCdProto : public IRCDProto
{
DefaultPseudoclientModes = "+I";
CanSVSNick = true;
+ CanSVSJoin = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSNLine = true;
@@ -286,9 +287,17 @@ class InspIRCdProto : public IRCDProto
UplinkSocket::Message(Me) << "ADDLINE Z " << x->GetHost() << " " << x->by << " " << Anope::CurTime << " " << timeleft << " :" << x->GetReason();
}
- void SendSVSJoin(const BotInfo *source, const Anope::string &nick, const Anope::string &chan, const Anope::string &) anope_override
+ void SendSVSJoin(const BotInfo *source, const User *u, const Anope::string &chan, const Anope::string &) anope_override
{
- UplinkSocket::Message(source) << "SVSJOIN " << nick << " " << chan;
+ UplinkSocket::Message(source) << "SVSJOIN " << u->GetUID() << " " << chan;
+ }
+
+ void SendSVSPart(const BotInfo *source, const User *u, const Anope::string &chan, const Anope::string &param) anope_override
+ {
+ if (!param.empty())
+ UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan << " :" << param;
+ else
+ UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan;
}
void SendBOB() anope_override
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index dbe6cefb5..edbb27c88 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -74,6 +74,7 @@ class InspIRCd12Proto : public IRCDProto
{
DefaultPseudoclientModes = "+I";
CanSVSNick = true;
+ CanSVSJoin = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSQLine = true;
@@ -309,12 +310,19 @@ class InspIRCd12Proto : public IRCDProto
SendAddLine("Z", x->GetHost(), timeleft, x->by, x->GetReason());
}
- void SendSVSJoin(const BotInfo *source, const Anope::string &nick, const Anope::string &chan, const Anope::string &) anope_override
+ void SendSVSJoin(const BotInfo *source, const User *u, const Anope::string &chan, const Anope::string &) anope_override
{
- User *u = User::Find(nick);
UplinkSocket::Message(source) << "SVSJOIN " << u->GetUID() << " " << chan;
}
+ void SendSVSPart(const BotInfo *source, const User *u, const Anope::string &chan, const Anope::string &param) anope_override
+ {
+ if (!param.empty())
+ UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan << " :" << param;
+ else
+ UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan;
+ }
+
void SendSWhois(const BotInfo *, const Anope::string &who, const Anope::string &mask) anope_override
{
User *u = User::Find(who);
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index b6895735d..37c5f7cb8 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -29,6 +29,7 @@ class InspIRCd20Proto : public IRCDProto
{
DefaultPseudoclientModes = "+I";
CanSVSNick = true;
+ CanSVSJoin = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSQLine = true;
@@ -66,7 +67,8 @@ class InspIRCd20Proto : public IRCDProto
void SendSVSHoldDel(const Anope::string &nick) anope_override { insp12->SendSVSHoldDel(nick); }
void SendSZLineDel(const XLine *x) anope_override { insp12->SendSZLineDel(x); }
void SendSZLine(User *u, const XLine *x) anope_override { insp12->SendSZLine(u, x); }
- void SendSVSJoin(const BotInfo *source, const Anope::string &nick, const Anope::string &chan, const Anope::string &other) anope_override { insp12->SendSVSJoin(source, nick, chan, other); }
+ void SendSVSJoin(const BotInfo *source, const User *u, const Anope::string &chan, const Anope::string &other) anope_override { insp12->SendSVSJoin(source, u, chan, other); }
+ void SendSVSPart(const BotInfo *source, const User *u, const Anope::string &chan, const Anope::string &param) anope_override { insp12->SendSVSPart(source, u, chan, param); }
void SendSWhois(const BotInfo *bi, const Anope::string &who, const Anope::string &mask) anope_override { insp12->SendSWhois(bi, who, mask); }
void SendBOB() anope_override { insp12->SendBOB(); }
void SendEOB() anope_override { insp12->SendEOB(); }
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 3026e1c4d..42d282d19 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -151,6 +151,16 @@ class PlexusProto : public IRCDProto
{
UplinkSocket::Message(bi) << "ENCAP * TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_ts << " :" << c->topic;
}
+
+ void SendSVSJoin(const BotInfo *source, const User *user, const Anope::string &chan, const Anope::string &param) anope_override
+ {
+ UplinkSocket::Message(source) << "ENCAP " << user->server->GetSID() << " SVSJOIN " << user->GetUID() << " " << chan;
+ }
+
+ void SendSVSPart(const BotInfo *source, const User *user, const Anope::string &chan, const Anope::string &param) anope_override
+ {
+ UplinkSocket::Message(source) << "ENCAP " << user->server->GetSID() << " SVSPART " << user->GetUID() << " " << chan;
+ }
};
struct IRCDMessageEncap : IRCDMessage
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index 8f3f3f810..08fe8d237 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -20,6 +20,7 @@ class UnrealIRCdProto : public IRCDProto
{
DefaultPseudoclientModes = "+Soiq";
CanSVSNick = true;
+ CanSVSJoin = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSNLine = true;
@@ -202,12 +203,6 @@ class UnrealIRCdProto : public IRCDProto
UplinkSocket::Message(source) << "SVSO " << nick << " " << flag;
}
- /* NICK <newnick> */
- void SendChangeBotNick(const BotInfo *oldnick, const Anope::string &newnick) anope_override
- {
- UplinkSocket::Message(oldnick) << "NICK " << newnick << " " << Anope::CurTime;
- }
-
/* Functions that use serval cmd functions */
void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override
@@ -300,12 +295,20 @@ class UnrealIRCdProto : public IRCDProto
/* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken
when coming from a none TOKEN'd server
*/
- void SendSVSJoin(const BotInfo *source, const Anope::string &nick, const Anope::string &chan, const Anope::string &param) anope_override
+ void SendSVSJoin(const BotInfo *source, const User *user, const Anope::string &chan, const Anope::string &param) anope_override
+ {
+ if (!param.empty())
+ UplinkSocket::Message(source) << "SVSJOIN " << user->GetUID() << " " << chan << " :" << param;
+ else
+ UplinkSocket::Message(source) << "SVSJOIN " << user->GetUID() << " " << chan;
+ }
+
+ void SendSVSPart(const BotInfo *source, const User *user, const Anope::string &chan, const Anope::string &param) anope_override
{
if (!param.empty())
- UplinkSocket::Message(source) << "SVSJOIN " << nick << " " << chan << " :" << param;
+ UplinkSocket::Message(source) << "SVSPART " << user->GetUID() << " " << chan << " :" << param;
else
- UplinkSocket::Message(source) << "SVSJOIN " << nick << " :" << chan;
+ UplinkSocket::Message(source) << "SVSPART " << user->GetUID() << " " << chan;
}
void SendSWhois(const BotInfo *source, const Anope::string &who, const Anope::string &mask) anope_override