m_motd: don't ratelimit with no server argument

This commit is contained in:
Ed Kellett 2019-08-02 22:55:19 +01:00
parent e902e16974
commit 20276d4011
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC

View file

@ -67,17 +67,18 @@ m_motd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
{ {
static time_t last_used = 0; 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 */ /* safe enough to give this on a local connect only */
sendto_one(source_p, form_str(RPL_LOAD2HI), sendto_one(source_p, form_str(RPL_LOAD2HI),
me.name, source_p->name, "MOTD"); me.name, source_p->name, "MOTD");
sendto_one(source_p, form_str(RPL_ENDOFMOTD), sendto_one(source_p, form_str(RPL_ENDOFMOTD),
me.name, source_p->name); me.name, source_p->name);
return; return;
} } else {
else
last_used = rb_current_time(); last_used = rb_current_time();
}
if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME) if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
return; return;