From 90252bbeccbfde0e28a13b58edb463d3b6463b8f Mon Sep 17 00:00:00 2001 From: "rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Sun, 25 Jun 2006 18:07:48 +0000 Subject: BUILD : 1.7.14 (1073) BUGS : N/A NOTES : Added a string privmsg option, which can force services to only accept /msg nick@host git-svn-id: svn://svn.anope.org/anope/trunk@1073 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@797 5417fbe8-f217-4b02-8779-1006273d7864 --- src/config.c | 2 ++ src/messages.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/config.c b/src/config.c index d8e05a157..9c7c34670 100644 --- a/src/config.c +++ b/src/config.c @@ -113,6 +113,7 @@ int KeepLogs; int KeepBackups; int ForceForbidReason; int UsePrivmsg; +int UseStrictPrivMsg; int DumpCore; int LogUsers; int NickRegDelay; @@ -610,6 +611,7 @@ Directive directives[] = { {"UpdateTimeout", {{PARAM_TIME, PARAM_RELOAD, &UpdateTimeout}}}, {"UseMail", {{PARAM_SET, PARAM_RELOAD, &UseMail}}}, {"UsePrivmsg", {{PARAM_SET, PARAM_RELOAD, &UsePrivmsg}}}, + {"UseStrictPrivMsg", {{PARAM_SET, PARAM_RELOAD, &UseStrictPrivMsg}}}, {"UserKey1", {{PARAM_POSINT, PARAM_RELOAD, &UserKey1}}}, {"UserKey2", {{PARAM_POSINT, PARAM_RELOAD, &UserKey2}}}, {"UserKey3", {{PARAM_POSINT, PARAM_RELOAD, &UserKey3}}}, diff --git a/src/messages.c b/src/messages.c index 263e96ea2..8353987c6 100644 --- a/src/messages.c +++ b/src/messages.c @@ -139,7 +139,6 @@ int m_privmsg(char *source, char *receiver, char *msg) } } } else { - /* Check if we should ignore. Operators always get through. */ if (allow_ignore && !is_oper(u)) { IgnoreData *ign = get_ignore(source); @@ -156,6 +155,13 @@ int m_privmsg(char *source, char *receiver, char *msg) *s++ = 0; if (stricmp(s, ServerName) != 0) return MOD_CONT; + } else if (UseStrictPrivMsg) { + if (debug) { + alog("Ignored PRIVMSG without @ from %s", source); + } + notice_lang(receiver, u, INVALID_TARGET, receiver, receiver, + ServerName, receiver); + return MOD_CONT; } starttime = time(NULL); -- cgit