mirror of
https://github.com/anope/anope.git
synced 2026-06-29 09:16:38 +02:00
InspIRCd: Add support for sending detecting m_topiclock and sending SVSTOPIC when it is available
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user