diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-05-10 07:22:45 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-05-10 07:22:45 +0200 |
commit | 09d94db2f06ce1521f19566b3d988cff4b02af6b (patch) | |
tree | c3dd582b492f8fbaad99f3a2261dc923b923e8c7 /src | |
parent | ba1efa77c3a2af31287a6050bf30285ef701216c (diff) | |
parent | 15b0a1853d2912ae10d218b00c2e6f175bb5ae30 (diff) |
Merge pull request #1039 from SaberUK/insp20+fix-restrictmsg-uline
[2.0] Fix not being able to message ulines when m_restrictmsg is loaded.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_restrictmsg.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp index e814f3b16..2a9f1dc93 100644 --- a/src/modules/m_restrictmsg.cpp +++ b/src/modules/m_restrictmsg.cpp @@ -26,15 +26,22 @@ class ModuleRestrictMsg : public Module { + private: + bool uline; public: void init() { - Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice }; + OnRehash(NULL); + Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } + void OnRehash(User*) + { + uline = ServerInstance->Config->ConfValue("restrictmsg")->getBool("uline", false); + } virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) { @@ -45,8 +52,9 @@ class ModuleRestrictMsg : public Module // message allowed if: // (1) the sender is opered // (2) the recipient is opered + // (3) the recipient is on a ulined server // anything else, blocked. - if (IS_OPER(u) || IS_OPER(user)) + if (IS_OPER(u) || IS_OPER(user) || (uline && ServerInstance->ULine(u->server))) { return MOD_RES_PASSTHRU; } |