summaryrefslogtreecommitdiff
path: root/modules/protocol/unreal32.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-15 16:40:55 -0400
committerAdam <Adam@anope.org>2010-09-15 16:40:55 -0400
commit813185105823daa6a1b574d86053950382343589 (patch)
tree793d4f54cddc88275b4372839f93bba01301b427 /modules/protocol/unreal32.cpp
parent6239b5a053fc8fd94b798495f8e189a2e2bda285 (diff)
Rewrote all of the topic code, fixes a few topic related problems on some older IRCds
Diffstat (limited to 'modules/protocol/unreal32.cpp')
-rw-r--r--modules/protocol/unreal32.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp
index 0b5b56b08..892c4fc57 100644
--- a/modules/protocol/unreal32.cpp
+++ b/modules/protocol/unreal32.cpp
@@ -23,10 +23,7 @@ IRCDVar myIrcd[] = {
1, /* Supports SNlines */
1, /* Supports SQlines */
1, /* Supports SZlines */
- 0, /* Join 2 Set */
0, /* Join 2 Message */
- 1, /* TS Topic Forward */
- 0, /* TS Topci Backward */
0, /* Chan SQlines */
0, /* Quit on Kill */
1, /* SVSMODE unban */
@@ -112,9 +109,9 @@ class UnrealIRCdProto : public IRCDProto
send_cmd("", "BD - G %s %s %s", x->GetUser().c_str(), x->GetHost().c_str(), Config->s_OperServ.c_str());
}
- void SendTopic(const BotInfo *whosets, const Channel *c, const Anope::string &whosetit, const Anope::string &topic)
+ void SendTopic(BotInfo *whosets, Channel *c)
{
- send_cmd(whosets->nick, ") %s %s %lu :%s", c->name.c_str(), whosetit.c_str(), static_cast<unsigned long>(c->topic_time), topic.c_str());
+ send_cmd(whosets->nick, ") %s %s %lu :%s", c->name.c_str(), c->topic_setter.c_str(), static_cast<unsigned long>(c->topic_time + 1), c->topic.c_str());
}
void SendVhostDel(User *u)
@@ -612,21 +609,26 @@ int anope_event_away(const Anope::string &source, int ac, const char **av)
/*
** m_topic
-** parv[0] = sender prefix
-** parv[1] = topic text
-**
-** For servers using TS:
-** parv[0] = sender prefix
-** parv[1] = channel name
-** parv[2] = topic nickname
-** parv[3] = topic time
-** parv[4] = topic text
+** source = sender prefix
+** parv[0] = channel name
+** parv[1] = topic nickname
+** parv[2] = topic time
+** parv[3] = topic text
*/
int anope_event_topic(const Anope::string &source, int ac, const char **av)
{
if (ac != 4)
return MOD_CONT;
- do_topic(source, ac, av);
+
+ Channel *c = findchan(av[0]);
+ if (!c)
+ {
+ Log() << "TOPIC for nonexistant channel " << av[0];
+ return MOD_CONT;
+ }
+
+ c->ChangeTopicInternal(av[1], av[3], Anope::string(av[2]).is_pos_number_only() ? convertTo<time_t>(av[2]) : Anope::CurTime);
+
return MOD_CONT;
}