diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-10-07 01:33:49 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-10-07 01:33:49 +0200 |
commit | 682d76835e0713ba00fee1a6013903f5ce99b801 (patch) | |
tree | 1332c4ee2b8d6a56e4abd19c4be77f1721306db3 | |
parent | 42aa367f16a1dc29584ee93efdc466c4e5f83974 (diff) |
InspIRCd: Add support for sending detecting m_topiclock and sending SVSTOPIC when it is available
-rw-r--r-- | modules/protocol/inspircd-ts6.h | 21 | ||||
-rw-r--r-- | modules/protocol/inspircd12.cpp | 1 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 3 |
3 files changed, 19 insertions, 6 deletions
diff --git a/modules/protocol/inspircd-ts6.h b/modules/protocol/inspircd-ts6.h index 1f516baaf..870546438 100644 --- a/modules/protocol/inspircd-ts6.h +++ b/modules/protocol/inspircd-ts6.h @@ -94,12 +94,19 @@ class InspIRCdTS6Proto : public IRCDProto void SendTopic(BotInfo *whosets, Channel *c) anope_override { - /* If the last time a topic was set is after the TS we want for this topic we must bump this topic's timestamp to now */ - time_t ts = c->topic_ts; - if (c->topic_time > ts) - ts = Anope::CurTime; - /* But don't modify c->topic_ts, it should remain set to the real TS we want as ci->last_topic_time pulls from it */ - UplinkSocket::Message(whosets) << "FTOPIC " << c->name << " " << ts << " " << c->topic_setter << " :" << c->topic; + if (has_svstopic_topiclock) + { + UplinkSocket::Message(Me) << "SVSTOPIC " << c->name << " " << c->topic_ts << " " << c->topic_setter << " :" << c->topic; + } + else + { + /* If the last time a topic was set is after the TS we want for this topic we must bump this topic's timestamp to now */ + time_t ts = c->topic_ts; + if (c->topic_time > ts) + ts = Anope::CurTime; + /* But don't modify c->topic_ts, it should remain set to the real TS we want as ci->last_topic_time pulls from it */ + UplinkSocket::Message(whosets) << "FTOPIC " << c->name << " " << ts << " " << c->topic_setter << " :" << c->topic; + } } void SendVhostDel(User *u) anope_override @@ -618,6 +625,8 @@ struct IRCDMessageMetadata : IRCDMessage ircdproto->CanSVSHold = plus; else if (module.equals_cs("m_rline.so")) has_rlinemod = plus; + else if (module.equals_cs("m_topiclock.so")) + has_svstopic_topiclock = plus; else return true; diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 27ec1249a..1a1ebb65e 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -18,6 +18,7 @@ static bool has_globopsmod = false; static bool has_chghostmod = false; static bool has_chgidentmod = false; static bool has_rlinemod = false; +static bool has_svstopic_topiclock = false; static unsigned int spanningtree_proto_ver = 1201; #include "inspircd-ts6.h" diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index b5bce5ac9..baacb5c64 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -134,6 +134,7 @@ struct IRCDMessageCapab : IRCDMessage has_servicesmod = false; has_chghostmod = false; has_chgidentmod = false; + has_svstopic_topiclock = false; ircdproto->CanSVSHold = false; } else if (params[0].equals_cs("CHANMODES") && params.size() > 1) @@ -308,6 +309,8 @@ struct IRCDMessageCapab : IRCDMessage if (!Config->RegexEngine.empty() && module.length() > 11 && Config->RegexEngine != module.substr(11)) Log() << "Warning: InspIRCd is using regex engine " << module.substr(11) << ", but we have " << Config->RegexEngine << ". This may cause inconsistencies."; } + else if (module.equals_cs("m_topiclock.so")) + has_svstopic_topiclock = true; } } else if (params[0].equals_cs("MODSUPPORT") && params.size() > 1) |