From 20276d401104e56b2b5cb5844d09bb7ca4a355a8 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Fri, 2 Aug 2019 22:55:19 +0100 Subject: [PATCH] m_motd: don't ratelimit with no server argument --- modules/m_motd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/m_motd.c b/modules/m_motd.c index feca390c..f71ea801 100644 --- a/modules/m_motd.c +++ b/modules/m_motd.c @@ -67,17 +67,18 @@ m_motd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p { static time_t last_used = 0; - if((last_used + ConfigFileEntry.pace_wait) > rb_current_time() || !ratelimit_client(source_p, 6)) - { + if (parc < 2) { + /* do nothing */ + } else if ((last_used + ConfigFileEntry.pace_wait) > rb_current_time() || !ratelimit_client(source_p, 6)) { /* safe enough to give this on a local connect only */ sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "MOTD"); sendto_one(source_p, form_str(RPL_ENDOFMOTD), me.name, source_p->name); return; - } - else + } else { last_used = rb_current_time(); + } if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME) return;