diff options
| author | Alexander Barton <alex@barton.de> | 2008-08-15 00:11:53 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2008-09-23 11:47:17 +0200 |
| commit | 687784d276feecf3c87735eef180b7df61852823 (patch) | |
| tree | f64aaf7c0b51406b5fa87b7647332e3d98f4fa2e /src | |
| parent | 92603f7c809c79f442edfd3413a5be7906d1eacb (diff) | |
| download | ngircd-687784d276feecf3c87735eef180b7df61852823.tar.gz ngircd-687784d276feecf3c87735eef180b7df61852823.zip | |
Announce_User(): support RFC 1459 compatibility mode.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/numeric.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ngircd/numeric.c b/src/ngircd/numeric.c index fc7bef82..af1ac027 100644 --- a/src/ngircd/numeric.c +++ b/src/ngircd/numeric.c @@ -78,17 +78,27 @@ static bool Announce_User(CLIENT * Client, CLIENT * User) { CONN_ID conn; + char *modes; + conn = Client_Conn(Client); if (Conn_Options(conn) & CONN_RFC1459) { /* RFC 1459 mode: separate NICK and USER commands */ if (! Conn_WriteStr(conn, "NICK %s :%d", Client_ID(User), Client_Hops(User) + 1)) return DISCONNECTED; - return Conn_WriteStr(conn, ":%s USER %s %s %s :%s", + if (! Conn_WriteStr(conn, ":%s USER %s %s %s :%s", Client_ID(User), Client_User(User), Client_Hostname(User), Client_ID(Client_Introducer(User)), - Client_Info(User)); + Client_Info(User))) + return DISCONNECTED; + modes = Client_Modes(User); + if (modes[0]) { + return Conn_WriteStr(conn, ":%s MODE %s +%s", + Client_ID(User), Client_ID(User), + modes); + } + return CONNECTED; } else { /* RFC 2813 mode: one combined NICK command */ return IRC_WriteStrClient(Client, "NICK %s %d %s %s %d +%s :%s", |