Blame


1 38b9cb88 2001-12-14 alex /*
2 38b9cb88 2001-12-14 alex * ngIRCd -- The Next Generation IRC Daemon
3 bdaf53e7 2004-02-28 alex * Copyright (c)2001-2004 Alexander Barton <alex@barton.de>
4 38b9cb88 2001-12-14 alex *
5 490f28ff 2002-12-12 alex * This program is free software; you can redistribute it and/or modify
6 490f28ff 2002-12-12 alex * it under the terms of the GNU General Public License as published by
7 490f28ff 2002-12-12 alex * the Free Software Foundation; either version 2 of the License, or
8 490f28ff 2002-12-12 alex * (at your option) any later version.
9 490f28ff 2002-12-12 alex * Please read the file COPYING, README and AUTHORS for more information.
10 38b9cb88 2001-12-14 alex *
11 490f28ff 2002-12-12 alex * IRC commands
12 38b9cb88 2001-12-14 alex */
13 38b9cb88 2001-12-14 alex
14 38b9cb88 2001-12-14 alex
15 ca33cbda 2002-03-12 alex #include "portab.h"
16 38b9cb88 2001-12-14 alex
17 bdaf53e7 2004-02-28 alex static char UNUSED id[] = "$Id: irc.c,v 1.124 2004/02/28 02:18:16 alex Exp $";
18 490f28ff 2002-12-12 alex
19 ca33cbda 2002-03-12 alex #include "imp.h"
20 38b9cb88 2001-12-14 alex #include <assert.h>
21 44a2b3cf 2002-12-12 alex #include <stdio.h>
22 2a13cd22 2001-12-23 alex #include <string.h>
23 38b9cb88 2001-12-14 alex
24 42c4e6c7 2003-01-13 alex #include "ngircd.h"
25 42c4e6c7 2003-01-13 alex #include "conn.h"
26 42c4e6c7 2003-01-13 alex #include "resolve.h"
27 42c4e6c7 2003-01-13 alex #include "conf.h"
28 b8d7dcec 2002-12-30 alex #include "conn-func.h"
29 2a13cd22 2001-12-23 alex #include "client.h"
30 c2f60abe 2002-05-27 alex #include "channel.h"
31 0c471b84 2002-11-30 alex #include "defines.h"
32 ef7f7a90 2002-02-27 alex #include "irc-write.h"
33 2a13cd22 2001-12-23 alex #include "log.h"
34 2a13cd22 2001-12-23 alex #include "messages.h"
35 c2f60abe 2002-05-27 alex #include "parse.h"
36 2a13cd22 2001-12-23 alex
37 ca33cbda 2002-03-12 alex #include "exp.h"
38 38b9cb88 2001-12-14 alex #include "irc.h"
39 38b9cb88 2001-12-14 alex
40 38b9cb88 2001-12-14 alex
41 ac4f25e3 2003-03-19 alex LOCAL CHAR *Option_String PARAMS(( CONN_ID Idx ));
42 ac4f25e3 2003-03-19 alex
43 ac4f25e3 2003-03-19 alex
44 c2f60abe 2002-05-27 alex GLOBAL BOOLEAN
45 0c471b84 2002-11-30 alex IRC_ERROR( CLIENT *Client, REQUEST *Req )
46 bbfe9e8b 2001-12-25 alex {
47 bbfe9e8b 2001-12-25 alex assert( Client != NULL );
48 bbfe9e8b 2001-12-25 alex assert( Req != NULL );
49 bbfe9e8b 2001-12-25 alex
50 0c471b84 2002-11-30 alex if( Req->argc < 1 ) Log( LOG_NOTICE, "Got ERROR from \"%s\"!", Client_Mask( Client ));
51 0c471b84 2002-11-30 alex else Log( LOG_NOTICE, "Got ERROR from \"%s\": %s!", Client_Mask( Client ), Req->argv[0] );
52 45d447d9 2001-12-25 alex
53 0c471b84 2002-11-30 alex return CONNECTED;
54 0c471b84 2002-11-30 alex } /* IRC_ERROR */
55 1fd9216c 2002-11-24 alex
56 1fd9216c 2002-11-24 alex
57 c2f60abe 2002-05-27 alex GLOBAL BOOLEAN
58 0c471b84 2002-11-30 alex IRC_KILL( CLIENT *Client, REQUEST *Req )
59 72ebf4f2 2001-12-27 alex {
60 0c471b84 2002-11-30 alex CLIENT *prefix, *c;
61 b99af4fa 2002-12-06 alex CHAR reason[COMMAND_LEN];
62 01b58a05 2002-12-31 alex CONN_ID my_conn, conn;
63 0c471b84 2002-11-30 alex
64 72ebf4f2 2001-12-27 alex assert( Client != NULL );
65 72ebf4f2 2001-12-27 alex assert( Req != NULL );
66 72ebf4f2 2001-12-27 alex
67 4d2f279d 2002-12-26 alex /* Is the user an IRC operator? */
68 b99af4fa 2002-12-06 alex if(( Client_Type( Client ) != CLIENT_SERVER ) && ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
69 b99af4fa 2002-12-06 alex
70 4d2f279d 2002-12-26 alex /* Bad number of parameters? */
71 0c471b84 2002-11-30 alex if(( Req->argc != 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
72 72ebf4f2 2001-12-27 alex
73 b99af4fa 2002-12-06 alex if( Req->prefix ) prefix = Client_Search( Req->prefix );
74 b99af4fa 2002-12-06 alex else prefix = Client;
75 0c471b84 2002-11-30 alex if( ! prefix )
76 72ebf4f2 2001-12-27 alex {
77 0c471b84 2002-11-30 alex Log( LOG_WARNING, "Got KILL with invalid prefix: \"%s\"!", Req->prefix );
78 0c471b84 2002-11-30 alex prefix = Client_ThisServer( );
79 0c471b84 2002-11-30 alex }
80 c3d9c40a 2002-06-10 alex
81 1443bc38 2003-01-08 alex if( Client != Client_ThisServer( )) Log( LOG_NOTICE|LOG_snotice, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
82 3c01ac4e 2002-02-27 alex
83 4d2f279d 2002-12-26 alex /* Build reason string */
84 b316c380 2002-12-26 alex if( Client_Type( Client ) == CLIENT_USER ) snprintf( reason, sizeof( reason ), "KILLed by %s: %s", Client_ID( Client ), Req->argv[1] );
85 695631b2 2002-12-26 alex else strlcpy( reason, Req->argv[1], sizeof( reason ));
86 b99af4fa 2002-12-06 alex
87 4d2f279d 2002-12-26 alex /* Inform other servers */
88 b99af4fa 2002-12-06 alex IRC_WriteStrServersPrefix( Client, prefix, "KILL %s :%s", Req->argv[0], reason );
89 0c471b84 2002-11-30 alex
90 01b58a05 2002-12-31 alex /* Save ID of this connection */
91 01b58a05 2002-12-31 alex my_conn = Client_Conn( Client );
92 01b58a05 2002-12-31 alex
93 4d2f279d 2002-12-26 alex /* Do we host such a client? */
94 0c471b84 2002-11-30 alex c = Client_Search( Req->argv[0] );
95 0c471b84 2002-11-30 alex if( c )
96 0c471b84 2002-11-30 alex {
97 01bec0da 2002-12-27 alex /* Yes, there is such a client -- but is it a valid user? */
98 e55399c6 2003-04-29 alex if( Client_Type( c ) == CLIENT_SERVER )
99 e55399c6 2003-04-29 alex {
100 e55399c6 2003-04-29 alex if( Client != Client_ThisServer( )) IRC_WriteStrClient( Client, ERR_CANTKILLSERVER_MSG, Client_ID( Client ));
101 e55399c6 2003-04-29 alex else
102 e55399c6 2003-04-29 alex {
103 e55399c6 2003-04-29 alex /* Oops, I should kill another server!? */
104 e55399c6 2003-04-29 alex Log( LOG_ERR, "Can't KILL server \"%s\"!", Req->argv[0] );
105 e55399c6 2003-04-29 alex conn = Client_Conn( Client_NextHop( c ));
106 e55399c6 2003-04-29 alex assert( conn > NONE );
107 e55399c6 2003-04-29 alex Conn_Close( conn, NULL, "Nick collision for server!?", TRUE );
108 e55399c6 2003-04-29 alex }
109 e55399c6 2003-04-29 alex }
110 e55399c6 2003-04-29 alex else if( Client_Type( c ) != CLIENT_USER )
111 e55399c6 2003-04-29 alex {
112 e55399c6 2003-04-29 alex if( Client != Client_ThisServer( )) IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
113 e55399c6 2003-04-29 alex else
114 e55399c6 2003-04-29 alex {
115 e55399c6 2003-04-29 alex /* Oops, what sould I close?? */
116 e55399c6 2003-04-29 alex Log( LOG_ERR, "Can't KILL \"%s\": invalid client type!", Req->argv[0] );
117 e55399c6 2003-04-29 alex conn = Client_Conn( Client_NextHop( c ));
118 e55399c6 2003-04-29 alex assert( conn > NONE );
119 e55399c6 2003-04-29 alex Conn_Close( conn, NULL, "Collision for invalid client type!?", TRUE );
120 e55399c6 2003-04-29 alex }
121 e55399c6 2003-04-29 alex }
122 01bec0da 2002-12-27 alex else
123 01bec0da 2002-12-27 alex {
124 01bec0da 2002-12-27 alex /* Kill user NOW! */
125 01bec0da 2002-12-27 alex conn = Client_Conn( c );
126 01bec0da 2002-12-27 alex Client_Destroy( c, NULL, reason, FALSE );
127 9d82635b 2003-01-08 alex if( conn != NONE ) Conn_Close( conn, NULL, reason, TRUE );
128 01bec0da 2002-12-27 alex }
129 72ebf4f2 2001-12-27 alex }
130 0c471b84 2002-11-30 alex else Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
131 92fb409f 2002-01-26 alex
132 4d2f279d 2002-12-26 alex /* Are we still connected or were we killed, too? */
133 1443bc38 2003-01-08 alex if(( my_conn > NONE ) && ( Client_GetFromConn( my_conn ))) return CONNECTED;
134 4d2f279d 2002-12-26 alex else return DISCONNECTED;
135 0c471b84 2002-11-30 alex } /* IRC_KILL */
136 cd6e4049 2002-02-27 alex
137 72ebf4f2 2001-12-27 alex
138 c2f60abe 2002-05-27 alex GLOBAL BOOLEAN
139 c2f60abe 2002-05-27 alex IRC_NOTICE( CLIENT *Client, REQUEST *Req )
140 72ebf4f2 2001-12-27 alex {
141 db58d347 2002-01-05 alex CLIENT *to, *from;
142 72ebf4f2 2001-12-27 alex
143 72ebf4f2 2001-12-27 alex assert( Client != NULL );
144 72ebf4f2 2001-12-27 alex assert( Req != NULL );
145 72ebf4f2 2001-12-27 alex
146 1e83e666 2002-10-09 alex if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return CONNECTED;
147 72ebf4f2 2001-12-27 alex
148 72ebf4f2 2001-12-27 alex /* Falsche Anzahl Parameter? */
149 72ebf4f2 2001-12-27 alex if( Req->argc != 2 ) return CONNECTED;
150 db58d347 2002-01-05 alex
151 c7408364 2002-03-25 alex if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
152 db58d347 2002-01-05 alex else from = Client;
153 c2ee5437 2002-01-11 alex if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
154 72ebf4f2 2001-12-27 alex
155 72ebf4f2 2001-12-27 alex to = Client_Search( Req->argv[0] );
156 9fd8254a 2002-06-11 alex if(( to ) && ( Client_Type( to ) == CLIENT_USER ))
157 72ebf4f2 2001-12-27 alex {
158 72ebf4f2 2001-12-27 alex /* Okay, Ziel ist ein User */
159 db58d347 2002-01-05 alex return IRC_WriteStrClientPrefix( to, from, "NOTICE %s :%s", Client_ID( to ), Req->argv[1] );
160 72ebf4f2 2001-12-27 alex }
161 db58d347 2002-01-05 alex else return CONNECTED;
162 72ebf4f2 2001-12-27 alex } /* IRC_NOTICE */
163 72ebf4f2 2001-12-27 alex
164 72ebf4f2 2001-12-27 alex
165 c2f60abe 2002-05-27 alex GLOBAL BOOLEAN
166 0c471b84 2002-11-30 alex IRC_PRIVMSG( CLIENT *Client, REQUEST *Req )
167 fb9d6ce1 2001-12-31 alex {
168 0c471b84 2002-11-30 alex CLIENT *cl, *from;
169 180095be 2002-02-27 alex CHANNEL *chan;
170 fb9d6ce1 2001-12-31 alex
171 fb9d6ce1 2001-12-31 alex assert( Client != NULL );
172 fb9d6ce1 2001-12-31 alex assert( Req != NULL );
173 fb9d6ce1 2001-12-31 alex
174 fb9d6ce1 2001-12-31 alex /* Falsche Anzahl Parameter? */
175 0c471b84 2002-11-30 alex if( Req->argc == 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
176 0c471b84 2002-11-30 alex if( Req->argc == 1 ) return IRC_WriteStrClient( Client, ERR_NOTEXTTOSEND_MSG, Client_ID( Client ));
177 180095be 2002-02-27 alex if( Req->argc > 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
178 fb9d6ce1 2001-12-31 alex
179 c7408364 2002-03-25 alex if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
180 180095be 2002-02-27 alex else from = Client;
181 0c471b84 2002-11-30 alex if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
182 180095be 2002-02-27 alex
183 0c471b84 2002-11-30 alex cl = Client_Search( Req->argv[0] );
184 0c471b84 2002-11-30 alex if( cl )
185 180095be 2002-02-27 alex {
186 0c471b84 2002-11-30 alex /* Okay, Ziel ist ein Client. Aber ist es auch ein User? */
187 0c471b84 2002-11-30 alex if( Client_Type( cl ) != CLIENT_USER ) return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( from ), Req->argv[0] );
188 180095be 2002-02-27 alex
189 0c471b84 2002-11-30 alex /* Okay, Ziel ist ein User */
190 0c471b84 2002-11-30 alex if(( Client_Type( Client ) != CLIENT_SERVER ) && ( strchr( Client_Modes( cl ), 'a' )))
191 180095be 2002-02-27 alex {
192 0c471b84 2002-11-30 alex /* Ziel-User ist AWAY: Meldung verschicken */
193 0c471b84 2002-11-30 alex if( ! IRC_WriteStrClient( from, RPL_AWAY_MSG, Client_ID( from ), Client_ID( cl ), Client_Away( cl ))) return DISCONNECTED;
194 eab20bee 2002-01-29 alex }
195 eab20bee 2002-01-29 alex
196 0c471b84 2002-11-30 alex /* Text senden */
197 0c471b84 2002-11-30 alex if( Client_Conn( from ) > NONE ) Conn_UpdateIdle( Client_Conn( from ));
198 0c471b84 2002-11-30 alex return IRC_WriteStrClientPrefix( cl, from, "PRIVMSG %s :%s", Client_ID( cl ), Req->argv[1] );
199 eab20bee 2002-01-29 alex }
200 804b1ec4 2001-12-31 alex
201 0c471b84 2002-11-30 alex chan = Channel_Search( Req->argv[0] );
202 0c471b84 2002-11-30 alex if( chan ) return Channel_Write( chan, from, Client, Req->argv[1] );
203 804b1ec4 2001-12-31 alex
204 0c471b84 2002-11-30 alex return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( from ), Req->argv[0] );
205 0c471b84 2002-11-30 alex } /* IRC_PRIVMSG */
206 804b1ec4 2001-12-31 alex
207 804b1ec4 2001-12-31 alex
208 42c4e6c7 2003-01-13 alex GLOBAL BOOLEAN
209 42c4e6c7 2003-01-13 alex IRC_TRACE( CLIENT *Client, REQUEST *Req )
210 42c4e6c7 2003-01-13 alex {
211 ac4f25e3 2003-03-19 alex CLIENT *from, *target, *c;
212 42c4e6c7 2003-01-13 alex CONN_ID idx, idx2;
213 bdaf53e7 2004-02-28 alex CHAR user[CLIENT_USER_LEN];
214 42c4e6c7 2003-01-13 alex
215 42c4e6c7 2003-01-13 alex assert( Client != NULL );
216 42c4e6c7 2003-01-13 alex assert( Req != NULL );
217 42c4e6c7 2003-01-13 alex
218 42c4e6c7 2003-01-13 alex /* Bad number of arguments? */
219 42c4e6c7 2003-01-13 alex if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
220 42c4e6c7 2003-01-13 alex
221 42c4e6c7 2003-01-13 alex /* Search sender */
222 42c4e6c7 2003-01-13 alex if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
223 42c4e6c7 2003-01-13 alex else from = Client;
224 42c4e6c7 2003-01-13 alex if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
225 42c4e6c7 2003-01-13 alex
226 42c4e6c7 2003-01-13 alex /* Search target */
227 42c4e6c7 2003-01-13 alex if( Req->argc == 1 ) target = Client_Search( Req->argv[0] );
228 42c4e6c7 2003-01-13 alex else target = Client_ThisServer( );
229 42c4e6c7 2003-01-13 alex
230 42c4e6c7 2003-01-13 alex /* Forward command to other server? */
231 42c4e6c7 2003-01-13 alex if( target != Client_ThisServer( ))
232 42c4e6c7 2003-01-13 alex {
233 42c4e6c7 2003-01-13 alex if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
234 42c4e6c7 2003-01-13 alex
235 42c4e6c7 2003-01-13 alex /* Send RPL_TRACELINK back to initiator */
236 42c4e6c7 2003-01-13 alex idx = Client_Conn( Client ); assert( idx > NONE );
237 42c4e6c7 2003-01-13 alex idx2 = Client_Conn( Client_NextHop( target )); assert( idx2 > NONE );
238 62796722 2003-03-31 alex if( ! IRC_WriteStrClient( from, RPL_TRACELINK_MSG, Client_ID( from ), PACKAGE_NAME, PACKAGE_VERSION, Client_ID( target ), Client_ID( Client_NextHop( target )), Option_String( idx2 ), time( NULL ) - Conn_StartTime( idx2 ), Conn_SendQ( idx ), Conn_SendQ( idx2 ))) return DISCONNECTED;
239 42c4e6c7 2003-01-13 alex
240 42c4e6c7 2003-01-13 alex /* Forward command */
241 42c4e6c7 2003-01-13 alex IRC_WriteStrClientPrefix( target, from, "TRACE %s", Req->argv[0] );
242 42c4e6c7 2003-01-13 alex return CONNECTED;
243 42c4e6c7 2003-01-13 alex }
244 42c4e6c7 2003-01-13 alex
245 ac4f25e3 2003-03-19 alex /* Infos about all connected servers */
246 ac4f25e3 2003-03-19 alex c = Client_First( );
247 ac4f25e3 2003-03-19 alex while( c )
248 ac4f25e3 2003-03-19 alex {
249 ac4f25e3 2003-03-19 alex if( Client_Conn( c ) > NONE )
250 ac4f25e3 2003-03-19 alex {
251 ac4f25e3 2003-03-19 alex /* Local client */
252 ac4f25e3 2003-03-19 alex if( Client_Type( c ) == CLIENT_SERVER )
253 ac4f25e3 2003-03-19 alex {
254 ac4f25e3 2003-03-19 alex /* Server link */
255 bdaf53e7 2004-02-28 alex strlcpy( user, Client_User( c ), sizeof( user ));
256 bdaf53e7 2004-02-28 alex if( user[0] == '~' ) strlcpy( user, "unknown", sizeof( user ));
257 bdaf53e7 2004-02-28 alex if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Client_ID( c ), user, Client_Hostname( c ), Client_Mask( Client_ThisServer( )), Option_String( Client_Conn( c )))) return DISCONNECTED;
258 ac4f25e3 2003-03-19 alex }
259 ac4f25e3 2003-03-19 alex if(( Client_Type( c ) == CLIENT_USER ) && ( strchr( Client_Modes( c ), 'o' )))
260 ac4f25e3 2003-03-19 alex {
261 ac4f25e3 2003-03-19 alex /* IRC Operator */
262 ac4f25e3 2003-03-19 alex if( ! IRC_WriteStrClient( from, RPL_TRACEOPERATOR_MSG, Client_ID( from ), Client_ID( c ))) return DISCONNECTED;
263 ac4f25e3 2003-03-19 alex }
264 ac4f25e3 2003-03-19 alex }
265 ac4f25e3 2003-03-19 alex c = Client_Next( c );
266 ac4f25e3 2003-03-19 alex }
267 ac4f25e3 2003-03-19 alex
268 7b6e2662 2003-11-05 alex IRC_SetPenalty( Client, 3 );
269 62796722 2003-03-31 alex return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel );
270 42c4e6c7 2003-01-13 alex } /* IRC_TRACE */
271 42c4e6c7 2003-01-13 alex
272 42c4e6c7 2003-01-13 alex
273 2152e377 2003-01-15 alex GLOBAL BOOLEAN
274 2152e377 2003-01-15 alex IRC_HELP( CLIENT *Client, REQUEST *Req )
275 2152e377 2003-01-15 alex {
276 2152e377 2003-01-15 alex COMMAND *cmd;
277 2152e377 2003-01-15 alex
278 2152e377 2003-01-15 alex assert( Client != NULL );
279 2152e377 2003-01-15 alex assert( Req != NULL );
280 2152e377 2003-01-15 alex
281 2152e377 2003-01-15 alex /* Bad number of arguments? */
282 2152e377 2003-01-15 alex if( Req->argc > 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
283 2152e377 2003-01-15 alex
284 2152e377 2003-01-15 alex cmd = Parse_GetCommandStruct( );
285 2152e377 2003-01-15 alex while( cmd->name )
286 2152e377 2003-01-15 alex {
287 2152e377 2003-01-15 alex if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
288 2152e377 2003-01-15 alex cmd++;
289 2152e377 2003-01-15 alex }
290 7b6e2662 2003-11-05 alex
291 7b6e2662 2003-11-05 alex IRC_SetPenalty( Client, 2 );
292 2152e377 2003-01-15 alex return CONNECTED;
293 2152e377 2003-01-15 alex } /* IRC_HELP */
294 2152e377 2003-01-15 alex
295 2152e377 2003-01-15 alex
296 ac4f25e3 2003-03-19 alex LOCAL CHAR *
297 ac4f25e3 2003-03-19 alex Option_String( CONN_ID Idx )
298 ac4f25e3 2003-03-19 alex {
299 ac4f25e3 2003-03-19 alex STATIC CHAR option_txt[8];
300 ac4f25e3 2003-03-19 alex INT options;
301 ac4f25e3 2003-03-19 alex
302 ac4f25e3 2003-03-19 alex options = Conn_Options( Idx );
303 ac4f25e3 2003-03-19 alex
304 ac4f25e3 2003-03-19 alex strcpy( option_txt, "F" ); /* No idea what this means but the original ircd sends it ... */
305 c40592d2 2003-12-26 alex #ifdef ZLIB
306 ac4f25e3 2003-03-19 alex if( options & CONN_ZIP ) strcat( option_txt, "z" );
307 ac4f25e3 2003-03-19 alex #endif
308 ac4f25e3 2003-03-19 alex
309 ac4f25e3 2003-03-19 alex return option_txt;
310 ac4f25e3 2003-03-19 alex } /* Option_String */
311 ac4f25e3 2003-03-19 alex
312 ac4f25e3 2003-03-19 alex
313 38b9cb88 2001-12-14 alex /* -eof- */