]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_invite.c
ENCAPs cannot come from local clients, no need to check.
[irc/rqf/shadowircd.git] / modules / m_invite.c
index 91254adb4d48f043353a4ca04e8484fb2f6d0c43..cf475f934d1e507af64384f2338f5b4576b040f5 100644 (file)
@@ -58,6 +58,7 @@ static void add_invite(struct Channel *, struct Client *);
 static int
 m_invite(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
+       const char *awaymsg;
        struct Client *target_p;
        struct Channel *chptr;
        struct membership *msptr;
@@ -109,6 +110,16 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
                return 0;
        }
 
+       if(((MyConnect(source_p) && !IsExemptResv(source_p)) ||
+                       (MyConnect(target_p) && !IsExemptResv(target_p))) &&
+               hash_find_resv(parv[2]))
+       {
+               sendto_one_numeric(source_p, ERR_BADCHANNAME,
+                                  form_str(ERR_BADCHANNAME),
+                                  parv[2]);
+               return 0;
+       }
+
        if((chptr = find_channel(parv[2])) == NULL)
        {
                sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
@@ -155,9 +166,9 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
                sendto_one(source_p, form_str(RPL_INVITING), 
                           me.name, source_p->name,
                           target_p->name, parv[2]);
-               if(target_p->user->away)
+               if((awaymsg = get_metadata(target_p, "away")) != NULL)
                        sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),
-                                          target_p->name, target_p->user->away);
+                                          target_p->name, awaymsg);
        }
        /* invite timestamp */
        else if(parc > 3 && !EmptyString(parv[3]))