X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/81af5bcb394280ff1af82486961d852b102b923b..b2c208be091670e3c5259eba77187bae6ac6eece:/modules/m_motd.c?ds=sidebyside diff --git a/modules/m_motd.c b/modules/m_motd.c index 6b17c31c..f798029a 100644 --- a/modules/m_motd.c +++ b/modules/m_motd.c @@ -36,6 +36,7 @@ #include "modules.h" #include "s_conf.h" #include "cache.h" +#include "ratelimit.h" static int m_motd(struct Client *, struct Client *, int, const char **); static int mo_motd(struct Client *, struct Client *, int, const char **); @@ -59,7 +60,6 @@ static void motd_spy(struct Client *); /* ** m_motd -** parv[0] = sender prefix ** parv[1] = servername */ static int @@ -67,7 +67,7 @@ m_motd(struct Client *client_p, struct Client *source_p, int parc, const char *p { static time_t last_used = 0; - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) + 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), @@ -77,7 +77,7 @@ m_motd(struct Client *client_p, struct Client *source_p, int parc, const char *p return 0; } else - last_used = CurrentTime; + last_used = rb_current_time(); if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME) return 0; @@ -90,7 +90,6 @@ m_motd(struct Client *client_p, struct Client *source_p, int parc, const char *p /* ** mo_motd -** parv[0] = sender prefix ** parv[1] = servername */ static int