summaryrefslogtreecommitdiff
path: root/modules/protocol/ratbox.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-12-01 19:46:06 -0500
committerAdam <Adam@anope.org>2016-12-01 19:46:06 -0500
commit76771aa05f7168ca02c217d3c6de36e84381eb5d (patch)
tree2a6efe527c1178903e24bf920e047c07f539d040 /modules/protocol/ratbox.cpp
parentd95bc84eda5c131374b7097f9de7f59418bd9b6a (diff)
Split more protocol module message handler declarations into module headers
Diffstat (limited to 'modules/protocol/ratbox.cpp')
-rw-r--r--modules/protocol/ratbox.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp
index b316964c5..6d4c29f03 100644
--- a/modules/protocol/ratbox.cpp
+++ b/modules/protocol/ratbox.cpp
@@ -211,12 +211,12 @@ struct IRCDMessagePass : IRCDMessage
};
// SERVER hades.arpa 1 :ircd-ratbox test server
-void ratbox::Server::Run(MessageSource &source, const std::vector<Anope::string> &params)
+void ratbox::ServerMessage::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
// Servers other then our immediate uplink are introduced via SID
if (params[1] != "1")
return;
- new ::Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID);
+ new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID);
IRCD->SendPing(Me->GetName(), params[0]);
}
@@ -228,14 +228,19 @@ void ratbox::Server::Run(MessageSource &source, const std::vector<Anope::string>
*/
void ratbox::TB::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
- time_t topic_time = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime;
Channel *c = Channel::Find(params[0]);
+ time_t topic_time = Anope::CurTime;
if (!c)
return;
+ try
+ {
+ topic_time = convertTo<time_t>(params[1]);
+ }
+ catch (const ConvertException &) { }
const Anope::string &setter = params.size() == 4 ? params[2] : "",
- topic = params.size() == 4 ? params[3] : params[2];
+ &topic = params.size() == 4 ? params[3] : params[2];
c->ChangeTopicInternal(NULL, setter, topic, topic_time);
}
@@ -243,8 +248,16 @@ void ratbox::TB::Run(MessageSource &source, const std::vector<Anope::string> &pa
// :42X UID Adam 1 1348535644 +aow Adam 192.168.0.5 192.168.0.5 42XAAAAAB :Adam
void ratbox::UID::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
+ time_t ts = 0;
+
+ try
+ {
+ ts = convertTo<time_t>(params[2]);
+ }
+ catch (const ConvertException &) { }
+
/* Source is always the server */
- User::OnIntroduce(params[0], params[4], params[5], "", params[6], source.GetServer(), params[8], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[3], params[7], NULL);
+ User::OnIntroduce(params[0], params[4], params[5], "", params[6], source.GetServer(), params[8], ts, params[3], params[7], NULL);
}
class ProtoRatbox : public Module
@@ -279,7 +292,7 @@ class ProtoRatbox : public Module
hybrid::Nick message_nick;
IRCDMessagePass message_pass;
hybrid::Pong message_pong;
- ratbox::Server message_server;
+ ratbox::ServerMessage message_server;
hybrid::SID message_sid;
hybrid::SJoin message_sjoin;
ratbox::TB message_tb;