diff options
| author | Florian Westphal <fw@strlen.de> | 2008-05-04 15:07:21 +0200 |
|---|---|---|
| committer | Florian Westphal <fw@strlen.de> | 2008-05-05 15:52:41 +0200 |
| commit | 3283d275ba26c470d131ce0b6f66ee54a00bfd1c (patch) | |
| tree | 039b063da77277c46a55f680c4b8b0b1ed014af0 | |
| parent | faf9b6ea16029d11a6b577ec98a73466e5421f55 (diff) | |
| download | ngircd-3283d275ba26c470d131ce0b6f66ee54a00bfd1c.tar.gz ngircd-3283d275ba26c470d131ce0b6f66ee54a00bfd1c.zip | |
Invite: Send RPL_AWAY to client sending the invite if target is away.
| -rw-r--r-- | src/ngircd/irc-op.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c index 94b11beb..bbedcf4c 100644 --- a/src/ngircd/irc-op.c +++ b/src/ngircd/irc-op.c @@ -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 */ |