X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..ea84bfdefffd4f120799ab6854ef78ea3766d986:/modules/m_pong.c?ds=sidebyside diff --git a/modules/m_pong.c b/modules/m_pong.c index 7900f48..fc8245a 100644 --- a/modules/m_pong.c +++ b/modules/m_pong.c @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_pong.c 522 2006-01-15 20:55:27Z jilles $ */ #include "stdinc.h" @@ -34,7 +33,7 @@ #include "s_conf.h" #include "send.h" #include "channel.h" -#include "irc_string.h" +#include "match.h" #include "msg.h" #include "parse.h" #include "hash.h" @@ -49,7 +48,7 @@ struct Message pong_msgtab = { }; mapi_clist_av1 pong_clist[] = { &pong_msgtab, NULL }; -DECLARE_MODULE_AV1(pong, NULL, NULL, pong_clist, NULL, NULL, "$Revision: 522 $"); +DECLARE_MODULE_AV1(pong, NULL, NULL, pong_clist, NULL, NULL, "$Revision: 3181 $"); static int ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) @@ -69,8 +68,7 @@ ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char * if(!EmptyString(destination) && !match(destination, me.name) && irccmp(destination, me.id)) { - if((target_p = find_client(destination)) || - (target_p = find_server(NULL, destination))) + if((target_p = find_client(destination))) sendto_one(target_p, ":%s PONG %s %s", get_id(source_p, target_p), parv[1], get_id(target_p, target_p)); @@ -90,7 +88,7 @@ ms_pong(struct Client *client_p, struct Client *source_p, int parc, const char * sendto_realops_snomask(SNO_GENERAL, L_ALL, "End of burst (emulated) from %s (%d seconds)", source_p->name, - (signed int) (CurrentTime - source_p->localClient->firsttime)); + (signed int) (rb_current_time() - source_p->localClient->firsttime)); SetEob(source_p); eob_count++; call_hook(h_server_eob, source_p); @@ -104,7 +102,7 @@ mr_pong(struct Client *client_p, struct Client *source_p, int parc, const char * { if(parc == 2 && !EmptyString(parv[1])) { - if(ConfigFileEntry.ping_cookie && source_p->user && source_p->name[0]) + if(ConfigFileEntry.ping_cookie && source_p->flags & FLAGS_SENTUSER && source_p->name[0]) { unsigned long incoming_ping = strtoul(parv[1], NULL, 16); if(incoming_ping) @@ -112,8 +110,8 @@ mr_pong(struct Client *client_p, struct Client *source_p, int parc, const char * if(source_p->localClient->random_ping == incoming_ping) { char buf[USERLEN + 1]; - strlcpy(buf, source_p->username, sizeof(buf)); - source_p->flags2 |= FLAGS2_PING_COOKIE; + rb_strlcpy(buf, source_p->username, sizeof(buf)); + source_p->flags |= FLAGS_PING_COOKIE; register_local_user(client_p, source_p, buf); } else @@ -128,7 +126,7 @@ mr_pong(struct Client *client_p, struct Client *source_p, int parc, const char * } else - sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, parv[0]); + sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, source_p->name); source_p->flags &= ~FLAGS_PINGSENT;