summaryrefslogtreecommitdiff
path: root/modules/protocol/ratbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/protocol/ratbox.cpp')
-rw-r--r--modules/protocol/ratbox.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index 7b6a9f345..3c3079ae2 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -41,7 +41,6 @@ class RatboxProto : public IRCDProto
void SendServer(const Server *server) anope_override { hybrid->SendServer(server); }
void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override { hybrid->SendModeInternal(source, u, buf); }
void SendChannel(Channel *c) anope_override { hybrid->SendChannel(c); }
- void SendTopic(const MessageSource &source, Channel *c) anope_override { hybrid->SendTopic(source, c); }
bool IsIdentValid(const Anope::string &ident) anope_override { return hybrid->IsIdentValid(ident); }
void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override
@@ -82,18 +81,37 @@ class RatboxProto : public IRCDProto
UplinkSocket::Message(Me) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " 0 " << u->GetUID() << " :" << u->realname;
}
- void SendLogin(User *u) anope_override
+ void SendLogin(User *u, NickAlias *na) anope_override
{
- if (!u->Account())
+ if (na->nc->HasExt("UNCONFIRMED"))
return;
- UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID() << " " << u->Account()->display;
+ UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID() << " " << na->nc->display;
}
void SendLogout(User *u) anope_override
{
UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID();
}
+
+ void SendTopic(const MessageSource &source, Channel *c) anope_override
+ {
+ BotInfo *bi = source.GetBot();
+ bool needjoin = c->FindUser(bi) == NULL;
+
+ if (needjoin)
+ {
+ ChannelStatus status;
+
+ status.AddMode('o');
+ bi->Join(c, &status);
+ }
+
+ IRCDProto::SendTopic(source, c);
+
+ if (needjoin)
+ bi->Part(c);
+ }
};
struct IRCDMessageEncap : IRCDMessage