summaryrefslogtreecommitdiff
path: root/src/messages.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/messages.c')
-rw-r--r--src/messages.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/messages.c b/src/messages.c
index 335fc1093..571a0ea2b 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -49,25 +49,8 @@ int m_kill(char *nick, char *msg)
BotInfo *bi;
/* Recover if someone kills us. */
- if (stricmp(nick, s_OperServ) == 0 ||
- (s_OperServAlias && stricmp(nick, s_OperServAlias) == 0) ||
- stricmp(nick, s_NickServ) == 0 ||
- (s_NickServAlias && stricmp(nick, s_NickServAlias) == 0) ||
- stricmp(nick, s_ChanServ) == 0 ||
- (s_ChanServAlias && stricmp(nick, s_ChanServAlias) == 0) ||
- stricmp(nick, s_MemoServ) == 0 ||
- (s_MemoServAlias && stricmp(nick, s_MemoServAlias) == 0) ||
- (s_HostServ && stricmp(nick, s_HostServ) == 0) ||
- (s_HostServAlias && stricmp(nick, s_HostServAlias) == 0) ||
- (s_BotServ && stricmp(nick, s_BotServ) == 0) ||
- (s_BotServAlias && stricmp(nick, s_BotServAlias) == 0) ||
- stricmp(nick, s_HelpServ) == 0 ||
- (s_HelpServAlias && stricmp(nick, s_HelpServAlias) == 0) ||
- (s_DevNull && stricmp(nick, s_DevNull) == 0) ||
- (s_DevNullAlias && stricmp(nick, s_DevNullAlias) == 0) ||
- stricmp(nick, s_GlobalNoticer) == 0 ||
- (s_GlobalNoticerAlias && stricmp(nick, s_GlobalNoticerAlias) == 0)
- ) {
+ /* use nickIsServices() to reduce the number of lines of code - TSL */
+ if (nickIsServices(nick, 0)) {
if (!readonly && !skeleton)
introduce_user(nick);
} else if (s_BotServ && (bi = findbot(nick))) {
@@ -138,6 +121,10 @@ int m_privmsg(char *source, char *receiver, char *msg)
return MOD_CONT;
}
+ if (!*receiver || !receiver || !msg) {
+ return MOD_CONT;
+ }
+
if (*receiver == '#') {
if (s_BotServ && (ci = cs_findchan(receiver)))
if (!(ci->flags & CI_VERBOTEN) && ci->c && ci->bi) /* Some paranoia checks */