summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp9
-rw-r--r--src/modules/m_restrictmsg.cpp12
2 files changed, 18 insertions, 3 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 3b67a6180..59ac1acb3 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -316,7 +316,7 @@ class ModuleSSLGnuTLS : public Module
ServerInstance->GenRandom = &randhandler;
Implementation eventlist[] = { I_On005Numeric, I_OnRehash, I_OnModuleRehash, I_OnUserConnect,
- I_OnEvent, I_OnHookIO };
+ I_OnEvent, I_OnHookIO, I_OnCheckReady };
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
ServerInstance->Modules->AddService(iohook);
@@ -974,6 +974,13 @@ info_done_dealloc:
if (starttls.enabled)
capHandler.HandleEvent(ev);
}
+
+ ModResult OnCheckReady(LocalUser* user)
+ {
+ if ((user->eh.GetIOHook() == this) && (sessions[user->eh.GetFd()].status != ISSL_HANDSHAKEN))
+ return MOD_RES_DENY;
+ return MOD_RES_PASSTHRU;
+ }
};
MODULE_INIT(ModuleSSLGnuTLS)
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;
}