From d27eac196b3dc84473d43d1be13a4fd72332b9aa Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 19 May 2012 16:18:57 +0200 Subject: m_cban, m_svshold Only attach to hooks we have a handler for --- src/modules/m_cban.cpp | 4 ++-- src/modules/m_svshold.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 6d91f2a5d..350cec914 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -176,8 +176,8 @@ class ModuleCBan : public Module mycommand = new CommandCBan(Me); ServerInstance->AddCommand(mycommand); - Implementation eventlist[] = { I_OnUserPreJoin, I_OnSyncOtherMetaData, I_OnDecodeMetaData, I_OnStats }; - ServerInstance->Modules->Attach(eventlist, this, 4); + Implementation eventlist[] = { I_OnUserPreJoin, I_OnStats }; + ServerInstance->Modules->Attach(eventlist, this, 2); } virtual ~ModuleCBan() diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index af625ec90..da843469b 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -162,8 +162,8 @@ class ModuleSVSHold : public Module ServerInstance->XLines->RegisterFactory(s); mycommand = new CommandSvshold(Me); ServerInstance->AddCommand(mycommand); - Implementation eventlist[] = { I_OnUserPreNick, I_OnSyncOtherMetaData, I_OnDecodeMetaData, I_OnStats }; - ServerInstance->Modules->Attach(eventlist, this, 4); + Implementation eventlist[] = { I_OnUserPreNick, I_OnStats }; + ServerInstance->Modules->Attach(eventlist, this, 2); } -- cgit v1.3.1-10-gc9f91 From 7b99b8d8a57c2840ea404203de4a3e93862d06b5 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 19 May 2012 16:19:28 +0200 Subject: m_callerid Fix module sending no metadata due to not being attached to appropiate hooks --- src/modules/m_callerid.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index f53766152..06f09cdae 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -372,8 +372,9 @@ public: throw ModuleException("Could not add command!"); } - Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage, I_OnCleanup }; - ServerInstance->Modules->Attach(eventlist, this, 7); + Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage, I_OnCleanup, + I_OnSyncUserMetaData, I_OnDecodeMetaData }; + ServerInstance->Modules->Attach(eventlist, this, 9); } virtual ~ModuleCallerID() -- cgit v1.3.1-10-gc9f91 From 0e524d82fd20cabf6f01f4a7fc4b9fbb64f9dd9a Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 19 May 2012 16:19:35 +0200 Subject: m_alltime Use the dedicated function of the protocol interface to send notices to remote users --- src/modules/m_alltime.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index fe2818d62..a93ec77cf 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -39,15 +39,15 @@ class CommandAlltime : public Command time_t now = ServerInstance->Time(); strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now)); - std::string msg = ":" + std::string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time is " + fmtdate + "(" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName; + std::string msg = "System time is " + std::string(fmtdate) + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName; if (IS_LOCAL(user)) { - user->Write(msg); + user->WriteServ("NOTICE %s :%s", user->nick.c_str(), msg.c_str()); } else { - ServerInstance->PI->PushToClient(user, ":" + msg); + ServerInstance->PI->SendUserNotice(user, msg); } /* we want this routed out! */ -- cgit v1.3.1-10-gc9f91 From 6b5367e78ecb51191884fea9940cbb3b25e9eaa5 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 19 May 2012 16:20:58 +0200 Subject: m_opermodes Get rid of the duplicated s2s message caused by SendGlobalMode spanningtree sends all mode changes automatically if they're done by a real local user (i.e. not fakeuser), which is our case --- src/modules/m_opermodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index 478af0fe1..3f2d057ad 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -116,7 +116,7 @@ class ModuleModesOnOper : public Module modes.push_back(tokens[k]); } - ServerInstance->SendGlobalMode(modes, u); + ServerInstance->Modes->Process(modes, u, true); } }; -- cgit v1.3.1-10-gc9f91