]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_pong.c
Allow /ojoin !#channel/%#channel, if admin/halfop are enabled.
[irc/rqf/shadowircd.git] / modules / m_pong.c
index 82ce37c4d81a13dcd6fcfd4aa4cff7980a327361..831f2c864ba214e0aa8024969ec9d3a4409de668 100644 (file)
@@ -34,7 +34,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"
@@ -103,7 +103,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)
@@ -111,7 +111,7 @@ 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));
+                                       rb_strlcpy(buf, source_p->username, sizeof(buf));
                                        source_p->flags |= FLAGS_PING_COOKIE;
                                        register_local_user(client_p, source_p, buf);
                                }
@@ -127,7 +127,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;