summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/protocol.h2
-rw-r--r--modules/protocol/bahamut.cpp4
-rw-r--r--modules/protocol/inspircd-ts6.h9
-rw-r--r--modules/protocol/inspircd11.cpp4
-rw-r--r--modules/protocol/plexus.cpp4
-rw-r--r--modules/protocol/ratbox.cpp4
-rw-r--r--modules/protocol/unreal.cpp4
-rw-r--r--src/channels.cpp4
-rw-r--r--src/protocol.cpp4
9 files changed, 17 insertions, 22 deletions
diff --git a/include/protocol.h b/include/protocol.h
index 03b726848..d4ff79082 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -67,7 +67,7 @@ class CoreExport IRCDProto
unsigned MaxModes;
virtual void SendSVSNOOP(const Server *, bool) { }
- virtual void SendTopic(BotInfo *, Channel *, const Anope::string &, const Anope::string &, time_t &);
+ virtual void SendTopic(BotInfo *, Channel *);
virtual void SendVhostDel(User *) { }
virtual void SendAkill(User *, XLine *) = 0;
virtual void SendAkillDel(const XLine *) = 0;
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 31be87086..6f785b37e 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -158,9 +158,9 @@ class BahamutIRCdProto : public IRCDProto
}
/* TOPIC */
- void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
+ void SendTopic(BotInfo *whosets, Channel *c) anope_override
{
- UplinkSocket::Message(bi) << "TOPIC " << c->name << " " << setter << " " << ts << " :" << topic;
+ UplinkSocket::Message(whosets) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_time << " :" << c->topic;
}
/* UNSQLINE */
diff --git a/modules/protocol/inspircd-ts6.h b/modules/protocol/inspircd-ts6.h
index bf545bd6c..d011bf70b 100644
--- a/modules/protocol/inspircd-ts6.h
+++ b/modules/protocol/inspircd-ts6.h
@@ -92,14 +92,9 @@ class InspIRCdTS6Proto : public IRCDProto
UplinkSocket::Message(bi) << "GLINE " << x->Mask;
}
- void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
+ void SendTopic(BotInfo *whosets, Channel *c) anope_override
{
- /* 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;
+ UplinkSocket::Message(whosets) << "FTOPIC " << c->name << " " << c->topic_time << " " << c->topic_setter << " :" << c->topic;
}
void SendVhostDel(User *u) anope_override
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 971528a7b..1eb385e4b 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -94,9 +94,9 @@ class InspIRCdProto : public IRCDProto
UplinkSocket::Message(findbot(Config->OperServ)) << "GLINE " << x->Mask;
}
- void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
+ void SendTopic(BotInfo *whosets, Channel *c) anope_override
{
- UplinkSocket::Message(bi) << "FTOPIC " << c->name << " " << ts << " " << setter << " :" << topic;
+ UplinkSocket::Message(whosets) << "FTOPIC " << c->name << " " << c->topic_time << " " << c->topic_setter <<" :" << c->topic;
}
void SendVhostDel(User *u) anope_override
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 291c3c6eb..f0b213eab 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -223,9 +223,9 @@ class PlexusProto : public IRCDProto
UplinkSocket::Message(Me) << "ENCAP * SU " << u->GetUID();
}
- void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
+ void SendTopic(BotInfo *bi, Channel *c) anope_override
{
- UplinkSocket::Message(bi) << "ENCAP * TOPIC " << c->name << " " << setter << " " << ts << " :" << topic;
+ UplinkSocket::Message(bi) << "ENCAP * TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_time + 1 << " :" << c->topic;
}
void SendChannel(Channel *c) anope_override
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index fc6cd788e..a6fc85675 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -197,7 +197,7 @@ class RatboxProto : public IRCDProto
return true;
}
- void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
+ void SendTopic(BotInfo *bi, Channel *c) 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, topic, setter, ts);
+ IRCDProto::SendTopic(bi, c);
if (needjoin)
bi->Part(c);
}
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index 3f1ee2263..186fc8563 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -57,9 +57,9 @@ class UnrealIRCdProto : public IRCDProto
UplinkSocket::Message() << "BD - G " << x->GetUser() << " " << x->GetHost() << " " << Config->OperServ;
}
- void SendTopic(BotInfo *bi, Channel *c, const Anope::string &topic, const Anope::string &setter, time_t &ts) anope_override
+ void SendTopic(BotInfo *whosets, Channel *c) anope_override
{
- UplinkSocket::Message(bi) << "TOPIC " << c->name << " " << setter << " " << ts << " :" << topic;
+ UplinkSocket::Message(whosets) << ") " << c->name << " " << c->topic_setter << " " << c->topic_time + 1 << " :" << c->topic;
}
void SendGlobalNotice(const BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
diff --git a/src/channels.cpp b/src/channels.cpp
index 78709ed59..c95e46373 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -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)
diff --git a/src/protocol.cpp b/src/protocol.cpp
index 6be9804c1..14fe249ed 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -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, const Anope::string &topic, const Anope::string &, time_t &)
+void IRCDProto::SendTopic(BotInfo *bi, Channel *c)
{
- UplinkSocket::Message(bi) << "TOPIC " << c->name << " :" << topic;
+ UplinkSocket::Message(bi) << "TOPIC " << c->name << " :" << c->topic;
}
void IRCDProto::SendSVSKill(const BotInfo *source, User *user, const char *fmt, ...)