static void add_invite(struct Channel *, struct Client *);
/* m_invite()
- * parv[0] - sender prefix
* parv[1] - user to invite
* parv[2] - channel name
*/
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;
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,
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]))