1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 17:43:13 +02:00

Fix topiclock on inspircd

This commit is contained in:
Adam
2012-10-02 22:16:35 -04:00
parent 7042223f2e
commit 87478187af
9 changed files with 22 additions and 17 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ class CoreExport IRCDProto
unsigned MaxModes;
virtual void SendSVSNOOP(const Server *, bool) { }
virtual void SendTopic(BotInfo *, Channel *);
virtual void SendTopic(BotInfo *, Channel *, const Anope::string &, const Anope::string &, time_t &);
virtual void SendVhostDel(User *) { }
virtual void SendAkill(User *, XLine *) = 0;
virtual void SendAkillDel(const XLine *) = 0;
+2 -2
View File
@@ -158,9 +158,9 @@ class BahamutIRCdProto : public IRCDProto
}
/* TOPIC */
void SendTopic(BotInfo *whosets, Channel *c) anope_override
void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
{
UplinkSocket::Message(whosets) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_time << " :" << c->topic;
UplinkSocket::Message(bi) << "TOPIC " << c->name << " " << setter << " " << ts << " :" << topic;
}
/* UNSQLINE */
+7 -2
View File
@@ -92,9 +92,14 @@ class InspIRCdTS6Proto : public IRCDProto
UplinkSocket::Message(bi) << "GLINE " << x->Mask;
}
void SendTopic(BotInfo *whosets, Channel *c) anope_override
void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
{
UplinkSocket::Message(whosets) << "FTOPIC " << c->name << " " << c->topic_time << " " << c->topic_setter << " :" << c->topic;
/* Preferably we want to set the topic with a TS in the past (when re-setting the topic on channel creation etc)
* But if we have a previous topic and it is newer than the older TS we must bump the TS to now
*/
if (c->topic_time > ts)
ts = Anope::CurTime;
UplinkSocket::Message(bi) << "FTOPIC " << c->name << " " << ts << " " << setter << " :" << topic;
}
void SendVhostDel(User *u) anope_override
+2 -2
View File
@@ -94,9 +94,9 @@ class InspIRCdProto : public IRCDProto
UplinkSocket::Message(findbot(Config->OperServ)) << "GLINE " << x->Mask;
}
void SendTopic(BotInfo *whosets, Channel *c) anope_override
void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
{
UplinkSocket::Message(whosets) << "FTOPIC " << c->name << " " << c->topic_time << " " << c->topic_setter <<" :" << c->topic;
UplinkSocket::Message(bi) << "FTOPIC " << c->name << " " << ts << " " << setter << " :" << topic;
}
void SendVhostDel(User *u) anope_override
+2 -2
View File
@@ -223,9 +223,9 @@ class PlexusProto : public IRCDProto
UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID();
}
void SendTopic(BotInfo *bi, Channel *c) anope_override
void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
{
UplinkSocket::Message(bi) << "ENCAP * TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_time + 1 << " :" << c->topic;
UplinkSocket::Message(bi) << "ENCAP * TOPIC " << c->name << " " << setter << " " << ts << " :" << topic;
}
void SendChannel(Channel *c) anope_override
+2 -2
View File
@@ -197,7 +197,7 @@ class RatboxProto : public IRCDProto
return true;
}
void SendTopic(BotInfo *bi, Channel *c) anope_override
void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
{
bool needjoin = c->FindUser(bi) == NULL;
if (needjoin)
@@ -206,7 +206,7 @@ class RatboxProto : public IRCDProto
status.SetFlag(CMODE_OP);
bi->Join(c, &status);
}
IRCDProto::SendTopic(bi, c);
IRCDProto::SendTopic(bi, c, topic, setter, ts);
if (needjoin)
bi->Part(c);
}
+2 -2
View File
@@ -57,9 +57,9 @@ class UnrealIRCdProto : public IRCDProto
UplinkSocket::Message() << "BD - G " << x->GetUser() << " " << x->GetHost() << " " << Config->OperServ;
}
void SendTopic(BotInfo *whosets, Channel *c) anope_override
void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
{
UplinkSocket::Message(whosets) << ") " << c->name << " " << c->topic_setter << " " << c->topic_time + 1 << " :" << c->topic;
UplinkSocket::Message(bi) << "TOPIC " << c->name << " " << setter << " " << ts << " :" << topic;
}
void SendGlobalNotice(const BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
+2 -2
View File
@@ -910,12 +910,12 @@ void Channel::ChangeTopic(const Anope::string &user, const Anope::string &newtop
{
User *u = finduser(user);
ircdproto->SendTopic(this->ci->WhoSends(), this, newtopic, u ? u->nick : user, ts);
this->topic = newtopic;
this->topic_setter = u ? u->nick : user;
this->topic_time = ts;
ircdproto->SendTopic(this->ci->WhoSends(), this);
FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(this, user, this->topic));
if (this->ci)
+2 -2
View File
@@ -119,9 +119,9 @@ void IRCDProto::SendNumericInternal(int numeric, const Anope::string &dest, cons
UplinkSocket::Message(Me) << n << " " << dest << " " << buf;
}
void IRCDProto::SendTopic(BotInfo *bi, Channel *c)
void IRCDProto::SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &, time_t &)
{
UplinkSocket::Message(bi) << "TOPIC " << c->name << " :" << c->topic;
UplinkSocket::Message(bi) << "TOPIC " << c->name << " :" << topic;
}
void IRCDProto::SendSVSKill(const BotInfo *source, User *user, const char *fmt, ...)