]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Invite: Send RPL_AWAY to client sending the invite if target is away.
authorFlorian Westphal <fw@strlen.de>
Sun, 4 May 2008 13:07:21 +0000 (15:07 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 5 May 2008 13:52:41 +0000 (15:52 +0200)
src/ngircd/irc-op.c

index 94b11bebdc3bbb7f3c3bea5711878681cbd1da21..bbedcf4caf9968a4ecfbc7a8291660741a73d02a 100644 (file)
@@ -125,8 +125,14 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req)
 
        if (Client_Conn(target) > NONE) {
                /* The target user is local, so we have to send the status code */
-               if (!IRC_WriteStrClientPrefix(from, target, RPL_INVITING_MSG, Client_ID(from), Req->argv[0], Req->argv[1]))
+               if (!IRC_WriteStrClientPrefix(from, target, RPL_INVITING_MSG,
+                               Client_ID(from), Req->argv[0], Req->argv[1]))
                        return DISCONNECTED;
+
+               if (strchr(Client_Modes(target), 'a') &&
+                       !IRC_WriteStrClient(from, RPL_AWAY_MSG, Client_ID(from),
+                                       Client_ID(target), Client_Away(target)))
+                               return DISCONNECTED;
        }
        return CONNECTED;
 } /* IRC_INVITE */