Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 217660
Collapse All | Expand All

(-)bitlbee-1.2/account.c (-7 / +5 lines)
Lines 181-199 Link Here
181
{
181
{
182
	account_t *a, *l = NULL;
182
	account_t *a, *l = NULL;
183
	
183
	
184
	if( acc->ic )
185
		/* Caller should have checked, accounts still in use can't be deleted. */
186
		return;
187
	
184
	for( a = irc->accounts; a; a = (l=a)->next )
188
	for( a = irc->accounts; a; a = (l=a)->next )
185
		if( a == acc )
189
		if( a == acc )
186
		{
190
		{
187
			if( a->ic ) return; /* Caller should have checked, accounts still in use can't be deleted. */
188
			
189
			if( l )
191
			if( l )
190
			{
191
				l->next = a->next;
192
				l->next = a->next;
192
			}
193
			else
193
			else
194
			{
195
				irc->accounts = a->next;
194
				irc->accounts = a->next;
196
			}
197
			
195
			
198
			while( a->set )
196
			while( a->set )
199
				set_del( &a->set, a->set->key );
197
				set_del( &a->set, a->set->key );
Lines 202-208 Link Here
202
			
200
			
203
			g_free( a->user );
201
			g_free( a->user );
204
			g_free( a->pass );
202
			g_free( a->pass );
205
			if( a->server ) g_free( a->server );
203
			g_free( a->server );
206
			if( a->reconnect )	/* This prevents any reconnect still queued to happen */
204
			if( a->reconnect )	/* This prevents any reconnect still queued to happen */
207
				cancel_auto_reconnect( a );
205
				cancel_auto_reconnect( a );
208
			g_free( a );
206
			g_free( a );
(-)bitlbee-1.2/bitlbee.c (-4 / +8 lines)
Lines 225-236 Link Here
225
	
225
	
226
	if( st == size )
226
	if( st == size )
227
	{
227
	{
228
		g_free( irc->sendbuffer );
229
		irc->sendbuffer = NULL;
230
		irc->w_watch_source_id = 0;
231
		
232
		if( irc->status & USTATUS_SHUTDOWN )
228
		if( irc->status & USTATUS_SHUTDOWN )
229
		{
233
			irc_free( irc );
230
			irc_free( irc );
231
		}
232
		else
233
		{
234
			g_free( irc->sendbuffer );
235
			irc->sendbuffer = NULL;
236
			irc->w_watch_source_id = 0;
237
		}
234
		
238
		
235
		return FALSE;
239
		return FALSE;
236
	}
240
	}
(-)bitlbee-1.2/bitlbee.h (+2 lines)
Lines 159-164 Link Here
159
void root_command( irc_t *irc, char *command[] );
159
void root_command( irc_t *irc, char *command[] );
160
gboolean bitlbee_shutdown( gpointer data, gint fd, b_input_condition cond );
160
gboolean bitlbee_shutdown( gpointer data, gint fd, b_input_condition cond );
161
161
162
char *set_eval_root_nick( set_t *set, char *new_nick );
163
162
extern global_t global;
164
extern global_t global;
163
165
164
#endif
166
#endif
(-)bitlbee-1.2/conf.c (-1 / +2 lines)
Lines 61-66 Link Here
61
	conf->ping_interval = 180;
61
	conf->ping_interval = 180;
62
	conf->ping_timeout = 300;
62
	conf->ping_timeout = 300;
63
	conf->user = NULL;
63
	conf->user = NULL;
64
	conf->max_filetransfer_size = G_MAXUINT;
64
	proxytype = 0;
65
	proxytype = 0;
65
	
66
	
66
	i = conf_loadini( conf, global.conf_file );
67
	i = conf_loadini( conf, global.conf_file );
Lines 251-257 Link Here
251
			else if( g_strcasecmp( ini->key, "account_storage_migrate" ) == 0 )
252
			else if( g_strcasecmp( ini->key, "account_storage_migrate" ) == 0 )
252
			{
253
			{
253
				g_strfreev( conf->migrate_storage );
254
				g_strfreev( conf->migrate_storage );
254
				conf->migrate_storage = g_strsplit( ini->value, " \t,;", -1 );
255
				conf->migrate_storage = g_strsplit_set( ini->value, " \t,;", -1 );
255
			}
256
			}
256
			else if( g_strcasecmp( ini->key, "pinginterval" ) == 0 )
257
			else if( g_strcasecmp( ini->key, "pinginterval" ) == 0 )
257
			{
258
			{
(-)bitlbee-1.2/conf.h (+1 lines)
Lines 49-54 Link Here
49
	int ping_interval;
49
	int ping_interval;
50
	int ping_timeout;
50
	int ping_timeout;
51
	char *user;
51
	char *user;
52
	size_t max_filetransfer_size;
52
} conf_t;
53
} conf_t;
53
54
54
G_GNUC_MALLOC conf_t *conf_load( int argc, char *argv[] );
55
G_GNUC_MALLOC conf_t *conf_load( int argc, char *argv[] );
(-)bitlbee-1.2/dcc.c (+677 lines)
Line 0 Link Here
1
/********************************************************************\
2
* BitlBee -- An IRC to other IM-networks gateway                     *
3
*                                                                    *
4
* Copyright 2007 Uli Meis <a.sporto+bee@gmail.com>                   *
5
\********************************************************************/
6
7
/*
8
  This program is free software; you can redistribute it and/or modify
9
  it under the terms of the GNU General Public License as published by
10
  the Free Software Foundation; either version 2 of the License, or
11
  (at your option) any later version.
12
13
  This program is distributed in the hope that it will be useful,
14
  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
  GNU General Public License for more details.
17
18
  You should have received a copy of the GNU General Public License with
19
  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
20
  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21
  Suite 330, Boston, MA  02111-1307  USA
22
*/
23
24
#define BITLBEE_CORE
25
#include "bitlbee.h"
26
#include "ft.h"
27
#include "dcc.h"
28
#include <poll.h>
29
#include <netinet/tcp.h>
30
#include <regex.h>
31
32
/* 
33
 * Since that might be confusing a note on naming:
34
 *
35
 * Generic dcc functions start with 
36
 *
37
 * 	dcc_
38
 *
39
 * ,methods specific to DCC SEND start with
40
 *
41
 * 	dccs_
42
 *
43
 * . Since we can be on both ends of a DCC SEND,
44
 * functions specific to one end are called
45
 *
46
 * 	dccs_send and dccs_recv
47
 *
48
 * ,respectively.
49
 */
50
51
52
/* 
53
 * used to generate a unique local transfer id the user
54
 * can use to reject/cancel transfers
55
 */
56
unsigned int local_transfer_id=1;
57
58
/* 
59
 * just for debugging the nr. of chunks we received from im-protocols and the total data
60
 */
61
unsigned int receivedchunks=0, receiveddata=0;
62
63
int max_packet_size = 0;
64
65
static void dcc_finish( file_transfer_t *file );
66
static void dcc_close( file_transfer_t *file );
67
gboolean dccs_send_proto( gpointer data, gint fd, b_input_condition cond );
68
gboolean dcc_listen( dcc_file_transfer_t *df, struct sockaddr_storage **saddr_ptr );
69
int dccs_send_request( struct dcc_file_transfer *df, char *user_nick, struct sockaddr_storage *saddr );
70
gboolean dccs_recv_start( file_transfer_t *ft );
71
gboolean dccs_recv_proto( gpointer data, gint fd, b_input_condition cond);
72
gboolean dccs_recv_write_request( file_transfer_t *ft );
73
74
/* As defined in ft.h */
75
file_transfer_t *imcb_file_send_start( struct im_connection *ic, char *handle, char *file_name, size_t file_size )
76
{
77
	user_t *u = user_findhandle( ic, handle );
78
	/* one could handle this more intelligent like imcb_buddy_msg.
79
	 * can't call it directly though cause it does some wrapping.
80
	 * Maybe give imcb_buddy_msg a parameter NO_WRAPPING? */
81
	if (!u) return NULL;
82
83
	return dccs_send_start( ic, u->nick, file_name, file_size );
84
};
85
86
/* As defined in ft.h */
87
void imcb_file_canceled( file_transfer_t *file, char *reason )
88
{
89
	if( file->canceled )
90
		file->canceled( file, reason );
91
92
	dcc_close( file );
93
}
94
95
/* As defined in ft.h */
96
gboolean imcb_file_recv_start( file_transfer_t *ft )
97
{
98
	return dccs_recv_start( ft );
99
}
100
101
dcc_file_transfer_t *dcc_alloc_transfer( char *file_name, size_t file_size, struct im_connection *ic )
102
{
103
	file_transfer_t *file = g_new0( file_transfer_t, 1 );
104
	dcc_file_transfer_t *df = file->priv = g_new0( dcc_file_transfer_t, 1);
105
	file->file_size = file_size;
106
	file->file_name = g_strdup( file_name );
107
	file->local_id = local_transfer_id++;
108
	df->ic = ic;
109
	df->ft = file;
110
	
111
	return df;
112
}
113
114
/* This is where the sending magic starts... */
115
file_transfer_t *dccs_send_start( struct im_connection *ic, char *user_nick, char *file_name, size_t file_size )
116
{
117
	file_transfer_t *file;
118
	dcc_file_transfer_t *df;
119
	struct sockaddr_storage *saddr;
120
121
	if( file_size > global.conf->max_filetransfer_size )
122
		return NULL;
123
	
124
	df = dcc_alloc_transfer( file_name, file_size, ic );
125
	file = df->ft;
126
	file->write = dccs_send_write;
127
128
	/* listen and request */
129
	if( !dcc_listen( df, &saddr ) ||
130
	    !dccs_send_request( df, user_nick, saddr ) )
131
		return NULL;
132
133
	g_free( saddr );
134
135
	/* watch */
136
	df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_send_proto, df );
137
138
	df->ic->irc->file_transfers = g_slist_prepend( df->ic->irc->file_transfers, file );
139
140
	return file;
141
}
142
143
/* Used pretty much everywhere in the code to abort a transfer */
144
gboolean dcc_abort( dcc_file_transfer_t *df, char *reason, ... )
145
{
146
	file_transfer_t *file = df->ft;
147
	va_list params;
148
	va_start( params, reason );
149
	char *msg = g_strdup_vprintf( reason, params );
150
	va_end( params );
151
	
152
	file->status |= FT_STATUS_CANCELED;
153
	
154
	if( file->canceled )
155
		file->canceled( file, msg );
156
	else 
157
		imcb_log( df->ic, "DCC transfer aborted: %s", msg );
158
159
	g_free( msg );
160
161
	dcc_close( df->ft );
162
163
	return FALSE;
164
}
165
166
/* used extensively for socket operations */
167
#define ASSERTSOCKOP(op, msg) \
168
	if( (op) == -1 ) \
169
		return dcc_abort( df , msg ": %s", strerror( errno ) );
170
171
/* Creates the "DCC SEND" line and sends it to the server */
172
int dccs_send_request( struct dcc_file_transfer *df, char *user_nick, struct sockaddr_storage *saddr )
173
{
174
	char ipaddr[INET6_ADDRSTRLEN]; 
175
	const void *netaddr;
176
	int port;
177
	char *cmd;
178
179
	if( saddr->ss_family == AF_INET )
180
	{
181
		struct sockaddr_in *saddr_ipv4 = ( struct sockaddr_in *) saddr;
182
183
		sprintf( ipaddr, "%d", 
184
			 ntohl( saddr_ipv4->sin_addr.s_addr ) );
185
		port = saddr_ipv4->sin_port;
186
	} else 
187
	{
188
		struct sockaddr_in6 *saddr_ipv6 = ( struct sockaddr_in6 *) saddr;
189
190
		netaddr = &saddr_ipv6->sin6_addr.s6_addr;
191
		port = saddr_ipv6->sin6_port;
192
193
		/* 
194
		 * Didn't find docs about this, but it seems that's the way irssi does it
195
		 */
196
		if( !inet_ntop( saddr->ss_family, netaddr, ipaddr, sizeof( ipaddr ) ) )
197
			return dcc_abort( df, "inet_ntop failed: %s", strerror( errno ) );
198
	}
199
200
	port = ntohs( port );
201
202
	cmd = g_strdup_printf( "\001DCC SEND %s %s %u %zu\001",
203
				df->ft->file_name, ipaddr, port, df->ft->file_size );
204
	
205
	if ( !irc_msgfrom( df->ic->irc, user_nick, cmd ) )
206
		return dcc_abort( df, "couldn't send 'DCC SEND' message to %s", user_nick );
207
208
	g_free( cmd );
209
210
	return TRUE;
211
}
212
213
/*
214
 * Creates a listening socket and returns it in saddr_ptr.
215
 */
216
gboolean dcc_listen( dcc_file_transfer_t *df, struct sockaddr_storage **saddr_ptr )
217
{
218
	file_transfer_t *file = df->ft;
219
	struct sockaddr_storage *saddr;
220
	int fd,gret;
221
	char hostname[ HOST_NAME_MAX + 1 ];
222
	struct addrinfo hints, *rp;
223
	socklen_t ssize = sizeof( struct sockaddr_storage );
224
225
	/* won't be long till someone asks for this to be configurable :) */
226
227
	ASSERTSOCKOP( gethostname( hostname, sizeof( hostname ) ), "gethostname()" );
228
229
	memset( &hints, 0, sizeof( struct addrinfo ) );
230
	hints.ai_socktype = SOCK_STREAM;
231
	hints.ai_flags = AI_NUMERICSERV;
232
233
	if ( ( gret = getaddrinfo( hostname, "0", &hints, &rp ) != 0 ) )
234
		return dcc_abort( df, "getaddrinfo(): %s", gai_strerror( gret ) );
235
236
	saddr = g_new( struct sockaddr_storage, 1 );
237
238
	*saddr_ptr = saddr;
239
240
	memcpy( saddr, rp->ai_addr, rp->ai_addrlen );
241
242
	ASSERTSOCKOP( fd = df->fd = socket( saddr->ss_family, SOCK_STREAM, 0 ), "Opening socket" );
243
244
	ASSERTSOCKOP( bind( fd, ( struct sockaddr *)saddr, rp->ai_addrlen ), "Binding socket" );
245
	
246
	freeaddrinfo( rp );
247
248
	ASSERTSOCKOP( getsockname( fd, ( struct sockaddr *)saddr, &ssize ), "Getting socket name" );
249
250
	ASSERTSOCKOP( listen( fd, 1 ), "Making socket listen" );
251
252
	file->status = FT_STATUS_LISTENING;
253
254
	return TRUE;
255
}
256
257
/*
258
 * Checks poll(), same for receiving and sending
259
 */
260
gboolean dcc_poll( dcc_file_transfer_t *df, int fd, short *revents )
261
{
262
	struct pollfd pfd = { .fd = fd, .events = POLLHUP|POLLERR|POLLIN|POLLOUT };
263
264
	ASSERTSOCKOP( poll( &pfd, 1, 0 ), "poll()" )
265
266
	if( pfd.revents & POLLERR )
267
	{
268
		int sockerror;
269
		socklen_t errlen = sizeof( sockerror );
270
271
		if ( getsockopt( fd, SOL_SOCKET, SO_ERROR, &sockerror, &errlen ) )
272
			return dcc_abort( df, "getsockopt() failed, unknown socket error (weird!)" );
273
274
		return dcc_abort( df, "Socket error: %s", strerror( sockerror ) );
275
	}
276
	
277
	if( pfd.revents & POLLHUP ) 
278
		return dcc_abort( df, "Remote end closed connection" );
279
	
280
	*revents = pfd.revents;
281
282
	return TRUE;
283
}
284
285
/*
286
 * fills max_packet_size with twice the TCP maximum segment size
287
 */
288
gboolean  dcc_check_maxseg( dcc_file_transfer_t *df, int fd )
289
{
290
	/* 
291
	 * use twice the maximum segment size as a maximum for calls to send().
292
	 */
293
	if( max_packet_size == 0 )
294
	{
295
		unsigned int mpslen = sizeof( max_packet_size );
296
		if( getsockopt( fd, IPPROTO_TCP, TCP_MAXSEG, &max_packet_size, &mpslen ) )
297
			return dcc_abort( df, "getsockopt() failed" );
298
		max_packet_size *= 2;
299
	}
300
	return TRUE;
301
}
302
303
/*
304
 * After setup, the transfer itself is handled entirely by this function.
305
 * There are basically four things to handle: connect, receive, send, and error.
306
 */
307
gboolean dccs_send_proto( gpointer data, gint fd, b_input_condition cond )
308
{
309
	dcc_file_transfer_t *df = data;
310
	file_transfer_t *file = df->ft;
311
	short revents;
312
	
313
	if( !dcc_poll( df, fd, &revents) )
314
		return FALSE;
315
316
	if( ( revents & POLLIN ) &&
317
	    ( file->status & FT_STATUS_LISTENING ) )
318
	{ 	
319
		struct sockaddr *clt_addr;
320
		socklen_t ssize = sizeof( clt_addr );
321
322
		/* Connect */
323
324
		ASSERTSOCKOP( df->fd = accept( fd, (struct sockaddr *) &clt_addr, &ssize ), "Accepting connection" );
325
326
		closesocket( fd );
327
		fd = df->fd;
328
		file->status = FT_STATUS_TRANSFERRING;
329
		sock_make_nonblocking( fd );
330
331
		if ( !dcc_check_maxseg( df, fd ) )
332
			return FALSE;
333
334
		/* IM protocol callback */
335
		if( file->accept )
336
			file->accept( file );
337
338
		/* reschedule for reading on new fd */
339
		df->watch_in = b_input_add( fd, GAIM_INPUT_READ, dccs_send_proto, df );
340
341
		return FALSE;
342
	}
343
344
	if( revents & POLLIN ) 
345
	{
346
		int bytes_received;
347
		int ret;
348
		
349
		ASSERTSOCKOP( ret = recv( fd, &bytes_received, sizeof( bytes_received  ), MSG_PEEK ), "Receiving" );
350
351
		if( ret == 0 )
352
			return dcc_abort( df, "Remote end closed connection" );
353
			
354
		if( ret < 4 )
355
		{
356
			imcb_log( df->ic, "WARNING: DCC SEND: receiver sent only 2 bytes instead of 4, shouldn't happen too often!" );
357
			return TRUE;
358
		}
359
360
		ASSERTSOCKOP( ret = recv( fd, &bytes_received, sizeof( bytes_received  ), 0 ), "Receiving" );
361
		if( ret != 4 )
362
			return dcc_abort( df, "MSG_PEEK'ed 4, but can only dequeue %d bytes", ret );
363
364
		bytes_received = ntohl( bytes_received );
365
366
		/* If any of this is actually happening, the receiver should buy a new IRC client */
367
368
		if ( bytes_received > df->bytes_sent )
369
			return dcc_abort( df, "Receiver magically received more bytes than sent ( %d > %d ) (BUG at receiver?)", bytes_received, df->bytes_sent );
370
371
		if ( bytes_received < file->bytes_transferred )
372
			return dcc_abort( df, "Receiver lost bytes? ( has %d, had %d ) (BUG at receiver?)", bytes_received, file->bytes_transferred );
373
		
374
		file->bytes_transferred = bytes_received;
375
	
376
		if( file->bytes_transferred >= file->file_size ) {
377
			dcc_finish( file );
378
			return FALSE;
379
		}
380
	
381
		return TRUE;
382
	}
383
384
	return TRUE;
385
}
386
387
gboolean dccs_recv_start( file_transfer_t *ft )
388
{
389
	dcc_file_transfer_t *df = ft->priv;
390
	struct sockaddr_storage *saddr = &df->saddr;
391
	int fd;
392
	char ipaddr[INET6_ADDRSTRLEN]; 
393
	socklen_t sa_len = saddr->ss_family == AF_INET ? 
394
		sizeof( struct sockaddr_in ) : sizeof( struct sockaddr_in6 );
395
	
396
	if( !ft->write )
397
		return dcc_abort( df, "BUG: protocol didn't register write()" );
398
	
399
	ASSERTSOCKOP( fd = df->fd = socket( saddr->ss_family, SOCK_STREAM, 0 ) , "Opening Socket" );
400
401
	sock_make_nonblocking( fd );
402
403
	if( ( connect( fd, (struct sockaddr *)saddr, sa_len ) == -1 ) &&
404
	    ( errno != EINPROGRESS ) )
405
		return dcc_abort( df, "Connecting to %s:%d : %s", 
406
			inet_ntop( saddr->ss_family, 
407
				saddr->ss_family == AF_INET ? 
408
				    ( void* ) &( ( struct sockaddr_in *) saddr )->sin_addr.s_addr :
409
				    ( void* ) &( ( struct sockaddr_in6 *) saddr )->sin6_addr.s6_addr,
410
				ipaddr, 
411
				sizeof( ipaddr ) ),
412
			ntohs( saddr->ss_family == AF_INET ?
413
			    ( ( struct sockaddr_in *) saddr )->sin_port :
414
			    ( ( struct sockaddr_in6 *) saddr )->sin6_port ),
415
			strerror( errno ) );
416
417
	ft->status = FT_STATUS_CONNECTING;
418
419
	/* watch */
420
	df->watch_out = b_input_add( df->fd, GAIM_INPUT_WRITE, dccs_recv_proto, df );
421
	ft->write_request = dccs_recv_write_request;
422
423
	return TRUE;
424
}
425
426
gboolean dccs_recv_proto( gpointer data, gint fd, b_input_condition cond)
427
{
428
	dcc_file_transfer_t *df = data;
429
	file_transfer_t *ft = df->ft;
430
	short revents;
431
432
	if( !dcc_poll( df, fd, &revents ) )
433
		return FALSE;
434
	
435
	if( ( revents & POLLOUT ) &&
436
	    ( ft->status & FT_STATUS_CONNECTING ) )
437
	{
438
		ft->status = FT_STATUS_TRANSFERRING;
439
		if ( !dcc_check_maxseg( df, fd ) )
440
			return FALSE;
441
442
		//df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_recv_proto, df );
443
444
		df->watch_out = 0;
445
		return FALSE;
446
	}
447
448
	if( revents & POLLIN )
449
	{
450
		int ret, done;
451
452
		ASSERTSOCKOP( ret = recv( fd, ft->buffer, sizeof( ft->buffer ), 0 ), "Receiving" );
453
454
		if( ret == 0 )
455
			return dcc_abort( df, "Remote end closed connection" );
456
457
		df->bytes_sent += ret;
458
459
		done = df->bytes_sent >= ft->file_size;
460
461
		if( ( ( df->bytes_sent - ft->bytes_transferred ) > DCC_PACKET_SIZE ) ||
462
		    done )
463
		{
464
			int ack, ackret;
465
			ack = htonl( ft->bytes_transferred = df->bytes_sent );
466
467
			ASSERTSOCKOP( ackret = send( fd, &ack, 4, 0 ), "Sending DCC ACK" );
468
			
469
			if ( ackret != 4 )
470
				return dcc_abort( df, "Error sending DCC ACK, sent %d instead of 4 bytes", ackret );
471
		}
472
		
473
		if( !ft->write( df->ft, ft->buffer, ret ) )
474
			return FALSE;
475
476
		if( done )
477
		{
478
			closesocket( fd );
479
			dcc_finish( ft );
480
481
			df->watch_in = 0;
482
			return FALSE;
483
		}
484
485
		df->watch_in = 0;
486
		return FALSE;
487
	}
488
489
	return TRUE;
490
}
491
492
gboolean dccs_recv_write_request( file_transfer_t *ft )
493
{
494
	dcc_file_transfer_t *df = ft->priv;
495
496
	if( df->watch_in )
497
		return dcc_abort( df, "BUG: write_request() called while watching" );
498
499
	df->watch_in = b_input_add( df->fd, GAIM_INPUT_READ, dccs_recv_proto, df );
500
501
	return TRUE;
502
}
503
504
gboolean dccs_send_can_write( gpointer data, gint fd, b_input_condition cond )
505
{
506
	struct dcc_file_transfer *df = data;
507
	df->watch_out = 0;
508
509
	df->ft->write_request( df->ft );
510
	return FALSE;
511
}
512
513
/* 
514
 * Incoming data.
515
 * 
516
 */
517
gboolean dccs_send_write( file_transfer_t *file, char *data, unsigned int data_len )
518
{
519
	dcc_file_transfer_t *df = file->priv;
520
	int ret;
521
522
	receivedchunks++; receiveddata += data_len;
523
524
	if( df->watch_out )
525
		return dcc_abort( df, "BUG: write() called while watching" );
526
527
	ASSERTSOCKOP( ret = send( df->fd, data, data_len, 0 ), "Sending data" );
528
529
	if( ret == 0 )
530
		return dcc_abort( df, "Remote end closed connection" );
531
532
	/* TODO: this should really not be fatal */
533
	if( ret < data_len )
534
		return dcc_abort( df, "send() sent %d instead of %d", ret, data_len );
535
536
	df->bytes_sent += ret;
537
538
	if( df->bytes_sent < df->ft->file_size )
539
		df->watch_out = b_input_add( df->fd, GAIM_INPUT_WRITE, dccs_send_can_write, df );
540
541
	return TRUE;
542
}
543
544
/*
545
 * Cleans up after a transfer.
546
 */
547
static void dcc_close( file_transfer_t *file )
548
{
549
	dcc_file_transfer_t *df = file->priv;
550
551
	if( file->free )
552
		file->free( file );
553
	
554
	closesocket( df->fd );
555
556
	if( df->watch_in )
557
		b_event_remove( df->watch_in );
558
559
	if( df->watch_out )
560
		b_event_remove( df->watch_out );
561
	
562
	df->ic->irc->file_transfers = g_slist_remove( df->ic->irc->file_transfers, file );
563
	
564
	g_free( df );
565
	g_free( file->file_name );
566
	g_free( file );
567
}
568
569
void dcc_finish( file_transfer_t *file )
570
{
571
	file->status |= FT_STATUS_FINISHED;
572
	
573
	if( file->finished )
574
		file->finished( file );
575
576
	dcc_close( file );
577
}
578
579
/* 
580
 * DCC SEND <filename> <IP> <port> <filesize>
581
 *
582
 * filename can be in "" or not. If it is, " can probably be escaped...
583
 * IP can be an unsigned int (IPV4) or something else (IPV6)
584
 * 
585
 */
586
file_transfer_t *dcc_request( struct im_connection *ic, char *line )
587
{
588
	char *pattern = "SEND"
589
		" (([^\"][^ ]*)|\"([^\"]|\\\")*\")"
590
		" (([0-9]*)|([^ ]*))"
591
		" ([0-9]*)"
592
		" ([0-9]*)\001";
593
	regmatch_t pmatch[9];
594
	regex_t re;
595
	file_transfer_t *ft;
596
	dcc_file_transfer_t *df;
597
	char errbuf[256];
598
	int regerrcode, gret;
599
600
	if( ( regerrcode = regcomp( &re, pattern, REG_EXTENDED ) ) ||
601
	    ( regerrcode = regexec( &re, line, 9, pmatch, 0 ) ) ) {
602
		regerror( regerrcode,&re,errbuf,sizeof( errbuf ) );
603
		imcb_log( ic, 
604
			  "DCC: error parsing 'DCC SEND': %s, line: %s", 
605
			  errbuf, line );
606
		return NULL;
607
	}
608
609
	if( ( pmatch[1].rm_so > 0 ) &&
610
	    ( pmatch[4].rm_so > 0 ) &&
611
	    ( pmatch[7].rm_so > 0 ) &&
612
	    ( pmatch[8].rm_so > 0 ) )
613
	{
614
		char *input = g_strdup( line );
615
		char *filename, *host, *port;
616
		size_t filesize;
617
		struct addrinfo hints, *rp;
618
619
		/* "filename" or filename */
620
		if ( pmatch[2].rm_so > 0 )
621
		{
622
			input[pmatch[2].rm_eo] = '\0';
623
			filename = input + pmatch[2].rm_so;
624
		} else
625
		{
626
			input[pmatch[3].rm_eo] = '\0';
627
			filename = input + pmatch[3].rm_so;
628
		}
629
			
630
		input[pmatch[4].rm_eo] = '\0';
631
632
		/* number means ipv4, something else means ipv6 */
633
		if ( pmatch[5].rm_so > 0 )
634
		{
635
			struct in_addr ipaddr = { .s_addr = htonl( atoi( input + pmatch[5].rm_so ) ) };
636
			host = inet_ntoa( ipaddr );
637
		} else
638
		{
639
			/* Contains non-numbers, hopefully an IPV6 address */
640
			host = input + pmatch[6].rm_so;
641
		}
642
643
		input[pmatch[7].rm_eo] = '\0';
644
		input[pmatch[8].rm_eo] = '\0';
645
646
		port = input + pmatch[7].rm_so;
647
		filesize = atoll( input + pmatch[8].rm_so );
648
649
		memset( &hints, 0, sizeof ( struct addrinfo ) );
650
		if ( ( gret = getaddrinfo( host, port, &hints, &rp ) ) )
651
		{
652
			g_free( input );
653
			imcb_log( ic, "DCC: getaddrinfo() failed with %s "
654
				  "when parsing incoming 'DCC SEND': "
655
				  "host %s, port %s", 
656
				  gai_strerror( gret ), host, port );
657
			return NULL;
658
		}
659
660
		df = dcc_alloc_transfer( filename, filesize, ic );
661
		ft = df->ft;
662
		ft->sending = TRUE;
663
		memcpy( &df->saddr, rp->ai_addr, rp->ai_addrlen );
664
665
		freeaddrinfo( rp );
666
		g_free( input );
667
668
		df->ic->irc->file_transfers = g_slist_prepend( df->ic->irc->file_transfers, ft );
669
670
		return ft;
671
	}
672
673
	imcb_log( ic, "DCC: couldnt parse 'DCC SEND' line: %s", line );
674
675
	return NULL;
676
}
677
(-)bitlbee-1.2/dcc.h (+86 lines)
Line 0 Link Here
1
/********************************************************************\
2
* BitlBee -- An IRC to other IM-networks gateway                     *
3
*                                                                    *
4
* Copyright 2006 Marijn Kruisselbrink and others                     *
5
* Copyright 2007 Uli Meis <a.sporto+bee@gmail.com>                   *
6
\********************************************************************/
7
8
/*
9
  This program is free software; you can redistribute it and/or modify
10
  it under the terms of the GNU General Public License as published by
11
  the Free Software Foundation; either version 2 of the License, or
12
  (at your option) any later version.
13
14
  This program is distributed in the hope that it will be useful,
15
  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
  GNU General Public License for more details.
18
19
  You should have received a copy of the GNU General Public License with
20
  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
21
  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22
  Suite 330, Boston, MA  02111-1307  USA
23
*/
24
25
/* 
26
 * DCC SEND
27
 *
28
 * Historically, DCC means send 1024 Bytes and wait for a 4 byte reply
29
 * acknowledging all transferred data. This is ridiculous for two reasons.  The
30
 * first being that TCP is a stream oriented protocol that doesn't care much
31
 * about your idea of a packet. The second reason being that TCP is a reliable
32
 * transfer protocol with its own sophisticated ACK mechanism, making DCCs ACK
33
 * mechanism look like a joke. For these reasons, DCCs requirements have
34
 * (hopefully) been relaxed in most implementations and this implementation
35
 * depends upon at least the following: The 1024 bytes need not be transferred
36
 * at once, i.e. packets can be smaller. A second relaxation has apparently
37
 * gotten the name "DCC SEND ahead" which basically means to not give a damn
38
 * about those DCC ACKs and just send data as you please. This behaviour is
39
 * enabled by default. Note that this also means that packets may be as large
40
 * as the maximum segment size.
41
 */ 
42
43
#ifndef _DCC_H
44
#define _DCC_H
45
46
/* Send an ACK after receiving this amount of data */
47
#define DCC_PACKET_SIZE 1024
48
49
typedef struct dcc_file_transfer {
50
51
	struct im_connection *ic;
52
53
	/*
54
	 * Depending in the status of the file transfer, this is either the socket that is
55
	 * being listened on for connections, or the socket over which the file transfer is
56
	 * taking place.
57
	 */
58
	int fd;
59
	
60
	/*
61
	 * IDs returned by b_input_add for watch_ing over the above socket.
62
	 */
63
	gint watch_in;   /* readable */
64
	gint watch_out;  /* writable */
65
	
66
	/*
67
	 * The total amount of bytes that have been sent to the irc client.
68
	 */
69
	size_t bytes_sent;
70
	
71
	/* imc's handle */
72
	file_transfer_t *ft;
73
74
	/* if we're receiving, this is the sender's socket address */
75
	struct sockaddr_storage saddr;
76
77
} dcc_file_transfer_t;
78
79
file_transfer_t *dccs_send_start( struct im_connection *ic, char *user_nick, char *file_name, size_t file_size );
80
81
void dcc_canceled( file_transfer_t *file, char *reason );
82
83
gboolean dccs_send_write( file_transfer_t *file, char *data, unsigned int data_size );
84
85
file_transfer_t *dcc_request( struct im_connection *ic, char *line );
86
#endif
(-)bitlbee-1.2/debian/bitlbee.init (+89 lines)
Line 0 Link Here
1
#! /bin/sh
2
### BEGIN INIT INFO
3
# Provides:          bitlbee
4
# Required-Start:    $remote_fs $syslog
5
# Required-Stop:     $remote_fs $syslog
6
# Default-Start:     2 3 4 5
7
# Default-Stop:      1
8
### END INIT INFO
9
#
10
# Init script for BitlBee Debian package. Based on skeleton init script:
11
#
12
# Version:	@(#)skeleton  2.85-23  28-Jul-2004  miquels@cistron.nl
13
#
14
15
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16
DESC="BitlBee IRC/IM gateway"
17
NAME=bitlbee
18
DAEMON=/usr/sbin/$NAME
19
PIDFILE=/var/run/$NAME.pid
20
SCRIPTNAME=/etc/init.d/$NAME
21
22
# Gracefully exit if the package has been removed.
23
[ -x $DAEMON ] || exit 0
24
25
# Default value
26
BITLBEE_PORT=6667
27
BITLBEE_OPTS=-F
28
29
# Read config file if it is present.
30
if [ -r /etc/default/$NAME ]; then
31
	. /etc/default/$NAME
32
fi
33
34
[ "$BITLBEE_DISABLED" = "1" ] && exit 0
35
36
37
#
38
#	Function that starts the daemon/service.
39
#
40
d_start() {
41
	# Make sure BitlBee can actually write its PID...
42
	touch /var/run/bitlbee.pid
43
	chown bitlbee /var/run/bitlbee.pid
44
	
45
	start-stop-daemon --start --quiet --pidfile $PIDFILE \
46
		-c bitlbee: \
47
		--exec $DAEMON -- -p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS
48
}
49
50
#
51
#	Function that stops the daemon/service.
52
#
53
d_stop() {
54
	start-stop-daemon --stop --quiet --pidfile $PIDFILE \
55
		--name $NAME
56
}
57
58
59
case "$1" in
60
  start)
61
	echo -n "Starting $DESC: $NAME"
62
	d_start
63
	echo "."
64
	;;
65
  stop)
66
	echo -n "Stopping $DESC: $NAME"
67
	d_stop
68
	echo "."
69
	;;
70
  #reload)
71
	#
72
	#	No reload target, but there's a REHASH command which we
73
	#	might use later...
74
	#
75
  #;;
76
  restart|force-reload)
77
	echo -n "Restarting $DESC: $NAME"
78
	d_stop
79
	sleep 1
80
	d_start
81
	echo "."
82
	;;
83
  *)
84
	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
85
	exit 1
86
	;;
87
esac
88
89
exit 0
(-)bitlbee-1.2/debian/changelog (+356 lines)
Line 0 Link Here
1
bitlbee (1.2-4) unstable; urgency=low
2
3
  * Not a real release, just a placeholder for the changelog.
4
  * Fixed init script to use the BITLBEE_OPTS variable, not an undefined
5
    DAEMON_OPT.
6
  * Added dependency information to the init script. (Closes: #472567)
7
8
 -- Wilmer van der Gaast <wilmer@gaast.net>  Sat, 29 Mar 2008 21:10:33 +0000
9
10
bitlbee (1.2-3) unstable; urgency=low
11
12
  * Removed DEB_BUILD_OPTIONS again (forgot to apply that change to the 1.2
13
    branch when I finished 1.0.4-2, things diverged too much anyway.)
14
    Closes: #472540.
15
16
 -- Wilmer van der Gaast <wilmer@gaast.net>  Mon, 24 Mar 2008 21:10:14 +0000
17
18
bitlbee (1.2-2) unstable; urgency=low
19
20
  * Fixed some packaging issues reported by IRC and e-mail. (Closes: #472373)
21
  * Fixed proxy support. (Closes: #472395)
22
  * Added a BitlBee group so only root can edit the configs and BitlBee can
23
    just *read* it.
24
  * Manually deleting /var/lib/bitlbee/ when purging, deluser doesn't want to
25
    do it.
26
27
 -- Wilmer van der Gaast <wilmer@gaast.net>  Mon, 24 Mar 2008 19:48:24 +0000
28
29
bitlbee (1.2-1) unstable; urgency=low
30
31
  * New upstream release. (Closes: #325017, #386914, #437515)
32
  * With hopefully completely sane charset handling (Closes: #296145)
33
  * Switched to the new forking daemon mode. Added /etc/default/bitlbee
34
    file, an init script. People who want to stick with inetd can do so, see
35
    the defaults file.
36
    (Closes: #460741, #466171, #294585, #345038, #306452, #392682)
37
  * Got rid of debconf Woody compatibility stuff.
38
  * No more MPL code in BitlBee, thanks to the Jabber module rewrite!
39
  * Added Italian translation, sorry for taking so long! (Closes: #448238)
40
  * Added libevent dependency (more reliable event handling).
41
  * Removed GLib 1.x dependency because BitlBee really requires GLib >=2.4.
42
43
 -- Wilmer van der Gaast <wilmer@gaast.net>  Tue, 18 Mar 2008 23:44:19 +0000
44
45
bitlbee (1.0.4-2) unstable; urgency=low
46
47
  * Removed $DEB_BUILD_OPTIONS because apparently buildds fill it with crap.
48
    (Closes: #458717)
49
50
 -- Wilmer van der Gaast <wilmer@gaast.net>  Mon, 11 Feb 2008 19:15:33 +0000
51
52
bitlbee (1.0.4-1) unstable; urgency=low
53
54
  * New upstream release.
55
  * Changed libnss-dev dependency. (Closes: #370442)
56
  * Added build-indep rule to debian/rules. (Closes: #395673)
57
58
 -- Wilmer van der Gaast <wilmer@gaast.net>  Wed, 29 Aug 2007 20:24:28 +0100
59
60
bitlbee (1.0.3-1.3) unstable; urgency=low
61
62
  * Non-maintainer upload to fix a minor error.
63
  * Remove extra debian/#rules#
64
65
 -- Christian Perrier <bubulle@debian.org>  Tue, 20 Feb 2007 07:49:18 +0100
66
67
bitlbee (1.0.3-1.2) unstable; urgency=low
68
69
  * Non-maintainer upload to fix pending l10n issues.
70
  * Debconf translations:
71
    - Portuguese. Closes: #386348
72
73
 -- Christian Perrier <bubulle@debian.org>  Sun, 18 Feb 2007 20:23:28 +0100
74
75
bitlbee (1.0.3-1.1) unstable; urgency=low
76
77
  * Non-maintainer upload.
78
  * debian/control: Replace netkit-inetd dependency with a versioned
79
    dependency on netbase.  netbase provides the appropriate inetd
80
    dependency.  Closes: #382682.
81
82
 -- Roger Leigh <rleigh@debian.org>  Sun, 20 Aug 2006 17:07:02 +0100
83
84
bitlbee (1.0.3-1) unstable; urgency=low
85
86
  * New upstream release.
87
88
 -- Wilmer van der Gaast <wilmer@gaast.net>  Sat,  8 Jul 2006 11:32:57 +0200
89
90
bitlbee (1.0.2-2) unstable; urgency=low
91
92
  * Added a po-debconf build-dependency, which I forgot when removing the
93
    Woody hack from 1.0.2-1. (Closes: #361503)
94
95
 -- Wilmer van der Gaast <wilmer@gaast.net>  Sat,  8 Apr 2006 22:09:19 +0200
96
97
bitlbee (1.0.2-1) unstable; urgency=low
98
99
  * New upstream release.
100
  * Avoids calling update-inetd if it's unavailable. (Closes: #350463)
101
  * Also using userdel instead of deluser now to avoid another bug. :-)
102
  * Only creates an inetd.conf entry when installing for the first time.
103
    (Closes: #349570) (This unfortunately breaks dpkg-reconfigure, but at
104
    least there's a warning...)
105
106
 -- Wilmer van der Gaast <wilmer@gaast.net>  Sat,  8 Apr 2006 14:17:52 +0200
107
108
bitlbee (1.0.1-1) unstable; urgency=low
109
110
  * New upstream release
111
112
 -- Wilmer van der Gaast <wilmer@gaast.net>  Tue, 17 Jan 2006 17:26:20 +0100
113
114
bitlbee (1.0-1) unstable; urgency=low
115
116
  * New upstream release
117
  * bitlbee has a useless Build-Depends: on debconf-2.0 (Closes:
118
    #341783)
119
120
 -- Wilmer van der Gaast <wilmer@gaast.net>  Mon,  5 Dec 2005 17:59:07 +0100
121
122
bitlbee (0.99-1) unstable; urgency=low
123
124
  * Should build on Debian GNU/kFreeBSD now. (Closes: #336965)
125
  * New upstream version.
126
127
 -- Wilmer van der Gaast <wilmer@gaast.net>  Thu,  3 Nov 2005 21:06:53 +0100
128
129
bitlbee (0.93a-1) unstable; urgency=low
130
131
  * Added Swedish and Spanish translations. (Closes: #333881, #331302)
132
  * Changed debconf dependency. (Closes: #331762)
133
  * Changed libgnutls dependency. (Closes: #335751)
134
  * Fixed one crash-on-disconnect bug in the OSCAR module.
135
136
 -- Wilmer van der Gaast <wilmer@gaast.net>  Tue,  1 Nov 2005 18:25:56 +0100
137
138
bitlbee (0.92-2) unstable; urgency=low
139
140
  * Added the patch that allows to connect to alternate Jabber servers.
141
    Necessary for connecting to Google Talk. (Closes: #324832)
142
  * Also possibly fixes some more problems with losing data when disk is
143
    full.
144
  * Added Vietnamese and Brazilian DebConf translations. Sorry for being
145
    so late. (Closes: #297058, #313158)
146
147
 -- Wilmer van der Gaast <lintux@debian.org>  Thu,  8 Sep 2005 19:55:56 +0200
148
149
bitlbee (0.92-1) unstable; urgency=low
150
151
  * New upstream release.
152
  * Implemented support for the IRC WATCH command and got rid of the
153
    IRC_MAX_ARGS limit. (Closes: #283504)
154
  * Added Czech translation. (Closes: #293615)
155
156
 -- Wilmer van der Gaast <lintux@debian.org>  Thu, 24 Feb 2005 17:11:32 +0100
157
158
bitlbee (0.91-3) unstable; urgency=low
159
160
  * Fixed a small bug in postrm which caused problems when removing/upgrading.
161
162
 -- Wilmer van der Gaast <lintux@debian.org>  Sun, 10 Oct 2004 08:59:52 +0200
163
164
bitlbee (0.91-2) unstable; urgency=low
165
166
  * Removed the part that messes with tcpd configuration files because it
167
    causes troubles for some people and because it's no problem for users
168
    to edit those files by hand. (Closes: #275418)
169
    When upgrading from previous versions, the bitlbee line won't be removed
170
    from your tcpd conffiles. (This is only done when purging a BitlBee
171
    install) You don't have to worry about BitlBee suddenly opening for the
172
    whole world because of the removal of this feature.
173
  * Updated German translation. (Closes: #274655)
174
  * Removed the unreliable check for an existing BitlBee installation (a
175
    /etc/passwd grep) and replaced it with something more reliable.
176
177
 -- Wilmer van der Gaast <lintux@debian.org>  Sat,  9 Oct 2004 19:06:33 +0200
178
179
bitlbee (0.91-1) unstable; urgency=low
180
181
  * info-command works for Jabber connections now. (Closes: #232712)
182
  * Saner code for duplicate nickname prevention. (Closes: #234285)
183
  * Support for Jabber connections over SSL. (Closes: #252458)
184
  * If the user chooses for noinetd.conf installation, this setting is now
185
    remembered during reinstalls. (Closes: #260533)
186
  * An up-to-date Japanse DebConf template. (Closes: #271091)
187
188
 -- Wilmer van der Gaast <lintux@debian.org>  Sat, 25 Sep 2004 18:18:17 +0200
189
190
bitlbee (0.90a-2) unstable; urgency=low
191
192
  * Using libgnutls11 now. (Closes: #264740)
193
  * postinst no longer appends newlines to hosts.* because grep already
194
    makes sure the last line is terminated with a newline. (Closes: #253278)
195
  * Added Japanese DebConf templates. (Closes: #259801)
196
  * Installing BitlBee in inetd.conf is now optional. (Closes: #260533)
197
198
 -- Wilmer van der Gaast <lintux@debian.org>  Mon,  6 Sep 2004 20:04:22 +0200
199
200
bitlbee (0.90a-1) unstable; urgency=low
201
202
  * New upstream release.
203
204
 -- Wilmer van der Gaast <lintux@debian.org>  Mon, 28 Jun 2004 20:30:26 +0200
205
206
bitlbee (0.90-1) unstable; urgency=low
207
208
  * New upstream release.
209
  * Added German DebConf translation. (Closes: #250787)
210
211
 -- Wilmer van der Gaast <lintux@debian.org>  Sat, 29 May 2004 11:51:56 +0200
212
213
bitlbee (0.85a-1) unstable; urgency=low
214
215
  * New upstream release. This one should fix build problems on arm.
216
217
 -- Wilmer van der Gaast <lintux@debian.org>  Thu, 25 Mar 2004 00:12:33 +0100
218
219
bitlbee (0.85-1) unstable; urgency=low
220
221
  * New upstream release.
222
  * This version has a command line switch to specify alternate configuration
223
    files/settings directories. (Closes: #207060)
224
225
 -- Wilmer van der Gaast <lintux@debian.org>  Sat, 13 Mar 2004 22:19:35 +0100
226
227
bitlbee (0.84-2) unstable; urgency=low
228
229
  * Converted debconf templates to po2debconf format, without breaking
230
    building on older (non-po2debconf) systems. Thanks to Martin Quinson.
231
    (Closes: #205816)
232
  * Added French debconf templates. Thanks to Christian Perrier.
233
    (Closes: #206593)
234
235
 -- Wilmer van der Gaast <lintux@debian.org>  Wed,  3 Mar 2004 21:19:12 +0100
236
237
bitlbee (0.84-1) unstable; urgency=low
238
239
  * New upstream release.
240
241
 -- Wilmer van der Gaast <lintux@debian.org>  Fri, 13 Feb 2004 20:13:53 +0100
242
243
bitlbee (0.83-2) unstable; urgency=low
244
245
  * Removed libsoup dependency, BitlBee now uses libgnutls directly.
246
    (Closes: #208475, #230895)
247
  * Now including preprocessed documentation files to save some time on
248
    slow buildd's (and fix build problems on archs without a working
249
    sgmltools package).
250
251
 -- Wilmer van der Gaast <lintux@debian.org>  Fri,  6 Feb 2004 01:26:27 +0100
252
253
bitlbee (0.83-1) unstable; urgency=low
254
255
  * Added bitlbee.conf to conffiles. Should've done that before, sorry.
256
  * Sorry, still with MSN support disabled, because Debian's default
257
    libsoup package won't work with BitlBee-MSN.
258
259
 -- Wilmer van der Gaast <lintux@debian.org>  Wed, 31 Dec 2003 00:56:57 +0100
260
261
bitlbee (0.82-1) unstable; urgency=low
262
263
  * New upstream release.
264
  * Disabled MSN support in the Debian version for now, because it needs
265
    a patched version of libsoup. If you want MSN support, you'll have to
266
    create one yourself and install a patched version of libsoup.
267
268
 -- Wilmer van der Gaast <lintux@debian.org>  Fri, 31 Oct 2003 21:51:01 +0100
269
270
bitlbee (0.81a-1) unstable; urgency=low
271
272
  * New upstream release.
273
274
 -- Wilmer van der Gaast <lintux@debian.org>  Wed, 16 Oct 2003 16:21:31 +0200
275
276
bitlbee (0.81-1) unstable; urgency=low
277
278
  * New upstream release.
279
  * Fixes Yahoo! problems. (Closes: #213876)
280
281
 -- Wilmer van der Gaast <lintux@debian.org>  Wed, 15 Oct 2003 16:00:00 +0200
282
283
bitlbee (0.80-1) unstable; urgency=low
284
285
  * New upstream release.
286
  * preinst now unlinks the old helpfile while upgrading, see README.Debian
287
    for details.
288
  * 'Upgraded' to standards 3.5.9.
289
  * "jabber: Non-ascii away messages not supported" patch included.
290
    (Closes: #195852)
291
292
 -- Wilmer van der Gaast <lintux@debian.org>  Tue, 24 Jun 2003 20:00:00 +0200
293
294
bitlbee (0.74a-1) unstable; urgency=low
295
296
  * This one actually does contain the bugfix 0.74 should've had.
297
298
 -- Wilmer van der Gaast <lintux@debian.org>  Wed, 11 Jun 2003 13:44:01 +0200
299
300
bitlbee (0.74-1) unstable; urgency=high
301
302
  * Security release, fixing a little not-too-dangerous security bug.
303
304
 -- Wilmer van der Gaast <lintux@debian.org>  Tue, 10 Jun 2003 22:50:19 +0200
305
306
bitlbee (0.73-1) unstable; urgency=low
307
308
  * New upstream release.
309
310
 -- Wilmer van der Gaast <lintux@debian.org>  Sun, 13 Apr 2003 01:20:49 +0200
311
312
bitlbee (0.72-2) unstable; urgency=low
313
314
  * Now uses '127.0.0.1' as default for hosts.allow instead of 'localhost'.
315
    (Closes: #174219)
316
  * Fixed some other portability issues. (Closes: #177394)
317
  * Added w3m builddep, needed for .txt documentation generation.
318
  * Removed jadetex builddep because it seems not to be necessary after all.
319
320
 -- Wilmer van der Gaast <lintux@debian.org>  Tue, 21 Jan 2003 01:35:46 +0100
321
322
bitlbee (0.72-1) unstable; urgency=low
323
324
  * BitlBee doesn't have tcpd in it anymore; external tcpd is used now.
325
  * Added an examples/ directory.
326
  * Fixed arm/ppc/s390 portability issue on char signedness. (Closes: #161026)
327
328
 -- Wilmer van der Gaast <lintux@debian.org>  Thu, 19 Dec 2002 00:24:29 +0100
329
330
bitlbee (0.71-1) unstable; urgency=low
331
332
  * New upstream release.
333
334
 -- Wilmer van der Gaast <lintux@debian.org>  Mon, 16 Sep 2002 01:02:09 +0200
335
336
bitlbee (0.7-2) unstable; urgency=low
337
338
  * Second try at a good upload.
339
340
 -- Wilmer van der Gaast <lintux@debian.org>  Thu, 15 Aug 2002 20:14:54 +0200
341
342
bitlbee (0.7-1) unstable; urgency=low
343
344
  * First public release. (Closes: #153190)
345
346
 -- Wilmer van der Gaast <lintux@debian.org>  Sat, 10 Aug 2002 04:47:07 +0200
347
348
bitlbee (0.6-1) unstable; urgency=low
349
350
  * Initial Release. (Testing only, not for release.)
351
352
 -- Wilmer van der Gaast <lintux@debian.org>  Wed, 10 Jul 2002 11:02:28 +0200
353
354
Local variables:
355
mode: debian-changelog
356
End:
(-)bitlbee-1.2/debian/conffiles (+3 lines)
Line 0 Link Here
1
/etc/bitlbee/motd.txt
2
/etc/bitlbee/bitlbee.conf
3
/etc/init.d/bitlbee
(-)bitlbee-1.2/debian/config (+19 lines)
Line 0 Link Here
1
#!/bin/sh -e
2
3
. /usr/share/debconf/confmodule
4
5
db_title BitlBee
6
7
db_get bitlbee/serveport
8
if [ "$RET" = "stillhavetoask" ]; then
9
	if netstat -ltn | grep ':6667' 2> /dev/null > /dev/null; then
10
		port=6668;
11
	else
12
		port=6667;
13
	fi
14
	db_set bitlbee/serveport $port;
15
fi
16
17
if db_input medium bitlbee/serveport; then
18
	db_go;
19
fi
(-)bitlbee-1.2/debian/control (+13 lines)
Line 0 Link Here
1
Source: bitlbee
2
Section: net
3
Priority: optional
4
Maintainer: Wilmer van der Gaast <wilmer@gaast.net>
5
Standards-Version: 3.5.9
6
Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf
7
8
Package: bitlbee
9
Architecture: any
10
Depends: ${shlibs:Depends}, adduser, net-tools, ${debconf-depends}, debianutils (>= 1.16)
11
Description: An IRC to other chat networks gateway
12
 This program can be used as an IRC server which forwards everything you
13
 say to people on other chat networks: Jabber, ICQ, AIM, MSN and Yahoo.
(-)bitlbee-1.2/debian/copyright (+393 lines)
Line 0 Link Here
1
This package was debianized by Wilmer van der Gaast <lintux@debian.org> on
2
Mon,  8 Jul 2002 13:17:42 +0200.
3
4
The source can be downloaded from http://www.bitlbee.org/
5
6
Authors: Wilmer van der Gaast, Sjoerd Hemminga, Jelmer Vernooij,
7
         Maurits Dijkstra and others.
8
9
Mainly Copyright 2002-2004 Wilmer van der Gaast.
10
Some parts are borrowed from Gaim (version 0.58) <http://gaim.sf.net/>.
11
For the copyrights on those parts, please read the Gaim source code.
12
13
BitlBee License:
14
15
============================================================================
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
18
  the Free Software Foundation; either version 2 of the License, or
19
  (at your option) any later version.
20
21
  This program is distributed in the hope that it will be useful,
22
  but WITHOUT ANY WARRANTY; without even the implied warranty of
23
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
  GNU General Public License for more details.
25
26
  You should have received a copy of the GNU General Public License with
27
  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
28
  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
29
  Suite 330, Boston, MA  02111-1307  USA
30
============================================================================
31
32
33
34
The SGML-formatted documentation is written by Jelmer Vernooij
35
<jelmer@nl.linux.org> under the GNU Free Documentation License:
36
37
============================================================================
38
		GNU Free Documentation License
39
		   Version 1.1, March 2000
40
41
 Copyright (C) 2000  Free Software Foundation, Inc.
42
     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
43
 Everyone is permitted to copy and distribute verbatim copies
44
 of this license document, but changing it is not allowed.
45
46
47
0. PREAMBLE
48
49
The purpose of this License is to make a manual, textbook, or other
50
written document "free" in the sense of freedom: to assure everyone
51
the effective freedom to copy and redistribute it, with or without
52
modifying it, either commercially or noncommercially.  Secondarily,
53
this License preserves for the author and publisher a way to get
54
credit for their work, while not being considered responsible for
55
modifications made by others.
56
57
This License is a kind of "copyleft", which means that derivative
58
works of the document must themselves be free in the same sense.  It
59
complements the GNU General Public License, which is a copyleft
60
license designed for free software.
61
62
We have designed this License in order to use it for manuals for free
63
software, because free software needs free documentation: a free
64
program should come with manuals providing the same freedoms that the
65
software does.  But this License is not limited to software manuals;
66
it can be used for any textual work, regardless of subject matter or
67
whether it is published as a printed book.  We recommend this License
68
principally for works whose purpose is instruction or reference.
69
70
71
1. APPLICABILITY AND DEFINITIONS
72
73
This License applies to any manual or other work that contains a
74
notice placed by the copyright holder saying it can be distributed
75
under the terms of this License.  The "Document", below, refers to any
76
such manual or work.  Any member of the public is a licensee, and is
77
addressed as "you".
78
79
A "Modified Version" of the Document means any work containing the
80
Document or a portion of it, either copied verbatim, or with
81
modifications and/or translated into another language.
82
83
A "Secondary Section" is a named appendix or a front-matter section of
84
the Document that deals exclusively with the relationship of the
85
publishers or authors of the Document to the Document's overall subject
86
(or to related matters) and contains nothing that could fall directly
87
within that overall subject.  (For example, if the Document is in part a
88
textbook of mathematics, a Secondary Section may not explain any
89
mathematics.)  The relationship could be a matter of historical
90
connection with the subject or with related matters, or of legal,
91
commercial, philosophical, ethical or political position regarding
92
them.
93
94
The "Invariant Sections" are certain Secondary Sections whose titles
95
are designated, as being those of Invariant Sections, in the notice
96
that says that the Document is released under this License.
97
98
The "Cover Texts" are certain short passages of text that are listed,
99
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
100
the Document is released under this License.
101
102
A "Transparent" copy of the Document means a machine-readable copy,
103
represented in a format whose specification is available to the
104
general public, whose contents can be viewed and edited directly and
105
straightforwardly with generic text editors or (for images composed of
106
pixels) generic paint programs or (for drawings) some widely available
107
drawing editor, and that is suitable for input to text formatters or
108
for automatic translation to a variety of formats suitable for input
109
to text formatters.  A copy made in an otherwise Transparent file
110
format whose markup has been designed to thwart or discourage
111
subsequent modification by readers is not Transparent.  A copy that is
112
not "Transparent" is called "Opaque".
113
114
Examples of suitable formats for Transparent copies include plain
115
ASCII without markup, Texinfo input format, LaTeX input format, SGML
116
or XML using a publicly available DTD, and standard-conforming simple
117
HTML designed for human modification.  Opaque formats include
118
PostScript, PDF, proprietary formats that can be read and edited only
119
by proprietary word processors, SGML or XML for which the DTD and/or
120
processing tools are not generally available, and the
121
machine-generated HTML produced by some word processors for output
122
purposes only.
123
124
The "Title Page" means, for a printed book, the title page itself,
125
plus such following pages as are needed to hold, legibly, the material
126
this License requires to appear in the title page.  For works in
127
formats which do not have any title page as such, "Title Page" means
128
the text near the most prominent appearance of the work's title,
129
preceding the beginning of the body of the text.
130
131
132
2. VERBATIM COPYING
133
134
You may copy and distribute the Document in any medium, either
135
commercially or noncommercially, provided that this License, the
136
copyright notices, and the license notice saying this License applies
137
to the Document are reproduced in all copies, and that you add no other
138
conditions whatsoever to those of this License.  You may not use
139
technical measures to obstruct or control the reading or further
140
copying of the copies you make or distribute.  However, you may accept
141
compensation in exchange for copies.  If you distribute a large enough
142
number of copies you must also follow the conditions in section 3.
143
144
You may also lend copies, under the same conditions stated above, and
145
you may publicly display copies.
146
147
148
3. COPYING IN QUANTITY
149
150
If you publish printed copies of the Document numbering more than 100,
151
and the Document's license notice requires Cover Texts, you must enclose
152
the copies in covers that carry, clearly and legibly, all these Cover
153
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
154
the back cover.  Both covers must also clearly and legibly identify
155
you as the publisher of these copies.  The front cover must present
156
the full title with all words of the title equally prominent and
157
visible.  You may add other material on the covers in addition.
158
Copying with changes limited to the covers, as long as they preserve
159
the title of the Document and satisfy these conditions, can be treated
160
as verbatim copying in other respects.
161
162
If the required texts for either cover are too voluminous to fit
163
legibly, you should put the first ones listed (as many as fit
164
reasonably) on the actual cover, and continue the rest onto adjacent
165
pages.
166
167
If you publish or distribute Opaque copies of the Document numbering
168
more than 100, you must either include a machine-readable Transparent
169
copy along with each Opaque copy, or state in or with each Opaque copy
170
a publicly-accessible computer-network location containing a complete
171
Transparent copy of the Document, free of added material, which the
172
general network-using public has access to download anonymously at no
173
charge using public-standard network protocols.  If you use the latter
174
option, you must take reasonably prudent steps, when you begin
175
distribution of Opaque copies in quantity, to ensure that this
176
Transparent copy will remain thus accessible at the stated location
177
until at least one year after the last time you distribute an Opaque
178
copy (directly or through your agents or retailers) of that edition to
179
the public.
180
181
It is requested, but not required, that you contact the authors of the
182
Document well before redistributing any large number of copies, to give
183
them a chance to provide you with an updated version of the Document.
184
185
186
4. MODIFICATIONS
187
188
You may copy and distribute a Modified Version of the Document under
189
the conditions of sections 2 and 3 above, provided that you release
190
the Modified Version under precisely this License, with the Modified
191
Version filling the role of the Document, thus licensing distribution
192
and modification of the Modified Version to whoever possesses a copy
193
of it.  In addition, you must do these things in the Modified Version:
194
195
A. Use in the Title Page (and on the covers, if any) a title distinct
196
   from that of the Document, and from those of previous versions
197
   (which should, if there were any, be listed in the History section
198
   of the Document).  You may use the same title as a previous version
199
   if the original publisher of that version gives permission.
200
B. List on the Title Page, as authors, one or more persons or entities
201
   responsible for authorship of the modifications in the Modified
202
   Version, together with at least five of the principal authors of the
203
   Document (all of its principal authors, if it has less than five).
204
C. State on the Title page the name of the publisher of the
205
   Modified Version, as the publisher.
206
D. Preserve all the copyright notices of the Document.
207
E. Add an appropriate copyright notice for your modifications
208
   adjacent to the other copyright notices.
209
F. Include, immediately after the copyright notices, a license notice
210
   giving the public permission to use the Modified Version under the
211
   terms of this License, in the form shown in the Addendum below.
212
G. Preserve in that license notice the full lists of Invariant Sections
213
   and required Cover Texts given in the Document's license notice.
214
H. Include an unaltered copy of this License.
215
I. Preserve the section entitled "History", and its title, and add to
216
   it an item stating at least the title, year, new authors, and
217
   publisher of the Modified Version as given on the Title Page.  If
218
   there is no section entitled "History" in the Document, create one
219
   stating the title, year, authors, and publisher of the Document as
220
   given on its Title Page, then add an item describing the Modified
221
   Version as stated in the previous sentence.
222
J. Preserve the network location, if any, given in the Document for
223
   public access to a Transparent copy of the Document, and likewise
224
   the network locations given in the Document for previous versions
225
   it was based on.  These may be placed in the "History" section.
226
   You may omit a network location for a work that was published at
227
   least four years before the Document itself, or if the original
228
   publisher of the version it refers to gives permission.
229
K. In any section entitled "Acknowledgements" or "Dedications",
230
   preserve the section's title, and preserve in the section all the
231
   substance and tone of each of the contributor acknowledgements
232
   and/or dedications given therein.
233
L. Preserve all the Invariant Sections of the Document,
234
   unaltered in their text and in their titles.  Section numbers
235
   or the equivalent are not considered part of the section titles.
236
M. Delete any section entitled "Endorsements".  Such a section
237
   may not be included in the Modified Version.
238
N. Do not retitle any existing section as "Endorsements"
239
   or to conflict in title with any Invariant Section.
240
241
If the Modified Version includes new front-matter sections or
242
appendices that qualify as Secondary Sections and contain no material
243
copied from the Document, you may at your option designate some or all
244
of these sections as invariant.  To do this, add their titles to the
245
list of Invariant Sections in the Modified Version's license notice.
246
These titles must be distinct from any other section titles.
247
248
You may add a section entitled "Endorsements", provided it contains
249
nothing but endorsements of your Modified Version by various
250
parties--for example, statements of peer review or that the text has
251
been approved by an organization as the authoritative definition of a
252
standard.
253
254
You may add a passage of up to five words as a Front-Cover Text, and a
255
passage of up to 25 words as a Back-Cover Text, to the end of the list
256
of Cover Texts in the Modified Version.  Only one passage of
257
Front-Cover Text and one of Back-Cover Text may be added by (or
258
through arrangements made by) any one entity.  If the Document already
259
includes a cover text for the same cover, previously added by you or
260
by arrangement made by the same entity you are acting on behalf of,
261
you may not add another; but you may replace the old one, on explicit
262
permission from the previous publisher that added the old one.
263
264
The author(s) and publisher(s) of the Document do not by this License
265
give permission to use their names for publicity for or to assert or
266
imply endorsement of any Modified Version.
267
268
269
5. COMBINING DOCUMENTS
270
271
You may combine the Document with other documents released under this
272
License, under the terms defined in section 4 above for modified
273
versions, provided that you include in the combination all of the
274
Invariant Sections of all of the original documents, unmodified, and
275
list them all as Invariant Sections of your combined work in its
276
license notice.
277
278
The combined work need only contain one copy of this License, and
279
multiple identical Invariant Sections may be replaced with a single
280
copy.  If there are multiple Invariant Sections with the same name but
281
different contents, make the title of each such section unique by
282
adding at the end of it, in parentheses, the name of the original
283
author or publisher of that section if known, or else a unique number.
284
Make the same adjustment to the section titles in the list of
285
Invariant Sections in the license notice of the combined work.
286
287
In the combination, you must combine any sections entitled "History"
288
in the various original documents, forming one section entitled
289
"History"; likewise combine any sections entitled "Acknowledgements",
290
and any sections entitled "Dedications".  You must delete all sections
291
entitled "Endorsements."
292
293
294
6. COLLECTIONS OF DOCUMENTS
295
296
You may make a collection consisting of the Document and other documents
297
released under this License, and replace the individual copies of this
298
License in the various documents with a single copy that is included in
299
the collection, provided that you follow the rules of this License for
300
verbatim copying of each of the documents in all other respects.
301
302
You may extract a single document from such a collection, and distribute
303
it individually under this License, provided you insert a copy of this
304
License into the extracted document, and follow this License in all
305
other respects regarding verbatim copying of that document.
306
307
308
7. AGGREGATION WITH INDEPENDENT WORKS
309
310
A compilation of the Document or its derivatives with other separate
311
and independent documents or works, in or on a volume of a storage or
312
distribution medium, does not as a whole count as a Modified Version
313
of the Document, provided no compilation copyright is claimed for the
314
compilation.  Such a compilation is called an "aggregate", and this
315
License does not apply to the other self-contained works thus compiled
316
with the Document, on account of their being thus compiled, if they
317
are not themselves derivative works of the Document.
318
319
If the Cover Text requirement of section 3 is applicable to these
320
copies of the Document, then if the Document is less than one quarter
321
of the entire aggregate, the Document's Cover Texts may be placed on
322
covers that surround only the Document within the aggregate.
323
Otherwise they must appear on covers around the whole aggregate.
324
325
326
8. TRANSLATION
327
328
Translation is considered a kind of modification, so you may
329
distribute translations of the Document under the terms of section 4.
330
Replacing Invariant Sections with translations requires special
331
permission from their copyright holders, but you may include
332
translations of some or all Invariant Sections in addition to the
333
original versions of these Invariant Sections.  You may include a
334
translation of this License provided that you also include the
335
original English version of this License.  In case of a disagreement
336
between the translation and the original English version of this
337
License, the original English version will prevail.
338
339
340
9. TERMINATION
341
342
You may not copy, modify, sublicense, or distribute the Document except
343
as expressly provided for under this License.  Any other attempt to
344
copy, modify, sublicense or distribute the Document is void, and will
345
automatically terminate your rights under this License.  However,
346
parties who have received copies, or rights, from you under this
347
License will not have their licenses terminated so long as such
348
parties remain in full compliance.
349
350
351
10. FUTURE REVISIONS OF THIS LICENSE
352
353
The Free Software Foundation may publish new, revised versions
354
of the GNU Free Documentation License from time to time.  Such new
355
versions will be similar in spirit to the present version, but may
356
differ in detail to address new problems or concerns.  See
357
http://www.gnu.org/copyleft/.
358
359
Each version of the License is given a distinguishing version number.
360
If the Document specifies that a particular numbered version of this
361
License "or any later version" applies to it, you have the option of
362
following the terms and conditions either of that specified version or
363
of any later version that has been published (not as a draft) by the
364
Free Software Foundation.  If the Document does not specify a version
365
number of this License, you may choose any version ever published (not
366
as a draft) by the Free Software Foundation.
367
368
369
ADDENDUM: How to use this License for your documents
370
371
To use this License in a document you have written, include a copy of
372
the License in the document and put the following copyright and
373
license notices just after the title page:
374
375
      Copyright (c)  YEAR  YOUR NAME.
376
      Permission is granted to copy, distribute and/or modify this document
377
      under the terms of the GNU Free Documentation License, Version 1.1
378
      or any later version published by the Free Software Foundation;
379
      with the Invariant Sections being LIST THEIR TITLES, with the
380
      Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
381
      A copy of the license is included in the section entitled "GNU
382
      Free Documentation License".
383
384
If you have no Invariant Sections, write "with no Invariant Sections"
385
instead of saying which ones are invariant.  If you have no
386
Front-Cover Texts, write "no Front-Cover Texts" instead of
387
"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
388
389
If your document contains nontrivial examples of program code, we
390
recommend releasing these examples in parallel under your choice of
391
free software license, such as the GNU General Public License,
392
to permit their use in free software.
393
============================================================================
(-)bitlbee-1.2/debian/po/cs.po (+44 lines)
Line 0 Link Here
1
#
2
#    Translators, if you are not familiar with the PO format, gettext
3
#    documentation is worth reading, especially sections dedicated to
4
#    this format, e.g. by running:
5
#         info -n '(gettext)PO Files'
6
#         info -n '(gettext)Header Entry'
7
#
8
#    Some information specific to po-debconf are available at
9
#            /usr/share/doc/po-debconf/README-trans
10
#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
11
#
12
#    Developers do not need to manually edit POT or PO files.
13
#
14
msgid ""
15
msgstr ""
16
"Project-Id-Version: bitlbee\n"
17
"Report-Msgid-Bugs-To: \n"
18
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
19
"PO-Revision-Date: 2005-02-04 12:31+0100\n"
20
"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
21
"Language-Team: Czech <debian-l10n-czech@debian.org>\n"
22
"MIME-Version: 1.0\n"
23
"Content-Type: text/plain; charset=ISO-8859-2\n"
24
"Content-Transfer-Encoding: 8bit\n"
25
26
#. Type: string
27
#. Description
28
#: ../bitlbee.templates.master:4
29
msgid "On what TCP port should BitlBee listen for connections?"
30
msgstr "Na kterém TCP portu má BitlBee naslouchat pøíchozím spojením?"
31
32
#. Type: string
33
#. Description
34
#: ../bitlbee.templates.master:4
35
msgid ""
36
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
37
"very good idea when you're running a real IRC daemon as well. 6668 might be "
38
"a good alternative. Leaving this value blank means that BitlBee will not be "
39
"run automatically."
40
msgstr ""
41
"BitlBee normálnì naslouchá na bì¾ném IRC portu 6667. Pokud máte spu¹tìný i "
42
"reálný IRC daemon, tak to nemusí být nejlep¹í nápad. Vhodná alternativa mù¾e "
43
"být 6668. Ponecháte-li pole prázdné, znamená to, ¾e se BitlBee nebude "
44
"spou¹tìt automaticky."
(-)bitlbee-1.2/debian/po/de.po (+45 lines)
Line 0 Link Here
1
#
2
#    Translators, if you are not familiar with the PO format, gettext
3
#    documentation is worth reading, especially sections dedicated to
4
#    this format, e.g. by running:
5
#         info -n '(gettext)PO Files'
6
#         info -n '(gettext)Header Entry'
7
#    Some information specific to po-debconf are available at
8
#            /usr/share/doc/po-debconf/README-trans
9
#         or http://www.debian.org/intl/l10n/po-debconf/README-trans#
10
#    Developers do not need to manually edit POT or PO files.
11
# Erik Schanze <mail@erikschanze.de>, 2004.
12
#
13
msgid ""
14
msgstr ""
15
"Project-Id-Version: bitlbee_0.90a-2_de\n"
16
"Report-Msgid-Bugs-To: \n"
17
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
18
"PO-Revision-Date: 2004-10-03 14:33+0200\n"
19
"Last-Translator: Erik Schanze <mail@erikschanze.de>\n"
20
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
21
"MIME-Version: 1.0\n"
22
"Content-Type: text/plain; charset=UTF-8\n"
23
"Content-Transfer-Encoding: 8bit\n"
24
"X-Generator: KBabel 1.3.1\n"
25
"Plural-Forms:  nplurals=2; plural=(n != 1);\n"
26
27
#. Type: string
28
#. Description
29
#: ../bitlbee.templates.master:4
30
msgid "On what TCP port should BitlBee listen for connections?"
31
msgstr "An welchem TCP-Port soll BitlBee auf Verbindungen warten?"
32
33
#. Type: string
34
#. Description
35
#: ../bitlbee.templates.master:4
36
msgid ""
37
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
38
"very good idea when you're running a real IRC daemon as well. 6668 might be "
39
"a good alternative. Leaving this value blank means that BitlBee will not be "
40
"run automatically."
41
msgstr ""
42
"BitlBee lauscht normalerweise an dem üblichen IRC-Port 6667. Dies ist aber "
43
"keine gute Idee, wenn Sie außerdem noch einen richtigen IRC-Dienst "
44
"betreiben. Das Port 6668 ist eine gute Alternative. Wenn Sie keinen Wert "
45
"eingeben, wird BitlBee nicht automatisch starten."
(-)bitlbee-1.2/debian/po/es.po (+61 lines)
Line 0 Link Here
1
# bitlbee po-debconf translation to Spanish
2
# Copyright (C) 2005 Software in the Public Interest
3
# This file is distributed under the same license as the bitlbee package.
4
#
5
# Changes:
6
#  - Initial translation
7
#         César Gómez Martín <cesar.gomez@gmail.com>
8
#
9
#
10
#   Traductores, si no conoce el formato PO, merece la pena leer la
11
#   documentación de gettext, especialmente las secciones dedicadas a este
12
#   formato, por ejemplo ejecutando:
13
#          info -n '(gettext)PO Files'
14
#          info -n '(gettext)Header Entry'
15
# Equipo de traducción al español, por favor, lean antes de traducir
16
# los siguientes documentos:
17
#
18
#  - El proyecto de traducción de Debian al español
19
#    http://www.debian.org/intl/spanish/
20
#    especialmente las notas de traducción en
21
#    http://www.debian.org/intl/spanish/notas
22
#
23
#  - La guía de traducción de po's de debconf:
24
#    /usr/share/doc/po-debconf/README-trans
25
#    o http://www.debian.org/intl/l10n/po-debconf/README-trans
26
#
27
msgid ""
28
msgstr ""
29
"Project-Id-Version: bitlbee\n"
30
"Report-Msgid-Bugs-To: \n"
31
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
32
"PO-Revision-Date: 2005-08-24 19:37+0100\n"
33
"Last-Translator: César Gómez Martín <cesar.gomez@gmail.com>\n"
34
"Language-Team: Debian l10n spanish <debian-l10n-spanish@lists.debian.org>\n"
35
"MIME-Version: 1.0\n"
36
"Content-Type: text/plain; charset=utf-8\n"
37
"Content-Transfer-Encoding: 8bit\n"
38
"X-Poedit-Language: Spanish\n"
39
"X-Poedit-Country: SPAIN\n"
40
"X-Poedit-SourceCharset: utf-8\n"
41
42
#. Type: string
43
#. Description
44
#: ../bitlbee.templates.master:4
45
msgid "On what TCP port should BitlBee listen for connections?"
46
msgstr "¿En qué puerto TCP quiere que BitlBee escuche conexiones?"
47
48
#. Type: string
49
#. Description
50
#: ../bitlbee.templates.master:4
51
msgid ""
52
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
53
"very good idea when you're running a real IRC daemon as well. 6668 might be "
54
"a good alternative. Leaving this value blank means that BitlBee will not be "
55
"run automatically."
56
msgstr ""
57
"BitlBee normalmente escucha en el puerto 6667, que se usa también para IRC. "
58
"Por esta razón no es muy buena idea poner a BitlBee a escuchar en ese puerto "
59
"si también se está ejecutando un demonio real de IRC, en este caso el puerto "
60
"6668 puede ser una buena alternativa. Si deja este valor en blanco BitlBee "
61
"no se ejecutará automáticamente."
(-)bitlbee-1.2/debian/po/fr.po (+44 lines)
Line 0 Link Here
1
#
2
#    Translators, if you are not familiar with the PO format, gettext
3
#    documentation is worth reading, especially sections dedicated to
4
#    this format, e.g. by running:
5
#         info -n '(gettext)PO Files'
6
#         info -n '(gettext)Header Entry'
7
#
8
#    Some information specific to po-debconf are available at
9
#            /usr/share/doc/po-debconf/README-trans
10
#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
11
#
12
#    Developers do not need to manually edit POT or PO files.
13
#
14
msgid ""
15
msgstr ""
16
"Project-Id-Version: bitlbee (0.80-1)\n"
17
"Report-Msgid-Bugs-To: \n"
18
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
19
"PO-Revision-Date: 2003-08-07 08:45+0100\n"
20
"Last-Translator: Christian Perrier <bubulle@debian.org>\n"
21
"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
22
"MIME-Version: 1.0\n"
23
"Content-Type: text/plain; charset=iso-8859-15\n"
24
"Content-Transfer-Encoding: 8bit\n"
25
26
#. Type: string
27
#. Description
28
#: ../bitlbee.templates.master:4
29
msgid "On what TCP port should BitlBee listen for connections?"
30
msgstr "Sur quel port TCP BitlBee doit-il être à l'écoute ?"
31
32
#. Type: string
33
#. Description
34
#: ../bitlbee.templates.master:4
35
msgid ""
36
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
37
"very good idea when you're running a real IRC daemon as well. 6668 might be "
38
"a good alternative. Leaving this value blank means that BitlBee will not be "
39
"run automatically."
40
msgstr ""
41
"BitlBee est usuellement à l'écoute sur le port IRC standard : 6667. Cela "
42
"n'est pas forcément un choix adapté si vous utilisez en même temps un vrai "
43
"démon IRC. Dans ce cas, choisir 6668 est conseillé. Si vous ne souhaitez pas "
44
"lancer BitlBee automatiquement, veuillez laissez ce champs vide."
(-)bitlbee-1.2/debian/po/it.po (+36 lines)
Line 0 Link Here
1
# Italian translation of the bitlbee debconf template
2
# This file is distributed under the same license as the bitlbee package
3
# Copyright (C) 2007 Free Software Foundation, Inc.
4
# Luca Monducci <luca.mo@tiscali.it>, 2007.
5
#
6
msgid ""
7
msgstr ""
8
"Project-Id-Version: bitlbee\n"
9
"Report-Msgid-Bugs-To: \n"
10
"POT-Creation-Date: 2007-08-30 04:31+0200\n"
11
"PO-Revision-Date: 2007-10-27 11:52+0200\n"
12
"Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n"
13
"Language-Team: Italian <debian-l10n-italian@lists.debian.org>\n"
14
"MIME-Version: 1.0\n"
15
"Content-Type: text/plain; charset=UTF-8\n"
16
"Content-Transfer-Encoding: 8bit\n"
17
18
#. Type: string
19
#. Description
20
#: ../bitlbee.templates.master:1001
21
msgid "On what TCP port should BitlBee listen for connections?"
22
msgstr "Su quale porta TCP si deve mettere in ascolto BitlBee?"
23
24
#. Type: string
25
#. Description
26
#: ../bitlbee.templates.master:1001
27
msgid ""
28
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
29
"very good idea when you're running a real IRC daemon as well. 6668 might be "
30
"a good alternative. Leaving this value blank means that BitlBee will not be "
31
"run automatically."
32
msgstr ""
33
"Normalmente BitlBee si mette in ascolto sulla consueta porta IRC, la 6667. "
34
"Questa potrebbe non essere una buona idea se è in esecuzione anche un reale "
35
"demone IRC. La porta 6668 potrebbe essere una valida alternativa. Lasciando "
36
"vuoto questo valore BitlBee non viene avviato automaticamente."
(-)bitlbee-1.2/debian/po/ja.po (+45 lines)
Line 0 Link Here
1
#
2
#    Translators, if you are not familiar with the PO format, gettext
3
#    documentation is worth reading, especially sections dedicated to
4
#    this format, e.g. by running:
5
#         info -n '(gettext)PO Files'
6
#         info -n '(gettext)Header Entry'
7
#
8
#    Some information specific to po-debconf are available at
9
#            /usr/share/doc/po-debconf/README-trans
10
#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
11
#
12
#    Developers do not need to manually edit POT or PO files.
13
#
14
#
15
msgid ""
16
msgstr ""
17
"Project-Id-Version: bitlbee 0.90a-2\n"
18
"Report-Msgid-Bugs-To: \n"
19
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
20
"PO-Revision-Date: 2004-09-11 13:30+0900\n"
21
"Last-Translator: Hideki Yamane <henrich@samba.gr.jp>\n"
22
"Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
23
"MIME-Version: 1.0\n"
24
"Content-Type: text/plain; charset=EUC-JP\n"
25
"Content-Transfer-Encoding: 8bit\n"
26
27
#. Type: string
28
#. Description
29
#: ../bitlbee.templates.master:4
30
msgid "On what TCP port should BitlBee listen for connections?"
31
msgstr "BitlBee ¤Ï¡¢Àܳ¤Î¤¿¤á¤Ë¤É¤Î TCP ¥Ý¡¼¥È¤ò listen ¤·¤Þ¤¹¤«?"
32
33
#. Type: string
34
#. Description
35
#: ../bitlbee.templates.master:4
36
msgid ""
37
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
38
"very good idea when you're running a real IRC daemon as well. 6668 might be "
39
"a good alternative. Leaving this value blank means that BitlBee will not be "
40
"run automatically."
41
msgstr ""
42
"BitlBee ¤ÏÄ̾ï¤Î¾ì¹ç¡¢É¸½à¤Î IRC ¥Ý¡¼¥ÈÈÖ¹æ¤Ç¤¢¤ë 6667 ¤ò listen ¤·¤Þ¤¹¡£Æ±ÍÍ"
43
"¤Ë¤·¤Æ¼ÂºÝ¤Î IRC ¥Ç¡¼¥â¥ó¤òÆ°ºî¤µ¤»¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤ì¤Ï¤¢¤Þ¤êÎɤ¤¹Í¤¨¤Ç¤Ï̵¤¤¤«"
44
"¤â¤·¤ì¤Þ¤»¤ó¡£Âå¤ï¤ê¤Ë 6668 ¤ò»È¤¦¤Î¤¬Îɤ¤¤«¤âÃΤì¤Þ¤»¤ó¡£¤³¤ì¤ò¶õ¤Î¤Þ¤Þ¤Ë¤·"
45
"¤Æ¤ª¤±¤Ð¡¢BitlBee ¤Ï¼«Æ°Åª¤Ë¤Ïµ¯Æ°¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£"
(-)bitlbee-1.2/debian/po/nl.po (+44 lines)
Line 0 Link Here
1
#
2
#    Translators, if you are not familiar with the PO format, gettext
3
#    documentation is worth reading, especially sections dedicated to
4
#    this format, e.g. by running:
5
#         info -n '(gettext)PO Files'
6
#         info -n '(gettext)Header Entry'
7
#
8
#    Some information specific to po-debconf are available at
9
#            /usr/share/doc/po-debconf/README-trans
10
#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
11
#
12
#    Developers do not need to manually edit POT or PO files.
13
#
14
msgid ""
15
msgstr ""
16
"Project-Id-Version: bitlbee (0.90a-2)\n"
17
"Report-Msgid-Bugs-To: \n"
18
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
19
"PO-Revision-Date: 2004-09-06 20:16+0200\n"
20
"Last-Translator: Wilmer van der Gaast <wilmer@gaast.net>\n"
21
"Language-Team: LANGUAGE <LL@li.org>\n"
22
"MIME-Version: 1.0\n"
23
"Content-Type: text/plain; charset=ISO-8859-15\n"
24
"Content-Transfer-Encoding: 8bit\n"
25
26
#. Type: string
27
#. Description
28
#: ../bitlbee.templates.master:4
29
msgid "On what TCP port should BitlBee listen for connections?"
30
msgstr "Op welke TCP poort moet BitlBee draaien?"
31
32
#. Type: string
33
#. Description
34
#: ../bitlbee.templates.master:4
35
msgid ""
36
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
37
"very good idea when you're running a real IRC daemon as well. 6668 might be "
38
"a good alternative. Leaving this value blank means that BitlBee will not be "
39
"run automatically."
40
msgstr ""
41
"Normaal 'luistert' BitlBee op de gebruikelijke IRC poort, 6667. Als je al "
42
"een andere IRC daemon draait is dat onmogelijk. Kies dan bijvoorbeeld voor "
43
"poort 6668. Als je niet wil dat BitlBee automatisch gestart wordt, vul hier "
44
"dan niets in."
(-)bitlbee-1.2/debian/po/POTFILES.in (+1 lines)
Line 0 Link Here
1
[type: gettext/rfc822deb] bitlbee.templates.master
(-)bitlbee-1.2/debian/po/pt_BR.po (+44 lines)
Line 0 Link Here
1
#
2
#    Translators, if you are not familiar with the PO format, gettext
3
#    documentation is worth reading, especially sections dedicated to
4
#    this format, e.g. by running:
5
#         info -n '(gettext)PO Files'
6
#         info -n '(gettext)Header Entry'
7
#
8
#    Some information specific to po-debconf are available at
9
#            /usr/share/doc/po-debconf/README-trans
10
#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
11
#
12
#    Developers do not need to manually edit POT or PO files.
13
#
14
msgid ""
15
msgstr ""
16
"Project-Id-Version: bitlbee\n"
17
"Report-Msgid-Bugs-To: \n"
18
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
19
"PO-Revision-Date: 2005-02-26 16:14-0300\n"
20
"Last-Translator: André Luís Lopes <andrelop@debian.org>\n"
21
"Language-Team: Debian-BR Project <debian-l10n-portuguese@lists.debian.org>\n"
22
"MIME-Version: 1.0\n"
23
"Content-Type: text/plain; charset=ISO-8859-1\n"
24
"Content-Transfer-Encoding: 8bit\n"
25
26
#. Type: string
27
#. Description
28
#: ../bitlbee.templates.master:4
29
msgid "On what TCP port should BitlBee listen for connections?"
30
msgstr "Em qual porta TCP o BitlBee deverá ouvir por conexões ?"
31
32
#. Type: string
33
#. Description
34
#: ../bitlbee.templates.master:4
35
msgid ""
36
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
37
"very good idea when you're running a real IRC daemon as well. 6668 might be "
38
"a good alternative. Leaving this value blank means that BitlBee will not be "
39
"run automatically."
40
msgstr ""
41
"O BitlBee normalmente ouve na porta de IRC padrão, 6667. Porém, esta pode "
42
"não ser uma boa idéia quando você está rodando um daemon IRC real também. "
43
"6689 pode ser uma boa alternativa. Deixar esse valor em branco significa que "
44
"o BitlBee não será executado automaticamente."
(-)bitlbee-1.2/debian/po/pt.po (+35 lines)
Line 0 Link Here
1
# Portuguese translation of bitlbee's debconf messages.
# This file is distributed under the same license as the bitlbee package.
2
# 2006, Marco Ferra <mferra@debianpt.org>
3
#
4
msgid ""
5
msgstr ""
6
"Project-Id-Version: bitlbee 1.0.3-1.1\n"
7
"Report-Msgid-Bugs-To: \n"
8
"POT-Creation-Date: 2007-01-13 18:53+0100\n"
9
"PO-Revision-Date: 2007-01-26 22:34+0000\n"
10
"Last-Translator: Marco Ferra <mferra@debianpt.org>\n"
11
"Language-Team: Portuguese <traduz@debianpt.org>\n"
12
"MIME-Version: 1.0\n"
13
"Content-Type: text/plain; charset=UTF-8\n"
14
"Content-Transfer-Encoding: 8bit"
15
16
#. Type: string
17
#. Description
18
#: ../bitlbee.templates.master:1001
19
msgid "On what TCP port should BitlBee listen for connections?"
20
msgstr "Em que porta TCP deverá o BitlBee escutar por conexões?"
21
22
#. Type: string
23
#. Description
24
#: ../bitlbee.templates.master:1001
25
msgid ""
26
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
27
"very good idea when you're running a real IRC daemon as well. 6668 might be "
28
"a good alternative. Leaving this value blank means that BitlBee will not be "
29
"run automatically."
30
msgstr ""
31
"O BitlBee normalmente escuta na porta do IRC 6667.  Isto poderá não ser "
32
"uma ideia excelente quando está a correr um 'daemon' de IRC ao mesmo tempo. "
33
"Nesse caso a porta 6668 poderá ser uma boa alternativa.  Deixar este campo "
34
"vazio significa que o BitlBee não irá correr automaticamente."
35
(-)bitlbee-1.2/debian/po/sv.po (+43 lines)
Line 0 Link Here
1
# Translators, if you are not familiar with the PO format, gettext
2
# documentation is worth reading, especially sections dedicated to
3
# this format, e.g. by running:
4
# info -n '(gettext)PO Files'
5
# info -n '(gettext)Header Entry'
6
# Some information specific to po-debconf are available at
7
# /usr/share/doc/po-debconf/README-trans
8
# or http://www.debian.org/intl/l10n/po-debconf/README-trans
9
# Developers do not need to manually edit POT or PO files.
10
# , fuzzy
11
# 
12
# 
13
msgid ""
14
msgstr ""
15
"Project-Id-Version: bitlbee 0.92-2\n"
16
"Report-Msgid-Bugs-To: \n"
17
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
18
"PO-Revision-Date: 2005-10-03 23:18+0200\n"
19
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
20
"Language-Team: Swedish <sv@li.org>\n"
21
"MIME-Version: 1.0\n"
22
"Content-Type: text/plain; charset=iso-8859-1\n"
23
"Content-Transfer-Encoding: 8bit\n"
24
25
#. Type: string
26
#. Description
27
#: ../bitlbee.templates.master:4
28
msgid "On what TCP port should BitlBee listen for connections?"
29
msgstr "På vilken TCP-port ska BitlBee lyssna på efter anslutningar?"
30
31
#. Type: string
32
#. Description
33
#: ../bitlbee.templates.master:4
34
msgid ""
35
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
36
"very good idea when you're running a real IRC daemon as well. 6668 might be "
37
"a good alternative. Leaving this value blank means that BitlBee will not be "
38
"run automatically."
39
msgstr ""
40
"BitlBee lyssnar normalt på den standardporten för IRC, 6667. Detta kanske "
41
"inte är en bra ide om du kör en riktig IRC-daemon på samma system. 6668 kan "
42
"vara ett bra alternativ då. Lämnar du detta värde blankt betyder det att "
43
"BitlBee inte kommer att startas automatiskt."
(-)bitlbee-1.2/debian/po/templates.pot (+41 lines)
Line 0 Link Here
1
#
2
#    Translators, if you are not familiar with the PO format, gettext
3
#    documentation is worth reading, especially sections dedicated to
4
#    this format, e.g. by running:
5
#         info -n '(gettext)PO Files'
6
#         info -n '(gettext)Header Entry'
7
#
8
#    Some information specific to po-debconf are available at
9
#            /usr/share/doc/po-debconf/README-trans
10
#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
11
#
12
#    Developers do not need to manually edit POT or PO files.
13
#
14
#, fuzzy
15
msgid ""
16
msgstr ""
17
"Project-Id-Version: PACKAGE VERSION\n"
18
"Report-Msgid-Bugs-To: \n"
19
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
20
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
21
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
22
"Language-Team: LANGUAGE <LL@li.org>\n"
23
"MIME-Version: 1.0\n"
24
"Content-Type: text/plain; charset=CHARSET\n"
25
"Content-Transfer-Encoding: 8bit\n"
26
27
#. Type: string
28
#. Description
29
#: ../bitlbee.templates.master:4
30
msgid "On what TCP port should BitlBee listen for connections?"
31
msgstr ""
32
33
#. Type: string
34
#. Description
35
#: ../bitlbee.templates.master:4
36
msgid ""
37
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
38
"very good idea when you're running a real IRC daemon as well. 6668 might be "
39
"a good alternative. Leaving this value blank means that BitlBee will not be "
40
"run automatically."
41
msgstr ""
(-)bitlbee-1.2/debian/po/vi.po (+32 lines)
Line 0 Link Here
1
# Vietnamese translation for bitlbee.
2
# Copyright © 2005 Free Software Foundation, Inc.
3
# Clytie Siddall <clytie@riverland.net.au>, 2005.
4
#
5
msgid ""
6
msgstr ""
7
"Project-Id-Version: bitlbee 0.92-1\n"
8
"Report-Msgid-Bugs-To: \n"
9
"POT-Creation-Date: 2004-09-25 18:12+0200\n"
10
"PO-Revision-Date: 2005-06-12 18:34+0930\n"
11
"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
12
"Language-Team: Vietnamese <gnomevi-list@lists.sourceforge.net>\n"
13
"MIME-Version: 1.0\n"
14
"Content-Type: text/plain; charset=utf-8\n"
15
"Content-Transfer-Encoding: 8bit\n"
16
"Plural-Forms: nplurals=1; plural=0\n"
17
18
#. Type: string
19
#. Description
20
#: ../bitlbee.templates.master:4
21
msgid "On what TCP port should BitlBee listen for connections?"
22
msgstr "Trình BitlBee nên lắng nghe sự kết nối trên cổng TCP nào?"
23
24
#. Type: string
25
#. Description
26
#: ../bitlbee.templates.master:4
27
msgid ""
28
"BitlBee normally listens on the regular IRC port, 6667. This might not be a "
29
"very good idea when you're running a real IRC daemon as well. 6668 might be "
30
"a good alternative. Leaving this value blank means that BitlBee will not be "
31
"run automatically."
32
msgstr "Trình BitlBee thường lắng nghe trên cổng IRC bình thường, 6667. Có lẽ nó không phải là một ý kiến tốt nếu bạn cũng có chạy một trình nền (dæmon) IRC thật. Như thế thì, cổng 6668 có thể là một điều thay thế tốt. Nếu bạn bỏ giá trị này rỗng, thì trình BitlBee sẽ không tự động chạy."
(-)bitlbee-1.2/debian/postinst (+94 lines)
Line 0 Link Here
1
#!/bin/sh -e
2
3
. /usr/share/debconf/confmodule
4
5
db_get bitlbee/serveport
6
PORT="$RET"
7
8
CONFDIR=/var/lib/bitlbee/
9
10
update-rc.d bitlbee defaults > /dev/null 2>&1
11
12
## Load default option. Don't want to put this in debconf (yet?)
13
BITLBEE_OPTS=-F
14
BITLBEE_DISABLED=0
15
BITLBEE_UPGRADE_DONT_RESTART=0
16
[ -r /etc/default/bitlbee ] && . /etc/default/bitlbee
17
18
if [ "$BITLBEE_DISABLED" = "0" ] && type update-inetd > /dev/null 2> /dev/null &&
19
   ( expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null ); then
20
	## Make sure the inetd entry is gone (can still be there from a
21
	## previous version.
22
	update-inetd --remove '.*/usr/sbin/bitlbee'
23
	if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then
24
		# Thanks for breaking update-inetd! (bugs.debian.org/311111)
25
		# I hope that it works at least with xinetd, because this
26
		# emergency hack doesn't:
27
		perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf
28
		killall -HUP inetd || true
29
	fi
30
fi
31
32
cat<<EOF>/etc/default/bitlbee
33
## /etc/default/bitlbee: Auto-generated/updated script.
34
##
35
## Don't edit this line, use dpkg-reconfigure bitlbee
36
BITLBEE_PORT="$PORT"
37
38
## Use single-process or forking daemon mode? Can't be changed from debconf,
39
## but maintainer scripts will save your changes here.
40
BITLBEE_OPTS="$BITLBEE_OPTS"
41
42
## In case you want to stick with inetd mode (or if you just want to disable
43
## the init scripts for some other reason), you can disable the init script
44
## here. (Just set it to 1)
45
BITLBEE_DISABLED=$BITLBEE_DISABLED
46
47
## As a server operator, you can use the RESTART command to restart only the
48
## master process while keeping all the child processes and their IPC
49
## connections. By enabling this, the maintainer scripts won't restart
50
## BitlBee during upgrades so you can restart the master process by hand.
51
BITLBEE_UPGRADE_DONT_RESTART=$BITLBEE_UPGRADE_DONT_RESTART
52
EOF
53
54
## Bye-bye DebConf, we don't need you anymore.
55
db_stop
56
57
## Restore the helpfile in case we weren't upgrading but just reconfiguring:
58
if [ -e /usr/share/bitlbee/help.upgrading ]; then
59
	if [ -e /usr/share/bitlbee/help.txt ]; then
60
		rm -f /usr/share/bitlbee/help.upgrading
61
	else
62
		mv /usr/share/bitlbee/help.upgrading /usr/share/bitlbee/help.txt
63
	fi
64
fi
65
66
if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then
67
	/etc/init.d/bitlbee restart
68
fi
69
70
## If we're upgrading, we'll probably skip this next part
71
if [ -d $CONFDIR ] && chown -R bitlbee $CONFDIR; then
72
	echo 'BitlBee (probably) already installed, skipping user/configdir installation'
73
	exit 0
74
fi
75
76
adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee
77
chmod 700 /var/lib/bitlbee/
78
79
## Can't do this in packaging phase: Don't know the UID yet. Access to
80
## the file should be limited, now that it stores passwords. Added
81
## --group later for a little more security, but have to see if I can
82
## apply this change to existing installations on upgrades. Will think
83
## about that later.
84
if getent group bitlbee > /dev/null; then
85
	chmod 640 /etc/bitlbee/bitlbee.conf
86
	chown root:bitlbee /etc/bitlbee/bitlbee.conf
87
else
88
	chmod 600 /etc/bitlbee/bitlbee.conf
89
	chown bitlbee /etc/bitlbee/bitlbee.conf
90
fi
91
92
if [ -z "$2" ]; then
93
	/etc/init.d/bitlbee start
94
fi
(-)bitlbee-1.2/debian/postrm (+14 lines)
Line 0 Link Here
1
#!/bin/sh -e
2
3
[ "$1" = "purge" ] || exit 0
4
5
if [ -e /usr/share/debconf/confmodule ]; then
6
	. /usr/share/debconf/confmodule;
7
	db_purge;
8
fi
9
10
update-rc.d bitlbee remove > /dev/null 2>&1 || true
11
rm -f /etc/default/bitlbee
12
13
deluser --system --remove-home bitlbee || true
14
rm -rf /var/lib/bitlbee ## deluser doesn't seem to do this for homedirs in /var
(-)bitlbee-1.2/debian/prerm (+13 lines)
Line 0 Link Here
1
#!/bin/sh -e
2
3
if [ "$1" = "upgrade" ]; then
4
	## To prevent the help function from breaking in currently running
5
	## BitlBee processes. Have to do it like this because dpkg-reconfigure
6
	## looks a lot like an upgrade and we don't want to lose help.txt...
7
	if [ -e /usr/share/bitlbee/help.txt ]; then
8
		rm -f /usr/share/bitlbee/help.upgrading
9
		mv /usr/share/bitlbee/help.txt /usr/share/bitlbee/help.upgrading
10
	fi
11
else
12
	/etc/init.d/bitlbee stop || exit 0
13
fi
(-)bitlbee-1.2/debian/README.Debian (+36 lines)
Line 0 Link Here
1
                   *** NEWS (Version 1.2 and later) ***
2
3
Starting from version 1.2, BitlBee has a forking daemon mode. The Debian
4
package now uses this mode by default, instead of inetd mode. If you don't
5
want to use this, you can disable the init scripts (best way to do this is
6
by editing /etc/default/bitlbee) and restore the inetd.conf entry. This
7
should be necessary only once, it won't be touched during upgrades.
8
9
Another important change in BitlBee 1.2 is the file format used for your
10
personal settings. Everything's now saved in a single .xml (per account,
11
of course) file instead of $nick.accounts and $nick.nicks. One advantage
12
of this new format is that the passwords are actually encrypted instead of
13
just vaguely obfuscated. BitlBee can still read the old files, and will
14
save things in the new format when you save/disconnect. After that, you
15
can safely remove the old-style files (this is recommended).
16
17
I tried making this transition (the new file format but especially, in this
18
case, the inetd->forkdaemon mode change) as smooth as possible, but I'm
19
aware that many BitlBee users will have their own hacks already to run the
20
program. I hope the package won't break any of this for anyone. 1.2-2
21
should fix at least some of the issues.
22
23
---------------------------------------------------------------------------
24
25
Debconf should have asked you on what port you want BitlBee to run. If it
26
did not, the port number should be 6667 or 6668. (6668 if you already got
27
something running at 6667)
28
29
Fire up your favourite IRC client and connect to localhost:6667 (or 6668),
30
and read the documentation (type help for a list of commands).
31
32
Have fun!
33
34
The /usr/share/doc/bitlbee/examples/ directory contains some programs and
35
scripts you might like or need. They're not really examples but it's quite
36
normal behaviour to put small contrib stuff like that in there.
(-)bitlbee-1.2/debian/rules (+86 lines)
Line 0 Link Here
1
#!/usr/bin/make -f
2
3
DEBUG ?= 0
4
5
ifdef BITLBEE_VERSION
6
BITLBEE_FORCE_VERSION=1
7
else
8
# Want to use the full package version number instead of just the release.
9
BITLBEE_VERSION ?= "$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')"
10
export BITLBEE_VERSION
11
endif
12
13
build-arch: build-arch-stamp
14
build-arch-stamp:
15
	if [ ! -d debian ]; then exit 1; fi
16
	./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent
17
	$(MAKE)
18
#	$(MAKE) -C doc/ all
19
	touch build-arch-stamp
20
21
clean:
22
	if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
23
	rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files
24
	-$(MAKE) distclean
25
#	-$(MAKE) -C doc/ clean
26
				
27
28
install-arch: build-arch
29
	if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
30
	mkdir -p debian/bitlbee/DEBIAN/
31
	$(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee
32
33
	mkdir -p debian/bitlbee/usr/share/doc/bitlbee/
34
	cp doc/user-guide/user-guide.txt debian/bitlbee/usr/share/doc/bitlbee/
35
	cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/
36
37
binary-arch: build-arch install-arch
38
	if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
39
40
	chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init
41
42
	mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/ debian/bitlbee/etc/init.d/
43
	-cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH*
44
	cp doc/CREDITS doc/AUTHORS doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/
45
	cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian
46
	cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright
47
	cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog
48
	cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/
49
	cp debian/bitlbee.init debian/bitlbee/etc/init.d/bitlbee
50
	cd debian/bitlbee/usr/share/; \
51
		gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \
52
		        doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5
53
	
54
	chown -R root.root debian/bitlbee/
55
	find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \;
56
	find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \;
57
	
58
	cp debian/prerm debian/bitlbee/DEBIAN/
59
	cp debian/postinst debian/bitlbee/DEBIAN/
60
	cp debian/postrm debian/bitlbee/DEBIAN/
61
	cp debian/config debian/bitlbee/DEBIAN/
62
63
	po2debconf debian/templates > debian/bitlbee/DEBIAN/templates
64
	cp debian/conffiles debian/bitlbee/DEBIAN/
65
	
66
	if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi
67
68
	cd debian/bitlbee; \
69
		find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
70
	dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee
71
ifdef BITLBEE_FORCE_VERSION
72
	dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -v1:$(BITLBEE_VERSION)-0 -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0'
73
else
74
	dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0'
75
endif
76
77
	dpkg --build debian/bitlbee ..
78
79
debug-build:
80
	BITLBEE_VERSION=\"`date +%Y%m%d`-`hostname`-debug\" debian/rules clean binary DEBUG=1
81
82
binary: binary-arch
83
build: build-arch
84
install: install-arch
85
86
.PHONY: build-arch build clean binary-arch binary install-arch install
(-)bitlbee-1.2/debian/templates (+8 lines)
Line 0 Link Here
1
Template: bitlbee/serveport
2
Type: string
3
Default: stillhavetoask
4
_Description: On what TCP port should BitlBee listen for connections?
5
 BitlBee normally listens on the regular IRC port, 6667. This might not be
6
 a very good idea when you're running a real IRC daemon as well. 6668 might
7
 be a good alternative. Leaving this value blank means that BitlBee will not
8
 be run automatically.
(-)bitlbee-1.2/debian/watch (+2 lines)
Line 0 Link Here
1
version=2
2
http://get.bitlbee.org/src/bitlbee-(.*).tar.gz
(-)bitlbee-1.2/doc/CHANGES (+14 lines)
Lines 1-3 Link Here
1
Version 1.2.1:
2
- Fixed proxy support.
3
- Fixed stalling issues while connecting to Jabber when using the OpenSSL
4
  module.
5
- Fixed problem with GLib and ForkDaemon where processes didn't die when
6
  the client disconnects.
7
- Fixed handling of "set charset none". (Which pretty much breaks the account
8
  completely in 1.2.)
9
- You can now automatically identify yourself to BitlBee by setting a server
10
  password in your IRC client.
11
- Compatible with all crazy kinds of line endings that clients can send.
12
13
Finished ...
14
1
Version 1.2:
15
Version 1.2:
2
- Added ForkDaemon mode next to the existing Daemon- and inetd modes. With
16
- Added ForkDaemon mode next to the existing Daemon- and inetd modes. With
3
  ForkDaemon you can run BitlBee as a stand-alone daemon and every connection
17
  ForkDaemon you can run BitlBee as a stand-alone daemon and every connection
(-)bitlbee-1.2/doc/RELEASE-SPEECH-1.2 (-57 lines)
Lines 1-57 Link Here
1
BitlBee ... is Bitl
2
-------------------
3
4
"I CAN HAS SPEEECH?" This is how Wilmer announced to me that he was going to do
5
another BitlBee release. I was as surprised as you are. I thought he had given
6
up on this whole releasing business.
7
8
There is some humor in using a LOLcats reference to announce a new Bee
9
release. The last major BitlBee release (1.0) was done a long time before the
10
hype even begun. Between then and now we've celebrated BitlBee's fifth birthday
11
and had a handful of releases, but nothing big happened. As a user this lax
12
release planning worries me. What if this means that later releases will take
13
even longer? I don't think we should fear this. Let us explore why this release
14
took so long.
15
16
Personally, I blame Google.
17
18
There, I've said it. Google. The guys who are so big on "Do No Evil" and all
19
that jazz. They caused this release to be so late. Let me explain why.
20
21
They made Wilmer an offer. Wilmer, being the sillily naive guy he is, couldn't
22
refuse. There were no decapitated horses involved, but he couldn't refuse
23
nonetheless. That's not a big problem of course. Lots of guys (and gals, sure)
24
work for Google. It wouldn't have become a problem if they hadn't shipped him of
25
to Ireland. That's where the trouble starts.
26
27
Ireland. Home of the leprechauns. These rascals joined forces with aliens and
28
LOLcats to abduct Wilmer. The aliens had been trying for years to kidnap him,
29
but they were on his turf and his trusty sidekicks Jelmer and Maurits were there
30
to help him. All that changed when he moved to Ireland.
31
32
But it wasn't just that Wilmer was all alone in some strange place. It was also
33
that the aliens had created the LOLcats and made an alliance with the
34
leprechauns--the real rulers of Ireland. Wilmer is cool, but he's not that
35
cool. So they abducted him for a few years. When he finally came back, he
36
regathered his mad coding skills and hacked a new release together.
37
38
By now you're thinking, what has happened to Jelmer and Maurits? Well, they're
39
still here and they worked on the Bee while Wilmer was absent. But, like open
40
source, they are very Bitl--they're cool, but they're ready when they're
41
ready.
42
43
Well, whatever you may think of my little theory, they did take forever to
44
launch this release. We're not mad at them, because it shows. They have
45
added some cool new features and made plenty of changes under the hood. Let me
46
give you a sneak preview of some of the new features: Jabber groupchats are
47
supported. Configuration files are stored encrypted. You can now use
48
ForkDaemon mode, which gives better stability over normal daemon mode, but
49
doesn't require inetd. Also, server owners can now use the /OPER command to
50
spy on their users. And--as I was specifically asked to mention--this is the
51
first stable release that supports plugins. That's some Bitl changes for ya.
52
53
BitlBee is cool, but ready when it's ready. Very Bitl.
54
55
Sjoerd. LOL.
56
57
(LOLBee by Erik Bosman.)
(-)bitlbee-1.2/doc/user-guide/commands.xml (+53 lines)
Lines 588-593 Link Here
588
		</description>
588
		</description>
589
	</bitlbee-setting>
589
	</bitlbee-setting>
590
590
591
	<bitlbee-setting name="root_nick" type="string" scope="global">
592
		<default>root</default>
593
594
		<description>
595
			<para>
596
				Normally the "bot" that takes all your BitlBee commands is called "root". If you don't like this name, you can rename it to anything else using the <emphasis>rename</emphasis> command, or by changing this setting.
597
			</para>
598
		</description>
599
	</bitlbee-setting>
600
591
	<bitlbee-setting name="save_on_quit" type="boolean" scope="global">
601
	<bitlbee-setting name="save_on_quit" type="boolean" scope="global">
592
		<default>true</default>
602
		<default>true</default>
593
603
Lines 863-866 Link Here
863
		</ircexample>
873
		</ircexample>
864
874
865
	</bitlbee-command>
875
	</bitlbee-command>
876
	
877
	<bitlbee-command name="transfers">
878
		<short-description>Monitor, cancel, or reject file transfers</short-description>
879
		<syntax>transfers [&lt;cancel&gt; id | &lt;reject&gt;]</syntax>
880
		
881
		<description>
882
			<para>
883
				Without parameters the currently pending file transfers and their status will be listed. Available actions are <emphasis>cancel</emphasis> and <emphasis>reject</emphasis>. See <emphasis>help transfers &lt;action&gt;</emphasis> for more information.
884
			</para>
885
886
			<ircexample>
887
				<ircline nick="ulim">transfers</ircline>
888
			</ircexample>
889
		</description>
890
		
891
		<bitlbee-command name="cancel">
892
			<short-description>Cancels the file transfer with the given id</short-description>
893
			<syntax>transfers &lt;cancel&gt; id</syntax>
894
895
			<description>
896
				<para>Cancels the file transfer with the given id</para>
897
			</description>
898
899
			<ircexample>
900
				<ircline nick="ulim">transfers cancel 1</ircline>
901
				<ircline nick="root">Canceling file transfer for test</ircline>
902
			</ircexample>
903
		</bitlbee-command>
904
905
		<bitlbee-command name="reject">
906
			<short-description>Rejects all incoming transfers</short-description>
907
			<syntax>transfers &lt;reject&gt;</syntax>
908
909
			<description>
910
				<para>Rejects all incoming (not already transferring) file transfers. Since you probably have only one incoming transfer at a time, no id is neccessary. Or is it?</para>
911
			</description>
912
913
			<ircexample>
914
				<ircline nick="ulim">transfers reject</ircline>
915
			</ircexample>
916
		</bitlbee-command>
917
	</bitlbee-command>
918
	
866
</chapter>
919
</chapter>
(-)bitlbee-1.2/doc/user-guide/help.txt (+32 lines)
Lines 121-126 Link Here
121
 * blist - List all the buddies in your contact list
121
 * blist - List all the buddies in your contact list
122
 * nick - Change friendly name, nick
122
 * nick - Change friendly name, nick
123
 * join_chat - Join a named groupchat/conference room
123
 * join_chat - Join a named groupchat/conference room
124
 * transfers - Monitor, cancel, or reject file transfers
124
%
125
%
125
?account
126
?account
126
Syntax: account <action> [<arguments>]
127
Syntax: account <action> [<arguments>]
Lines 343-348 Link Here
343
Example:
344
Example:
344
<wilmer> join_chat jabber bitlbee@conference.bitlbee.org &bitlbee-help help-me
345
<wilmer> join_chat jabber bitlbee@conference.bitlbee.org &bitlbee-help help-me
345
%
346
%
347
?transfers
348
Syntax: transfers [<cancel> id | <reject>]
349
350
Without parameters the currently pending file transfers and their status will be listed. Available actions are cancel and reject. See help transfers <action> for more information.
351
352
<ulim> transfers
353
%
354
?transfers cancel
355
Syntax: transfers <cancel> id
356
357
Cancels the file transfer with the given id
358
359
Example:
360
<ulim> transfers cancel 1
361
<root> Canceling file transfer for test
362
%
363
?transfers reject
364
Syntax: transfers <reject>
365
366
Rejects all incoming (not already transferring) file transfers. Since you probably have only one incoming transfer at a time, no id is neccessary. Or is it?
367
368
Example:
369
<ulim> transfers reject
370
%
346
?set auto_connect
371
?set auto_connect
347
Type: boolean
372
Type: boolean
348
Scope: both
373
Scope: both
Lines 537-542 Link Here
537
562
538
Normally it's set to priority which means messages will always be delivered to the buddy's resource with the highest priority. If the setting is set to time, messages will be delivered to the resource that was last used to send you a message (or the resource that most recently connected).
563
Normally it's set to priority which means messages will always be delivered to the buddy's resource with the highest priority. If the setting is set to time, messages will be delivered to the resource that was last used to send you a message (or the resource that most recently connected).
539
%
564
%
565
?set root_nick
566
Type: string
567
Scope: global
568
Default: root
569
570
Normally the "bot" that takes all your BitlBee commands is called "root". If you don't like this name, you can rename it to anything else using the rename command, or by changing this setting.
571
%
540
?set save_on_quit
572
?set save_on_quit
541
Type: boolean
573
Type: boolean
542
Scope: global
574
Scope: global
(-)bitlbee-1.2/doc/user-guide/user-guide.html (-59 / +66 lines)
Lines 1-19 Link Here
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BitlBee User Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="BitlBee-User-Guide"></a>BitlBee User Guide</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Wilmer</span> <span class="surname">van der Gaast</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Sjoerd</span> <span class="surname">Hemminga</span></h3></div></div><div><p class="releaseinfo">
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BitlBee User Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.70.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="BitlBee-User-Guide"></a>BitlBee User Guide</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Wilmer</span> <span class="surname">van der Gaast</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Sjoerd</span> <span class="surname">Hemminga</span></h3></div></div><div><p class="releaseinfo">
2
   		This is the BitlBee User Guide. For now, the on-line help is
2
   		This is the BitlBee User Guide. For now, the on-line help is
3
		the most up-to-date documentation. Although this document shares
3
		the most up-to-date documentation. Although this document shares
4
		some parts with the on-line help system, other parts might be
4
		some parts with the on-line help system, other parts might be
5
		very outdated.
5
		very outdated.
6
   </p></div><div><div class="legalnotice"><a name="legalnotice"></a></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#Installation">1. Installation</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id281777">Downloading the package</a></span></dt><dt><span class="sect1"><a href="#id282165">Compiling</a></span></dt><dt><span class="sect1"><a href="#id281947">Configuration</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Usage">2. Usage</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id282720">Connecting to the server</a></span></dt><dt><span class="sect1"><a href="#id282732">The &amp;bitlbee control channel</a></span></dt><dt><span class="sect1"><a href="#id282769">Talking to people</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Support">3. Support</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id282811">Disclaimer</a></span></dt><dt><span class="sect1"><a href="#id282823">Support channels</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id282829">The World Wide Web</a></span></dt><dt><span class="sect2"><a href="#id323466">IRC</a></span></dt><dt><span class="sect2"><a href="#id323476">Mailinglists</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#quickstart">4. Quickstart</a></span></dt><dd><dl><dt><span class="sect1"><a href="#quickstart2">Add and Connect To your IM Account(s)</a></span></dt><dt><span class="sect1"><a href="#quickstart3">Managing Contact Lists: Rename</a></span></dt><dt><span class="sect1"><a href="#quickstart4">Step Four: Managing Contact Lists: Add and Remove.</a></span></dt><dt><span class="sect1"><a href="#quickstart5">Chatting</a></span></dt><dt><span class="sect1"><a href="#quickstart6">Further Resources</a></span></dt></dl></dd><dt><span class="chapter"><a href="#commands">5. Bitlbee commands</a></span></dt><dd><dl><dt><span class="sect1"><a href="#cmd_account">account - IM-account list maintenance</a></span></dt><dd><dl><dt><span class="sect2"><a href="#cmd_account_add">account add</a></span></dt><dt><span class="sect2"><a href="#cmd_account_del">account del</a></span></dt><dt><span class="sect2"><a href="#cmd_account_on">account on</a></span></dt><dt><span class="sect2"><a href="#cmd_account_off">account off</a></span></dt><dt><span class="sect2"><a href="#cmd_account_list">account list</a></span></dt><dt><span class="sect2"><a href="#cmd_account_set">account set</a></span></dt></dl></dd><dt><span class="sect1"><a href="#cmd_add">add - Add a buddy to your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_info">info - Request user information</a></span></dt><dt><span class="sect1"><a href="#cmd_remove">remove - Remove a buddy from your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_block">block - Block someone</a></span></dt><dt><span class="sect1"><a href="#cmd_allow">allow - Unblock someone</a></span></dt><dt><span class="sect1"><a href="#cmd_set">set - Miscellaneous settings</a></span></dt><dt><span class="sect1"><a href="#cmd_help">help - BitlBee help system</a></span></dt><dt><span class="sect1"><a href="#cmd_save">save - Save your account data</a></span></dt><dt><span class="sect1"><a href="#set_auto_connect">auto_connect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect">auto_reconnect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect_delay">auto_reconnect_delay</a></span></dt><dt><span class="sect1"><a href="#set_away_devoice">away_devoice</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer">buddy_sendbuffer</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer_delay">buddy_sendbuffer_delay</a></span></dt><dt><span class="sect1"><a href="#set_charset">charset</a></span></dt><dt><span class="sect1"><a href="#set_debug">debug</a></span></dt><dt><span class="sect1"><a href="#set_default_target">default_target</a></span></dt><dt><span class="sect1"><a href="#set_display_name">display_name</a></span></dt><dt><span class="sect1"><a href="#set_display_namechanges">display_namechanges</a></span></dt><dt><span class="sect1"><a href="#set_handle_unknown">handle_unknown</a></span></dt><dt><span class="sect1"><a href="#set_lcnicks">lcnicks</a></span></dt><dt><span class="sect1"><a href="#set_mail_notifications">mail_notifications</a></span></dt><dt><span class="sect1"><a href="#set_ops">ops</a></span></dt><dt><span class="sect1"><a href="#set_password">password</a></span></dt><dt><span class="sect1"><a href="#set_port">port</a></span></dt><dt><span class="sect1"><a href="#set_priority">priority</a></span></dt><dt><span class="sect1"><a href="#set_private">private</a></span></dt><dt><span class="sect1"><a href="#set_query_order">query_order</a></span></dt><dt><span class="sect1"><a href="#set_resource">resource</a></span></dt><dt><span class="sect1"><a href="#set_resource_select">resource_select</a></span></dt><dt><span class="sect1"><a href="#set_save_on_quit">save_on_quit</a></span></dt><dt><span class="sect1"><a href="#set_server">server</a></span></dt><dt><span class="sect1"><a href="#set_simulate_netsplit">simulate_netsplit</a></span></dt><dt><span class="sect1"><a href="#set_ssl">ssl</a></span></dt><dt><span class="sect1"><a href="#set_strip_html">strip_html</a></span></dt><dt><span class="sect1"><a href="#set_tls">tls</a></span></dt><dt><span class="sect1"><a href="#set_to_char">to_char</a></span></dt><dt><span class="sect1"><a href="#set_typing_notice">typing_notice</a></span></dt><dt><span class="sect1"><a href="#set_web_aware">web_aware</a></span></dt><dt><span class="sect1"><a href="#set_xmlconsole">xmlconsole</a></span></dt><dt><span class="sect1"><a href="#cmd_rename">rename - Rename (renick) a buddy</a></span></dt><dt><span class="sect1"><a href="#cmd_yes">yes - Accept a request</a></span></dt><dt><span class="sect1"><a href="#cmd_no">no - Deny a request</a></span></dt><dt><span class="sect1"><a href="#cmd_qlist">qlist - List all the unanswered questions root asked</a></span></dt><dt><span class="sect1"><a href="#cmd_register">register - Register yourself</a></span></dt><dt><span class="sect1"><a href="#cmd_identify">identify - Identify yourself with your password</a></span></dt><dt><span class="sect1"><a href="#cmd_drop">drop - Drop your account</a></span></dt><dt><span class="sect1"><a href="#cmd_blist">blist - List all the buddies in your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_nick">nick - Change friendly name, nick</a></span></dt><dt><span class="sect1"><a href="#cmd_join_chat">join_chat - Join a named groupchat/conference room</a></span></dt></dl></dd><dt><span class="chapter"><a href="#misc">6. Misc Stuff</a></span></dt><dd><dl><dt><span class="sect1"><a href="#smileys">Smileys</a></span></dt><dt><span class="sect1"><a href="#groupchats">Groupchats</a></span></dt><dt><span class="sect1"><a href="#groupchats2">Creating groupchats</a></span></dt><dt><span class="sect1"><a href="#away">Away states</a></span></dt></dl></dd></dl></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Installation"></a>Chapter 1. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id281777">Downloading the package</a></span></dt><dt><span class="sect1"><a href="#id282165">Compiling</a></span></dt><dt><span class="sect1"><a href="#id281947">Configuration</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id281777"></a>Downloading the package</h2></div></div></div><p>
6
   </p></div><div><div class="legalnotice"><a name="legalnotice"></a></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#Installation">1. Installation</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id267726">Downloading the package</a></span></dt><dt><span class="sect1"><a href="#id267749">Compiling</a></span></dt><dt><span class="sect1"><a href="#id267216">Configuration</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Usage">2. Usage</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id267313">Connecting to the server</a></span></dt><dt><span class="sect1"><a href="#id267325">The &amp;bitlbee control channel</a></span></dt><dt><span class="sect1"><a href="#id267362">Talking to people</a></span></dt></dl></dd><dt><span class="chapter"><a href="#Support">3. Support</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id267405">BitlBee is beta software</a></span></dt><dt><span class="sect1"><a href="#id267417">Support channels</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id307828">The World Wide Web</a></span></dt><dt><span class="sect2"><a href="#id307843">IRC</a></span></dt><dt><span class="sect2"><a href="#id307853">Mailinglists</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#quickstart">4. Quickstart</a></span></dt><dd><dl><dt><span class="sect1"><a href="#quickstart2">Add and Connect To your IM Account(s)</a></span></dt><dt><span class="sect1"><a href="#quickstart3">Managing Contact Lists: Rename</a></span></dt><dt><span class="sect1"><a href="#quickstart4">Step Four: Managing Contact Lists: Add and Remove.</a></span></dt><dt><span class="sect1"><a href="#quickstart5">Chatting</a></span></dt><dt><span class="sect1"><a href="#quickstart6">Further Resources</a></span></dt></dl></dd><dt><span class="chapter"><a href="#commands">5. Bitlbee commands</a></span></dt><dd><dl><dt><span class="sect1"><a href="#cmd_account">account - IM-account list maintenance</a></span></dt><dd><dl><dt><span class="sect2"><a href="#cmd_account_add">account add</a></span></dt><dt><span class="sect2"><a href="#cmd_account_del">account del</a></span></dt><dt><span class="sect2"><a href="#cmd_account_on">account on</a></span></dt><dt><span class="sect2"><a href="#cmd_account_off">account off</a></span></dt><dt><span class="sect2"><a href="#cmd_account_list">account list</a></span></dt><dt><span class="sect2"><a href="#cmd_account_set">account set</a></span></dt></dl></dd><dt><span class="sect1"><a href="#cmd_add">add - Add a buddy to your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_info">info - Request user information</a></span></dt><dt><span class="sect1"><a href="#cmd_remove">remove - Remove a buddy from your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_block">block - Block someone</a></span></dt><dt><span class="sect1"><a href="#cmd_allow">allow - Unblock someone</a></span></dt><dt><span class="sect1"><a href="#cmd_set">set - Miscellaneous settings</a></span></dt><dt><span class="sect1"><a href="#cmd_help">help - BitlBee help system</a></span></dt><dt><span class="sect1"><a href="#cmd_save">save - Save your account data</a></span></dt><dt><span class="sect1"><a href="#set_auto_connect">auto_connect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect">auto_reconnect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect_delay">auto_reconnect_delay</a></span></dt><dt><span class="sect1"><a href="#set_away_devoice">away_devoice</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer">buddy_sendbuffer</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer_delay">buddy_sendbuffer_delay</a></span></dt><dt><span class="sect1"><a href="#set_charset">charset</a></span></dt><dt><span class="sect1"><a href="#set_debug">debug</a></span></dt><dt><span class="sect1"><a href="#set_default_target">default_target</a></span></dt><dt><span class="sect1"><a href="#set_display_name">display_name</a></span></dt><dt><span class="sect1"><a href="#set_display_namechanges">display_namechanges</a></span></dt><dt><span class="sect1"><a href="#set_handle_unknown">handle_unknown</a></span></dt><dt><span class="sect1"><a href="#set_lcnicks">lcnicks</a></span></dt><dt><span class="sect1"><a href="#set_ops">ops</a></span></dt><dt><span class="sect1"><a href="#set_password">password</a></span></dt><dt><span class="sect1"><a href="#set_port">port</a></span></dt><dt><span class="sect1"><a href="#set_priority">priority</a></span></dt><dt><span class="sect1"><a href="#set_private">private</a></span></dt><dt><span class="sect1"><a href="#set_query_order">query_order</a></span></dt><dt><span class="sect1"><a href="#set_resource">resource</a></span></dt><dt><span class="sect1"><a href="#set_resource_select">resource_select</a></span></dt><dt><span class="sect1"><a href="#set_save_on_quit">save_on_quit</a></span></dt><dt><span class="sect1"><a href="#set_server">server</a></span></dt><dt><span class="sect1"><a href="#set_simulate_netsplit">simulate_netsplit</a></span></dt><dt><span class="sect1"><a href="#set_ssl">ssl</a></span></dt><dt><span class="sect1"><a href="#set_strip_html">strip_html</a></span></dt><dt><span class="sect1"><a href="#set_tls">tls</a></span></dt><dt><span class="sect1"><a href="#set_to_char">to_char</a></span></dt><dt><span class="sect1"><a href="#set_typing_notice">typing_notice</a></span></dt><dt><span class="sect1"><a href="#set_web_aware">web_aware</a></span></dt><dt><span class="sect1"><a href="#set_xmlconsole">xmlconsole</a></span></dt><dt><span class="sect1"><a href="#cmd_rename">rename - Rename (renick) a buddy</a></span></dt><dt><span class="sect1"><a href="#cmd_yes">yes - Accept a request</a></span></dt><dt><span class="sect1"><a href="#cmd_no">no - Deny a request</a></span></dt><dt><span class="sect1"><a href="#cmd_qlist">qlist - List all the unanswered questions root asked</a></span></dt><dt><span class="sect1"><a href="#cmd_register">register - Register yourself</a></span></dt><dt><span class="sect1"><a href="#cmd_identify">identify - Identify yourself with your password</a></span></dt><dt><span class="sect1"><a href="#cmd_drop">drop - Drop your account</a></span></dt><dt><span class="sect1"><a href="#cmd_blist">blist - List all the buddies in your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_nick">nick - Change friendly name, nick</a></span></dt><dt><span class="sect1"><a href="#cmd_join_chat">join_chat - Join a named groupchat/conference room</a></span></dt></dl></dd><dt><span class="chapter"><a href="#misc">6. Misc Stuff</a></span></dt><dd><dl><dt><span class="sect1"><a href="#smileys">Smileys</a></span></dt><dt><span class="sect1"><a href="#groupchats">Groupchats</a></span></dt><dt><span class="sect1"><a href="#groupchats2">Creating groupchats</a></span></dt><dt><span class="sect1"><a href="#groupchats3">Groupchat channel names</a></span></dt><dt><span class="sect1"><a href="#away">Away states</a></span></dt></dl></dd></dl></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Installation"></a>Chapter 1. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id267726">Downloading the package</a></span></dt><dt><span class="sect1"><a href="#id267749">Compiling</a></span></dt><dt><span class="sect1"><a href="#id267216">Configuration</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267726"></a>Downloading the package</h2></div></div></div><p>
7
The latest BitlBee release is always available from <a class="ulink" href="http://www.bitlbee.org/" target="_top">http://www.bitlbee.org/</a>.
7
The latest BitlBee release is always available from <a href="http://www.bitlbee.org/" target="_top">http://www.bitlbee.org/</a>.
8
Download the package with your favorite program and unpack it: <span class="command"><strong>tar
8
Download the package with your favorite program and unpack it: <span><strong class="command">tar
9
xvfz bitlbee-&lt;version&gt;.tar.gz</strong></span> where &lt;version&gt; is to be
9
xvfz bitlbee-&lt;version&gt;.tar.gz</strong></span> where &lt;version&gt; is to be
10
replaced by the version number of the BitlBee you downloaded (e.g. 0.91).
10
replaced by the version number of the BitlBee you downloaded (e.g. 0.91).
11
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id282165"></a>Compiling</h2></div></div></div><p>
11
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267749"></a>Compiling</h2></div></div></div><p>
12
BitlBee's build system has to be configured before compiling. The
12
BitlBee's build system has to be configured before compiling. The
13
<code class="filename">configure</code> script will do this for you. Just run
13
<code class="filename">configure</code> script will do this for you. Just run
14
it, it'll set up with nice and hopefully well-working defaults. If you
14
it, it'll set up with nice and hopefully well-working defaults. If you
15
want to change some settings, just try
15
want to change some settings, just try
16
<span class="command"><strong>./configure --help</strong></span> and see what you can do.
16
<span><strong class="command">./configure --help</strong></span> and see what you can do.
17
</p><p>Some variables that might be of interest to the normal user:</p><div class="itemizedlist"><ul type="disc"><li><p>prefix, bindir, etcdir, mandir, datadir - The place where
17
</p><p>Some variables that might be of interest to the normal user:</p><div class="itemizedlist"><ul type="disc"><li><p>prefix, bindir, etcdir, mandir, datadir - The place where
18
all the BitlBee program files will be put. There's usually no reason to
18
all the BitlBee program files will be put. There's usually no reason to
19
specify them all separately, just specifying prefix (or keeping the default
19
specify them all separately, just specifying prefix (or keeping the default
Lines 38-46 Link Here
38
If you want BitlBee to use OpenSSL, you have to explicitly specify that.
38
If you want BitlBee to use OpenSSL, you have to explicitly specify that.
39
</p></li></ul></div><p>
39
</p></li></ul></div><p>
40
After running <code class="filename">configure</code>, you should run
40
After running <code class="filename">configure</code>, you should run
41
<span class="command"><strong>make</strong></span>. After that, run <span class="command"><strong>make install</strong></span> as 
41
<span><strong class="command">make</strong></span>. After that, run <span><strong class="command">make install</strong></span> as 
42
root.
42
root.
43
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id281947"></a>Configuration</h2></div></div></div><p>
43
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267216"></a>Configuration</h2></div></div></div><p>
44
By default, BitlBee runs as the user nobody. You might want 
44
By default, BitlBee runs as the user nobody. You might want 
45
to run it as a seperate user (some computers run named or apache as nobody). 
45
to run it as a seperate user (some computers run named or apache as nobody). 
46
</p><p>
46
</p><p>
Lines 51-78 Link Here
51
</pre><p>
51
</pre><p>
52
      </p><p>
52
      </p><p>
53
Inetd has to be restarted after changing the configuration. Either
53
Inetd has to be restarted after changing the configuration. Either
54
<span class="command"><strong>killall -HUP inetd</strong></span> or 
54
<span><strong class="command">killall -HUP inetd</strong></span> or 
55
<span class="command"><strong>/etc/init.d/inetd restart</strong></span> should do the job on most systems.
55
<span><strong class="command">/etc/init.d/inetd restart</strong></span> should do the job on most systems.
56
</p><p>
56
</p><p>
57
You might be one of the.. ehr, lucky people running an xinetd-powered distro.
57
You might be one of the.. ehr, lucky people running an xinetd-powered distro.
58
<span class="command"><strong>xinetd</strong></span> is quite different and they seem to be proud of that.. ;-)
58
<span><strong class="command">xinetd</strong></span> is quite different and they seem to be proud of that.. ;-)
59
Anyway, if you want BitlBee to work with <span class="command"><strong>xinetd</strong></span>, just copy the
59
Anyway, if you want BitlBee to work with <span><strong class="command">xinetd</strong></span>, just copy the
60
bitlbee.xinetd file to your /etc/xinetd.d/ directory (and probably edit it to suit
60
bitlbee.xinetd file to your /etc/xinetd.d/ directory (and probably edit it to suit
61
your needs).
61
your needs).
62
</p><p>
62
</p><p>
63
You should create a directory where BitlBee can store it's data files. This 
63
You should create a directory where BitlBee can store it's data files. This 
64
should be the directory named after the value 'CONFIG' in Makefile.settings. 
64
should be the directory named after the value 'CONFIG' in Makefile.settings. 
65
The default is <code class="filename">/var/lib/bitlbee</code>, which can be created 
65
The default is <code class="filename">/var/lib/bitlbee</code>, which can be created 
66
with the command <span class="command"><strong>mkdir -p /var/lib/bitlbee</strong></span>. This 
66
with the command <span><strong class="command">mkdir -p /var/lib/bitlbee</strong></span>. This 
67
directory has to be owned by the user that runs bitlbee. To make 
67
directory has to be owned by the user that runs bitlbee. To make 
68
'nobody' owner of this directory, run <span class="command"><strong>chown nobody /var/lib/bitlbee</strong></span>.
68
'nobody' owner of this directory, run <span><strong class="command">chown nobody /var/lib/bitlbee</strong></span>.
69
Because things like passwords are saved in this directory, it's probably
69
Because things like passwords are saved in this directory, it's probably
70
a good idea to make this directory owner-read-/writable only.
70
a good idea to make this directory owner-read-/writable only.
71
</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Usage"></a>Chapter 2. Usage</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id282720">Connecting to the server</a></span></dt><dt><span class="sect1"><a href="#id282732">The &amp;bitlbee control channel</a></span></dt><dt><span class="sect1"><a href="#id282769">Talking to people</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id282720"></a>Connecting to the server</h2></div></div></div><p>
71
</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Usage"></a>Chapter 2. Usage</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id267313">Connecting to the server</a></span></dt><dt><span class="sect1"><a href="#id267325">The &amp;bitlbee control channel</a></span></dt><dt><span class="sect1"><a href="#id267362">Talking to people</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267313"></a>Connecting to the server</h2></div></div></div><p>
72
Since BitlBee acts just like any other irc daemon, you can connect to 
72
Since BitlBee acts just like any other irc daemon, you can connect to 
73
it with your favorite irc client. Launch it and connect to localhost port 6667
73
it with your favorite irc client. Launch it and connect to localhost port 6667
74
(or whatever host/port you are running bitlbee on).
74
(or whatever host/port you are running bitlbee on).
75
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id282732"></a>The &amp;bitlbee control channel</h2></div></div></div><p>
75
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267325"></a>The &amp;bitlbee control channel</h2></div></div></div><p>
76
Once you are connected to the BitlBee server, you are automatically joined
76
Once you are connected to the BitlBee server, you are automatically joined
77
to &amp;bitlbee on that server. This channel acts like the 'buddy list' you have
77
to &amp;bitlbee on that server. This channel acts like the 'buddy list' you have
78
on the various other chat networks.
78
on the various other chat networks.
Lines 88-111 Link Here
88
the BitlBee control channel is local to one server (and in fact, to one person),
88
the BitlBee control channel is local to one server (and in fact, to one person),
89
this name seems more suitable. Also, with this name, it's harder to confuse
89
this name seems more suitable. Also, with this name, it's harder to confuse
90
the control channel with the #bitlbee channel on OFTC.
90
the control channel with the #bitlbee channel on OFTC.
91
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id282769"></a>Talking to people</h2></div></div></div><p>
91
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267362"></a>Talking to people</h2></div></div></div><p>
92
You can talk to by starting a query with them. In most irc clients, 
92
You can talk to by starting a query with them. In most irc clients, 
93
this can be done with either <span class="command"><strong>/msg &lt;nick&gt; &lt;text&gt;</strong></span>
93
this can be done with either <span><strong class="command">/msg &lt;nick&gt; &lt;text&gt;</strong></span>
94
or <span class="command"><strong>/query &lt;nick&gt;</strong></span>.
94
or <span><strong class="command">/query &lt;nick&gt;</strong></span>.
95
</p><p>
95
</p><p>
96
To keep the number of open query windows limited, you can also talk to people
96
To keep the number of open query windows limited, you can also talk to people
97
in the control channel, like <span class="command"><strong>&lt;nick&gt;: &lt;text&gt;</strong></span>.
97
in the control channel, like <span><strong class="command">&lt;nick&gt;: &lt;text&gt;</strong></span>.
98
</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Support"></a>Chapter 3. Support</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id282811">Disclaimer</a></span></dt><dt><span class="sect1"><a href="#id282823">Support channels</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id282829">The World Wide Web</a></span></dt><dt><span class="sect2"><a href="#id323466">IRC</a></span></dt><dt><span class="sect2"><a href="#id323476">Mailinglists</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id282811"></a>Disclaimer</h2></div></div></div><p>
98
</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Support"></a>Chapter 3. Support</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id267405">BitlBee is beta software</a></span></dt><dt><span class="sect1"><a href="#id267417">Support channels</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id307828">The World Wide Web</a></span></dt><dt><span class="sect2"><a href="#id307843">IRC</a></span></dt><dt><span class="sect2"><a href="#id307853">Mailinglists</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267405"></a>BitlBee is beta software</h2></div></div></div><p>
99
BitlBee doesn't come with a warranty and is still (and will probably always
99
Although BitlBee has quite some functionality it is still beta. That means it 
100
be) under development. That means it can crash at any time, corrupt your
100
can crash at any time, corrupt your data or whatever. Don't use it in 
101
data or whatever. Don't use it in any production environment and don't rely
101
any production environment and don't rely on it.
102
on it, or at least don't blame us if things blow up. :-)
102
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id267417"></a>Support channels</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id307828"></a>The World Wide Web</h3></div></div></div><p><a href="http://www.bitlbee.org/" target="_top">http://www.bitlbee.org/</a> 
103
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id282823"></a>Support channels</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id282829"></a>The World Wide Web</h3></div></div></div><p><a class="ulink" href="http://www.bitlbee.org/" target="_top">http://www.bitlbee.org/</a> 
104
is the homepage of bitlbee and contains the most recent news on bitlbee and 
103
is the homepage of bitlbee and contains the most recent news on bitlbee and 
105
the latest releases.
104
the latest releases.
106
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id323466"></a>IRC</h3></div></div></div><p>
105
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id307843"></a>IRC</h3></div></div></div><p>
107
BitlBee is discussed on #bitlbee on the OFTC IRC network (server: irc.oftc.net).
106
BitlBee is discussed on #bitlbee on the OFTC IRC network (server: irc.oftc.net).
108
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id323476"></a>Mailinglists</h3></div></div></div><p>
107
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id307853"></a>Mailinglists</h3></div></div></div><p>
109
BitlBee doesn't have any mailinglists.
108
BitlBee doesn't have any mailinglists.
110
</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="quickstart"></a>Chapter 4. Quickstart</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#quickstart2">Add and Connect To your IM Account(s)</a></span></dt><dt><span class="sect1"><a href="#quickstart3">Managing Contact Lists: Rename</a></span></dt><dt><span class="sect1"><a href="#quickstart4">Step Four: Managing Contact Lists: Add and Remove.</a></span></dt><dt><span class="sect1"><a href="#quickstart5">Chatting</a></span></dt><dt><span class="sect1"><a href="#quickstart6">Further Resources</a></span></dt></dl></div><p>
109
</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="quickstart"></a>Chapter 4. Quickstart</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#quickstart2">Add and Connect To your IM Account(s)</a></span></dt><dt><span class="sect1"><a href="#quickstart3">Managing Contact Lists: Rename</a></span></dt><dt><span class="sect1"><a href="#quickstart4">Step Four: Managing Contact Lists: Add and Remove.</a></span></dt><dt><span class="sect1"><a href="#quickstart5">Chatting</a></span></dt><dt><span class="sect1"><a href="#quickstart6">Further Resources</a></span></dt></dl></div><p>
111
Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber and Yahoo Instant Messaging Systems.
110
Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber and Yahoo Instant Messaging Systems.
Lines 122-140 Link Here
122
      </p><p>
121
      </p><p>
123
To add an account to the account list you will need to use the <span class="emphasis"><em>account add</em></span> command: <span class="emphasis"><em>account add &lt;protocol&gt; &lt;username&gt; &lt;password&gt; [&lt;server&gt;]</em></span>.
122
To add an account to the account list you will need to use the <span class="emphasis"><em>account add</em></span> command: <span class="emphasis"><em>account add &lt;protocol&gt; &lt;username&gt; &lt;password&gt; [&lt;server&gt;]</em></span>.
124
</p><p>
123
</p><p>
125
For instance, suppose you have a Jabber account at jabber.org with handle <span class="emphasis"><em>bitlbee@jabber.org</em></span> with password <span class="emphasis"><em>QuickStart</em></span>, you would:
124
For instance, suppose you have an ICQ account with UIN <span class="emphasis"><em>72696705</em></span> with password <span class="emphasis"><em>QuickStart</em></span>, you would:
126
</p><pre class="screen"><code class="prompt">&lt; you&gt; </code><strong class="userinput"><code>account add jabber bitlbee@jabber.org QuickStart</code></strong>
125
</p><pre class="screen"><code class="prompt">&lt; you&gt; </code><strong class="userinput"><code>account add oscar 72696705 QuickStart login.icq.com</code></strong>
127
<code class="prompt">&lt; root&gt; </code><strong class="userinput"><code>Account successfully added</code></strong>
126
<code class="prompt">&lt; root&gt; </code><strong class="userinput"><code>Account successfully added</code></strong>
128
</pre><p>
127
</pre><p>
129
Other available IM protocols are msn, oscar, and yahoo. OSCAR is the protocol used by ICQ and AOL. For more information about the <span class="emphasis"><em>account add</em></span> command, see <span class="emphasis"><em>help account add</em></span>.
128
Other available IM protocols are jabber, msn, and yahoo. Oscar is the protocol used by ICQ and AOL. For oscar, you need to specify the IM-server as a fourth argument (for msn and yahoo there is no fourth argument). For AOL Instant Messenger, the server name is <span class="emphasis"><em>login.oscar.aol.com</em></span>. For ICQ, the server name is <span class="emphasis"><em>login.icq.com</em></span>.
130
</p><p>
129
</p><p>
131
When you are finished adding your account(s) use the <span class="emphasis"><em>account on</em></span> command to enable all your accounts, type <span class="emphasis"><em>help quickstart3</em></span> to continue.
130
When you are finished adding your account(s) use the <span class="emphasis"><em>account on</em></span> command to enable all your accounts, type <span class="emphasis"><em>help quickstart3</em></span> to continue.
132
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="quickstart3"></a>Managing Contact Lists: Rename</h2></div></div></div><p>
131
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="quickstart3"></a>Managing Contact Lists: Rename</h2></div></div></div><p>
133
        <span class="emphasis"><em>Step Three: Managing Contact Lists: Rename</em></span>
132
        <span class="emphasis"><em>Step Three: Managing Contact Lists: Rename</em></span>
134
      </p><p>
133
      </p><p>
135
Now BitlBee logs in and downloads the contact list from the IM server. In a few seconds, all your on-line buddies should show up in the control channel.
134
For most protocols (currently MSN, Jabber, Yahoo and AOL) BitlBee can download the contact list automatically from the IM server and all the on-line users should appear in the control channel when you log in.
136
</p><p>
135
</p><p>
137
BitlBee will convert names into IRC-friendly form (for instance: tux@example.com will be given the nickname tux). If you have more than one person who would have the same name by this logic (for instance: tux@example.com and tux@bitlbee.org) the second one to log on will be tux_. The same is true if you have a tux log on to AOL and a tux log on from Yahoo.
136
BitlBee will convert names into irc-friendly form (for instance: tux@example.com will be given the nickname tux). If you have more than one person who would have the same name by this logic (for instance: tux@example.com and tux@bitlbee.org) the second one to log on will be tux_. The same is true if you have a tux log on to AOL and a tux log on from Yahoo.
138
</p><p>
137
</p><p>
139
It would be easy to get these two mixed up, so BitlBee has a <span class="emphasis"><em>rename</em></span> command to change the nickname into something more suitable: <span class="emphasis"><em>rename &lt;oldnick&gt; &lt;newnick&gt;</em></span></p><pre class="screen"><code class="prompt">&lt; you&gt; </code><strong class="userinput"><code>rename tux_ bitlbeetux</code></strong>
138
It would be easy to get these two mixed up, so BitlBee has a <span class="emphasis"><em>rename</em></span> command to change the nickname into something more suitable: <span class="emphasis"><em>rename &lt;oldnick&gt; &lt;newnick&gt;</em></span></p><pre class="screen"><code class="prompt">&lt; you&gt; </code><strong class="userinput"><code>rename tux_ bitlbeetux</code></strong>
140
 * tux_ is now known as bitlbeetux
139
 * tux_ is now known as bitlbeetux
Lines 158-166 Link Here
158
</p><pre class="screen"><code class="prompt">&lt; you&gt; </code><strong class="userinput"><code>tux: hey, how's the weather down there?</code></strong>
157
</p><pre class="screen"><code class="prompt">&lt; you&gt; </code><strong class="userinput"><code>tux: hey, how's the weather down there?</code></strong>
159
<code class="prompt">&lt; tux&gt; </code><strong class="userinput"><code>you: a bit chilly!</code></strong>
158
<code class="prompt">&lt; tux&gt; </code><strong class="userinput"><code>you: a bit chilly!</code></strong>
160
</pre><p>
159
</pre><p>
161
Note that, although all contacts are in the &amp;bitlbee channel, only tux will actually receive this message. The &amp;bitlbee channel shouldn't be confused with a real IRC channel.
160
If you'd rather chat with them in a separate window use the <span class="emphasis"><em>/msg</em></span> or <span class="emphasis"><em>/query</em></span> command, just like you would for a private message in IRC.  If you want to have messages automatically come up in private messages rather than in the &amp;bitlbee channel, use the <span class="emphasis"><em>set private</em></span> command: <span class="emphasis"><em>set private true</em></span> (<span class="emphasis"><em>set private false</em></span> to change back).
162
</p><p>
163
If you prefer chatting in a separate window, use the <span class="emphasis"><em>/msg</em></span> or <span class="emphasis"><em>/query</em></span> command, just like on real IRC. BitlBee will remember how you talk to someone and show his/her responses the same way. If you want to change the default behaviour (for people you haven't talked to yet), see <span class="emphasis"><em>help set private</em></span>.
164
</p><p>
161
</p><p>
165
You know the basics. If you want to get to know more about BitlBee, please type <span class="emphasis"><em>help quickstart6</em></span>.
162
You know the basics. If you want to get to know more about BitlBee, please type <span class="emphasis"><em>help quickstart6</em></span>.
166
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="quickstart6"></a>Further Resources</h2></div></div></div><p>
163
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="quickstart6"></a>Further Resources</h2></div></div></div><p>
Lines 171-188 Link Here
171
For more subjects (like groupchats and away states), please type <span class="emphasis"><em>help index</em></span>.
168
For more subjects (like groupchats and away states), please type <span class="emphasis"><em>help index</em></span>.
172
</p><p>
169
</p><p>
173
If you're still looking for something, please visit us in #bitlbee on the OFTC network (you can connect via irc.bitlbee.org), or mail us your problem/suggestion. Good luck and enjoy the Bee!
170
If you're still looking for something, please visit us in #bitlbee on the OFTC network (you can connect via irc.bitlbee.org), or mail us your problem/suggestion. Good luck and enjoy the Bee!
174
</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="commands"></a>Chapter 5. Bitlbee commands</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#cmd_account">account - IM-account list maintenance</a></span></dt><dd><dl><dt><span class="sect2"><a href="#cmd_account_add">account add</a></span></dt><dt><span class="sect2"><a href="#cmd_account_del">account del</a></span></dt><dt><span class="sect2"><a href="#cmd_account_on">account on</a></span></dt><dt><span class="sect2"><a href="#cmd_account_off">account off</a></span></dt><dt><span class="sect2"><a href="#cmd_account_list">account list</a></span></dt><dt><span class="sect2"><a href="#cmd_account_set">account set</a></span></dt></dl></dd><dt><span class="sect1"><a href="#cmd_add">add - Add a buddy to your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_info">info - Request user information</a></span></dt><dt><span class="sect1"><a href="#cmd_remove">remove - Remove a buddy from your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_block">block - Block someone</a></span></dt><dt><span class="sect1"><a href="#cmd_allow">allow - Unblock someone</a></span></dt><dt><span class="sect1"><a href="#cmd_set">set - Miscellaneous settings</a></span></dt><dt><span class="sect1"><a href="#cmd_help">help - BitlBee help system</a></span></dt><dt><span class="sect1"><a href="#cmd_save">save - Save your account data</a></span></dt><dt><span class="sect1"><a href="#set_auto_connect">auto_connect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect">auto_reconnect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect_delay">auto_reconnect_delay</a></span></dt><dt><span class="sect1"><a href="#set_away_devoice">away_devoice</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer">buddy_sendbuffer</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer_delay">buddy_sendbuffer_delay</a></span></dt><dt><span class="sect1"><a href="#set_charset">charset</a></span></dt><dt><span class="sect1"><a href="#set_debug">debug</a></span></dt><dt><span class="sect1"><a href="#set_default_target">default_target</a></span></dt><dt><span class="sect1"><a href="#set_display_name">display_name</a></span></dt><dt><span class="sect1"><a href="#set_display_namechanges">display_namechanges</a></span></dt><dt><span class="sect1"><a href="#set_handle_unknown">handle_unknown</a></span></dt><dt><span class="sect1"><a href="#set_lcnicks">lcnicks</a></span></dt><dt><span class="sect1"><a href="#set_mail_notifications">mail_notifications</a></span></dt><dt><span class="sect1"><a href="#set_ops">ops</a></span></dt><dt><span class="sect1"><a href="#set_password">password</a></span></dt><dt><span class="sect1"><a href="#set_port">port</a></span></dt><dt><span class="sect1"><a href="#set_priority">priority</a></span></dt><dt><span class="sect1"><a href="#set_private">private</a></span></dt><dt><span class="sect1"><a href="#set_query_order">query_order</a></span></dt><dt><span class="sect1"><a href="#set_resource">resource</a></span></dt><dt><span class="sect1"><a href="#set_resource_select">resource_select</a></span></dt><dt><span class="sect1"><a href="#set_save_on_quit">save_on_quit</a></span></dt><dt><span class="sect1"><a href="#set_server">server</a></span></dt><dt><span class="sect1"><a href="#set_simulate_netsplit">simulate_netsplit</a></span></dt><dt><span class="sect1"><a href="#set_ssl">ssl</a></span></dt><dt><span class="sect1"><a href="#set_strip_html">strip_html</a></span></dt><dt><span class="sect1"><a href="#set_tls">tls</a></span></dt><dt><span class="sect1"><a href="#set_to_char">to_char</a></span></dt><dt><span class="sect1"><a href="#set_typing_notice">typing_notice</a></span></dt><dt><span class="sect1"><a href="#set_web_aware">web_aware</a></span></dt><dt><span class="sect1"><a href="#set_xmlconsole">xmlconsole</a></span></dt><dt><span class="sect1"><a href="#cmd_rename">rename - Rename (renick) a buddy</a></span></dt><dt><span class="sect1"><a href="#cmd_yes">yes - Accept a request</a></span></dt><dt><span class="sect1"><a href="#cmd_no">no - Deny a request</a></span></dt><dt><span class="sect1"><a href="#cmd_qlist">qlist - List all the unanswered questions root asked</a></span></dt><dt><span class="sect1"><a href="#cmd_register">register - Register yourself</a></span></dt><dt><span class="sect1"><a href="#cmd_identify">identify - Identify yourself with your password</a></span></dt><dt><span class="sect1"><a href="#cmd_drop">drop - Drop your account</a></span></dt><dt><span class="sect1"><a href="#cmd_blist">blist - List all the buddies in your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_nick">nick - Change friendly name, nick</a></span></dt><dt><span class="sect1"><a href="#cmd_join_chat">join_chat - Join a named groupchat/conference room</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_account"></a>account - IM-account list maintenance</h2></div></div></div><p><b>Syntax: </b>
171
</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="commands"></a>Chapter 5. Bitlbee commands</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#cmd_account">account - IM-account list maintenance</a></span></dt><dd><dl><dt><span class="sect2"><a href="#cmd_account_add">account add</a></span></dt><dt><span class="sect2"><a href="#cmd_account_del">account del</a></span></dt><dt><span class="sect2"><a href="#cmd_account_on">account on</a></span></dt><dt><span class="sect2"><a href="#cmd_account_off">account off</a></span></dt><dt><span class="sect2"><a href="#cmd_account_list">account list</a></span></dt><dt><span class="sect2"><a href="#cmd_account_set">account set</a></span></dt></dl></dd><dt><span class="sect1"><a href="#cmd_add">add - Add a buddy to your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_info">info - Request user information</a></span></dt><dt><span class="sect1"><a href="#cmd_remove">remove - Remove a buddy from your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_block">block - Block someone</a></span></dt><dt><span class="sect1"><a href="#cmd_allow">allow - Unblock someone</a></span></dt><dt><span class="sect1"><a href="#cmd_set">set - Miscellaneous settings</a></span></dt><dt><span class="sect1"><a href="#cmd_help">help - BitlBee help system</a></span></dt><dt><span class="sect1"><a href="#cmd_save">save - Save your account data</a></span></dt><dt><span class="sect1"><a href="#set_auto_connect">auto_connect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect">auto_reconnect</a></span></dt><dt><span class="sect1"><a href="#set_auto_reconnect_delay">auto_reconnect_delay</a></span></dt><dt><span class="sect1"><a href="#set_away_devoice">away_devoice</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer">buddy_sendbuffer</a></span></dt><dt><span class="sect1"><a href="#set_buddy_sendbuffer_delay">buddy_sendbuffer_delay</a></span></dt><dt><span class="sect1"><a href="#set_charset">charset</a></span></dt><dt><span class="sect1"><a href="#set_debug">debug</a></span></dt><dt><span class="sect1"><a href="#set_default_target">default_target</a></span></dt><dt><span class="sect1"><a href="#set_display_name">display_name</a></span></dt><dt><span class="sect1"><a href="#set_display_namechanges">display_namechanges</a></span></dt><dt><span class="sect1"><a href="#set_handle_unknown">handle_unknown</a></span></dt><dt><span class="sect1"><a href="#set_lcnicks">lcnicks</a></span></dt><dt><span class="sect1"><a href="#set_ops">ops</a></span></dt><dt><span class="sect1"><a href="#set_password">password</a></span></dt><dt><span class="sect1"><a href="#set_port">port</a></span></dt><dt><span class="sect1"><a href="#set_priority">priority</a></span></dt><dt><span class="sect1"><a href="#set_private">private</a></span></dt><dt><span class="sect1"><a href="#set_query_order">query_order</a></span></dt><dt><span class="sect1"><a href="#set_resource">resource</a></span></dt><dt><span class="sect1"><a href="#set_resource_select">resource_select</a></span></dt><dt><span class="sect1"><a href="#set_save_on_quit">save_on_quit</a></span></dt><dt><span class="sect1"><a href="#set_server">server</a></span></dt><dt><span class="sect1"><a href="#set_simulate_netsplit">simulate_netsplit</a></span></dt><dt><span class="sect1"><a href="#set_ssl">ssl</a></span></dt><dt><span class="sect1"><a href="#set_strip_html">strip_html</a></span></dt><dt><span class="sect1"><a href="#set_tls">tls</a></span></dt><dt><span class="sect1"><a href="#set_to_char">to_char</a></span></dt><dt><span class="sect1"><a href="#set_typing_notice">typing_notice</a></span></dt><dt><span class="sect1"><a href="#set_web_aware">web_aware</a></span></dt><dt><span class="sect1"><a href="#set_xmlconsole">xmlconsole</a></span></dt><dt><span class="sect1"><a href="#cmd_rename">rename - Rename (renick) a buddy</a></span></dt><dt><span class="sect1"><a href="#cmd_yes">yes - Accept a request</a></span></dt><dt><span class="sect1"><a href="#cmd_no">no - Deny a request</a></span></dt><dt><span class="sect1"><a href="#cmd_qlist">qlist - List all the unanswered questions root asked</a></span></dt><dt><span class="sect1"><a href="#cmd_register">register - Register yourself</a></span></dt><dt><span class="sect1"><a href="#cmd_identify">identify - Identify yourself with your password</a></span></dt><dt><span class="sect1"><a href="#cmd_drop">drop - Drop your account</a></span></dt><dt><span class="sect1"><a href="#cmd_blist">blist - List all the buddies in your contact list</a></span></dt><dt><span class="sect1"><a href="#cmd_nick">nick - Change friendly name, nick</a></span></dt><dt><span class="sect1"><a href="#cmd_join_chat">join_chat - Join a named groupchat/conference room</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_account"></a>account - IM-account list maintenance</h2></div></div></div><p><b>Syntax: </b>
175
          </p><pre class="programlisting">account &lt;action&gt; [&lt;arguments&gt;]
172
          </p><pre class="programlisting">account &lt;action&gt; [&lt;arguments&gt;]
176
</pre><p>
173
</pre><p>
177
        </p><p>
174
        </p><p>
178
				Available actions: add, del, list, on, off and set. See <span class="emphasis"><em>help account &lt;action&gt;</em></span> for more information.
175
				Available actions: add, del, list, on, off and set. See <span class="emphasis"><em>help account &lt;action&gt;</em></span> for more information.
179
			</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add"></a>account add</h3></div></div></div><p><b>Syntax: </b>
176
			</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add"></a>account add</h3></div></div></div><p><b>Syntax: </b>
180
            </p><pre class="programlisting">account add &lt;protocol&gt; &lt;username&gt; &lt;password&gt;
177
            </p><pre class="programlisting">account add &lt;protocol&gt; &lt;username&gt; &lt;password&gt; [&lt;server&gt;]
181
</pre><p>
178
</pre><p>
182
          </p><p>
179
          </p><p>
183
					Adds an account on the given server with the specified protocol, username and password to the account list. Supported protocols right now are: Jabber, MSN, OSCAR (AIM/ICQ) and Yahoo. For more information about adding an account, see <span class="emphasis"><em>help account add &lt;protocol&gt;</em></span>.
180
					Adds an account on the given server with the specified protocol, username and password to the account list. Supported protocols right now are: Jabber, MSN, OSCAR (AIM/ICQ) and Yahoo. For more information about adding an account, see <span class="emphasis"><em>help account add &lt;protocol&gt;</em></span>.
184
				</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add_jabber"></a>account add jabber</h3></div></div></div><p><b>Syntax: </b>
181
				</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add_jabber"></a>account add jabber</h3></div></div></div><p><b>Syntax: </b>
185
              </p><pre class="programlisting">account add jabber &lt;handle@server.tld&gt; &lt;password&gt;
182
              </p><pre class="programlisting">account add jabber &lt;handle@server.tld&gt; &lt;password&gt; [&lt;servertag&gt;]
186
</pre><p>
183
</pre><p>
187
            </p><p>
184
            </p><p>
188
						The handle should be a full handle, including the domain name. You can specify a servername if necessary. Normally BitlBee doesn't need this though, since it's able to find out the server by doing DNS SRV lookups.
185
						The handle should be a full handle, including the domain name. You can specify a servername if necessary. Normally BitlBee doesn't need this though, since it's able to find out the server by doing DNS SRV lookups.
Lines 194-204 Link Here
194
            </p><p>
191
            </p><p>
195
						For MSN connections there are no special arguments.
192
						For MSN connections there are no special arguments.
196
					</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add_oscar"></a>account add oscar</h3></div></div></div><p><b>Syntax: </b>
193
					</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add_oscar"></a>account add oscar</h3></div></div></div><p><b>Syntax: </b>
197
              </p><pre class="programlisting">account add oscar &lt;handle&gt; &lt;password&gt;
194
              </p><pre class="programlisting">account add oscar &lt;handle&gt; &lt;password&gt; [&lt;servername&gt;]
198
</pre><p>
195
</pre><p>
199
            </p><p>
196
            </p><p>
200
						OSCAR is the protocol used to connect to AIM and/or ICQ. The servers will automatically detect if you're using a numeric or non-numeric username so there's no need to tell which network you want to connect to.
197
						Specifying a server is required for OSCAR, since OSCAR can be used for both ICQ- and AIM-connections. Although these days it's supposed to be possible to connect to ICQ via AIM-servers and vice versa, we like to stick with this separation for now. For ICQ connections, the servername is <span class="emphasis"><em>login.icq.com</em></span>, for AIM connections it's <span class="emphasis"><em>login.oscar.aol.com</em></span>.
201
					</p><pre class="screen"><code class="prompt">&lt; wilmer&gt; </code><strong class="userinput"><code>account add oscar 72696705 hobbelmeeuw</code></strong>
198
					</p><pre class="screen"><code class="prompt">&lt; wilmer&gt; </code><strong class="userinput"><code>account add oscar 72696705 hobbelmeeuw login.icq.com</code></strong>
202
<code class="prompt">&lt; root&gt; </code><strong class="userinput"><code>Account successfully added</code></strong>
199
<code class="prompt">&lt; root&gt; </code><strong class="userinput"><code>Account successfully added</code></strong>
203
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add_yahoo"></a>account add yahoo</h3></div></div></div><p><b>Syntax: </b>
200
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cmd_account_add_yahoo"></a>account add yahoo</h3></div></div></div><p><b>Syntax: </b>
204
              </p><pre class="programlisting">account add yahoo &lt;handle&gt; &lt;password&gt;
201
              </p><pre class="programlisting">account add yahoo &lt;handle&gt; &lt;password&gt;
Lines 250-256 Link Here
250
        </p><p>
247
        </p><p>
251
				Adds the given buddy at the specified connection to your buddy list. The account ID can be a number (see <span class="emphasis"><em>account list</em></span>), the protocol name or (part of) the screenname, as long as it matches only one connection.
248
				Adds the given buddy at the specified connection to your buddy list. The account ID can be a number (see <span class="emphasis"><em>account list</em></span>), the protocol name or (part of) the screenname, as long as it matches only one connection.
252
			</p><p>
249
			</p><p>
253
				If you want, you can also tell BitlBee what nick to give the new contact. The -tmp option adds the buddy to the internal BitlBee structures only, not to the real contact list (like done by <span class="emphasis"><em>set handle_unknown add</em></span>). This allows you to talk to people who are not in your contact list. This normally won't show you any presence notifications.
250
				If you want, you can also tell BitlBee what nick to give the new contact. Of course you can also use the <span class="emphasis"><em>rename</em></span> command for that, but sometimes this might be more convenient.
251
			</p><p>
252
				Adding -tmp adds the buddy to the internal BitlBee structures only, not to the real contact list (like done by <span class="emphasis"><em>set handle_unknown add</em></span>). This allows you to talk to people who are not in your contact list.
254
			</p><pre class="screen"><code class="prompt">&lt; ctrlsoft&gt; </code><strong class="userinput"><code>add 3 gryp@jabber.org grijp</code></strong>
253
			</p><pre class="screen"><code class="prompt">&lt; ctrlsoft&gt; </code><strong class="userinput"><code>add 3 gryp@jabber.org grijp</code></strong>
255
 * grijp has joined &amp;bitlbee
254
 * grijp has joined &amp;bitlbee
256
</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_info"></a>info - Request user information</h2></div></div></div><p><b>Syntax: </b>
255
</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_info"></a>info - Request user information</h2></div></div></div><p><b>Syntax: </b>
Lines 333-341 Link Here
333
			</p><p>
332
			</p><p>
334
				See also the <span class="emphasis"><em>buddy_sendbuffer</em></span> setting.
333
				See also the <span class="emphasis"><em>buddy_sendbuffer</em></span> setting.
335
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_charset"></a>charset</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
334
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_charset"></a>charset</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
336
				This setting tells BitlBee what your IRC client sends and expects. It should be equal to the charset setting of your IRC client if you want to be able to send and receive non-ASCII text properly.
335
				The charset setting enables you to use different character sets in BitlBee. These get converted to UTF-8 before sending and from UTF-8 when receiving.
337
			</p><p>
336
			</p><p>
338
				Most systems use UTF-8 these days. On older systems, an iso8859 charset may work better. For example, iso8859-1 is the best choice for most Western countries. You can try to find what works best for you on http://www.unicodecharacter.com/charsets/iso8859.html
337
				If you don't know what's the best value for this, at least iso8859-1 is the best choice for most Western countries. You can try to find what works best for you on http://czyborra.com/charsets/iso8859.html
339
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_debug"></a>debug</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
338
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_debug"></a>debug</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
340
				Some debugging messages can be sent to the control channel if you wish. They're probably not really useful for you, unless you're doing some development on BitlBee.
339
				Some debugging messages can be sent to the control channel if you wish. They're probably not really useful for you, unless you're doing some development on BitlBee.
341
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_default_target"></a>default_target</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
340
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_default_target"></a>default_target</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
Lines 350-357 Link Here
350
				If you want this lame user to be added automatically, you can set this setting to "add". If you prefer to ignore messages from people you don't know, you can set this one to "ignore". "add_private" and "add_channel" are like add, but you can use them to make messages from unknown buddies appear in the channel instead of a query window.
349
				If you want this lame user to be added automatically, you can set this setting to "add". If you prefer to ignore messages from people you don't know, you can set this one to "ignore". "add_private" and "add_channel" are like add, but you can use them to make messages from unknown buddies appear in the channel instead of a query window.
351
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_lcnicks"></a>lcnicks</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
350
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_lcnicks"></a>lcnicks</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
352
				Hereby you can change whether you want all lower case nick names or leave the case as it intended by your peer.
351
				Hereby you can change whether you want all lower case nick names or leave the case as it intended by your peer.
353
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_mail_notifications"></a>mail_notifications</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
354
				Some protocols (MSN, Yahoo!) can notify via IM about new e-mail. Since most people use their Hotmail/Yahoo! addresses as a spam-box, this is disabled default. If you want these notifications, you can enable this setting.
355
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_ops"></a>ops</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
352
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_ops"></a>ops</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
356
				Some people prefer themself and root to have operator status in &amp;bitlbee, other people don't. You can change these states using this setting.
353
				Some people prefer themself and root to have operator status in &amp;bitlbee, other people don't. You can change these states using this setting.
357
			</p><p>
354
			</p><p>
Lines 385-391 Link Here
385
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_save_on_quit"></a>save_on_quit</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
382
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_save_on_quit"></a>save_on_quit</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
386
				If enabled causes BitlBee to save all current settings and account details when user disconnects. This is enabled by default, and these days there's not really a reason to have it disabled anymore.
383
				If enabled causes BitlBee to save all current settings and account details when user disconnects. This is enabled by default, and these days there's not really a reason to have it disabled anymore.
387
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_server"></a>server</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
384
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_server"></a>server</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
388
				Can be set for Jabber- and OSCAR-connections. For Jabber, you might have to set this if the servername isn't equal to the part after the @ in the Jabber handle. For OSCAR this shouldn't be necessary anymore in recent BitlBee versions.
385
				Can be set for Jabber- and OSCAR-connections. For OSCAR, this must be set to <span class="emphasis"><em>login.icq.com</em></span> if it's an ICQ connection, or <span class="emphasis"><em>login.oscar.aol.com</em></span> if it's an AIM connection. For Jabber, you have to set this if the servername isn't equal to the part after the @ in the Jabber handle.
389
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_simulate_netsplit"></a>simulate_netsplit</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
386
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_simulate_netsplit"></a>simulate_netsplit</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
390
				Some IRC clients parse quit messages sent by the IRC server to see if someone really left or just disappeared because of a netsplit. By default, BitlBee tries to simulate netsplit-like quit messages to keep the control channel window clean. If you don't like this (or if your IRC client doesn't support this) you can disable this setting.
387
				Some IRC clients parse quit messages sent by the IRC server to see if someone really left or just disappeared because of a netsplit. By default, BitlBee tries to simulate netsplit-like quit messages to keep the control channel window clean. If you don't like this (or if your IRC client doesn't support this) you can disable this setting.
391
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_ssl"></a>ssl</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
388
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_ssl"></a>ssl</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
Lines 403-409 Link Here
403
			</p><p>
400
			</p><p>
404
				Please note that this setting is only used for incoming messages. For outgoing messages you can use ':' (colon) or ',' to separate the destination nick from the message, and this is not configurable.
401
				Please note that this setting is only used for incoming messages. For outgoing messages you can use ':' (colon) or ',' to separate the destination nick from the message, and this is not configurable.
405
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_typing_notice"></a>typing_notice</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
402
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_typing_notice"></a>typing_notice</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: boolean</td></tr></table><p>
406
				Sends you a /notice when a user starts typing a message (if supported by the IM protocol and the user's client). To use this, you most likely want to use a script in your IRC client to show this information in a more sensible way.
403
				Sends you a /notice when a user starts typing a message (if the protocol supports it, MSN for example). This is a bug, not a feature. (But please don't report it.. ;-) You don't want to use it. Really. In fact the typing-notification is just one of the least useful 'innovations' ever. It's just there because some guy will probably ask me about it anyway. ;-)
407
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_web_aware"></a>web_aware</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
404
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="set_web_aware"></a>web_aware</h2></div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Type: string</td></tr></table><p>
408
				ICQ allows people to see if you're on-line via a CGI-script. (http://status.icq.com/online.gif?icq=UIN) This can be nice to put on your website, but it seems that spammers also use it to see if you're online without having to add you to their contact list. So to prevent ICQ spamming, recent versions of BitlBee disable this feature by default.
405
				ICQ allows people to see if you're on-line via a CGI-script. (http://status.icq.com/online.gif?icq=UIN) This can be nice to put on your website, but it seems that spammers also use it to see if you're online without having to add you to their contact list. So to prevent ICQ spamming, recent versions of BitlBee disable this feature by default.
409
			</p><p>
406
			</p><p>
Lines 466-477 Link Here
466
				You can get a better readable buddy list using the <span class="emphasis"><em>blist</em></span> command. If you want a complete list (including the offline users) you can use the <span class="emphasis"><em>all</em></span> argument.
463
				You can get a better readable buddy list using the <span class="emphasis"><em>blist</em></span> command. If you want a complete list (including the offline users) you can use the <span class="emphasis"><em>all</em></span> argument.
467
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_nick"></a>nick - Change friendly name, nick</h2></div></div></div><p><b>Syntax: </b>
464
			</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_nick"></a>nick - Change friendly name, nick</h2></div></div></div><p><b>Syntax: </b>
468
          </p><pre class="programlisting">nick &lt;connection&gt; [&lt;new nick&gt;]
465
          </p><pre class="programlisting">nick &lt;connection&gt; [&lt;new nick&gt;]
469
nick &lt;connection&gt;
466
nick
470
</pre><p>
467
</pre><p>
471
        </p><p>
468
        </p><p>
472
				Deprecated: Use the per-account <span class="emphasis"><em>display_name</em></span> setting to read and change this information.
469
				This command allows to set the friendly name of an im account. If no new name is specified the command will report the current name. When the name contains spaces, don't forget to quote the whole nick in double quotes. Currently this command is only supported by the MSN protocol.
473
			</p><pre class="screen"><code class="prompt">&lt; wouter&gt; </code><strong class="userinput"><code>account set 1/display_name "The majestik møøse"</code></strong>
470
			</p><p>
474
<code class="prompt">&lt; root&gt; </code><strong class="userinput"><code>display_name = `The majestik møøse'</code></strong>
471
				It is recommended to use the per-account <span class="emphasis"><em>display_name</em></span> setting to read and change this information. The <span class="emphasis"><em>nick</em></span> command is deprecated.
472
			</p><pre class="screen"><code class="prompt">&lt; wouter&gt; </code><strong class="userinput"><code>nick 1 "Wouter Paesen"</code></strong>
473
<code class="prompt">&lt; root&gt; </code><strong class="userinput"><code>Setting your name on connection 1 to `Wouter Paesen'</code></strong>
475
</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_join_chat"></a>join_chat - Join a named groupchat/conference room</h2></div></div></div><p><b>Syntax: </b>
474
</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="cmd_join_chat"></a>join_chat - Join a named groupchat/conference room</h2></div></div></div><p><b>Syntax: </b>
476
          </p><pre class="programlisting">join_chat &lt;connection&gt; &lt;room name&gt; [&lt;channel name&gt;] [&lt;room nickname&gt;] [&lt;password&gt;]
475
          </p><pre class="programlisting">join_chat &lt;connection&gt; &lt;room name&gt; [&lt;channel name&gt;] [&lt;room nickname&gt;] [&lt;password&gt;]
477
</pre><p>
476
</pre><p>
Lines 482-507 Link Here
482
			</p><p>
481
			</p><p>
483
				The following command will join you to the chatroom called <span class="emphasis"><em>bitlbee@conference.bitlbee.org</em></span>. The channel will be called <span class="emphasis"><em>&amp;bitlbee-help</em></span> because <span class="emphasis"><em>&amp;bitlbee</em></span> will already be in use. Your nickname will be <span class="emphasis"><em>help-me</em></span>.
482
				The following command will join you to the chatroom called <span class="emphasis"><em>bitlbee@conference.bitlbee.org</em></span>. The channel will be called <span class="emphasis"><em>&amp;bitlbee-help</em></span> because <span class="emphasis"><em>&amp;bitlbee</em></span> will already be in use. Your nickname will be <span class="emphasis"><em>help-me</em></span>.
484
			</p><pre class="screen"><code class="prompt">&lt; wilmer&gt; </code><strong class="userinput"><code>join_chat jabber bitlbee@conference.bitlbee.org &amp;bitlbee-help help-me</code></strong>
483
			</p><pre class="screen"><code class="prompt">&lt; wilmer&gt; </code><strong class="userinput"><code>join_chat jabber bitlbee@conference.bitlbee.org &amp;bitlbee-help help-me</code></strong>
485
</pre></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="misc"></a>Chapter 6. Misc Stuff</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#smileys">Smileys</a></span></dt><dt><span class="sect1"><a href="#groupchats">Groupchats</a></span></dt><dt><span class="sect1"><a href="#groupchats2">Creating groupchats</a></span></dt><dt><span class="sect1"><a href="#away">Away states</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="smileys"></a>Smileys</h2></div></div></div><p>
484
</pre></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="misc"></a>Chapter 6. Misc Stuff</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#smileys">Smileys</a></span></dt><dt><span class="sect1"><a href="#groupchats">Groupchats</a></span></dt><dt><span class="sect1"><a href="#groupchats2">Creating groupchats</a></span></dt><dt><span class="sect1"><a href="#groupchats3">Groupchat channel names</a></span></dt><dt><span class="sect1"><a href="#away">Away states</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="smileys"></a>Smileys</h2></div></div></div><p>
486
All MSN smileys (except one) are case insensitive and work without the nose too.
485
All MSN smileys (except one) are case insensitive and work without the nose too.
487
</p><div class="variablelist"><dl><dt><span class="term">(Y)</span></dt><dd><p>Thumbs up</p></dd><dt><span class="term">(N)</span></dt><dd><p>Thumbs down</p></dd><dt><span class="term">(B)</span></dt><dd><p>Beer mug</p></dd><dt><span class="term">(D)</span></dt><dd><p>Martini glass</p></dd><dt><span class="term">(X)</span></dt><dd><p>Girl</p></dd><dt><span class="term">(Z)</span></dt><dd><p>Boy</p></dd><dt><span class="term">(6)</span></dt><dd><p>Devil smiley</p></dd><dt><span class="term">:-[</span></dt><dd><p>Vampire bat</p></dd><dt><span class="term">(})</span></dt><dd><p>Right hug</p></dd><dt><span class="term">({)</span></dt><dd><p>Left hug</p></dd><dt><span class="term">(M)</span></dt><dd><p>MSN Messenger or Windows Messenger icon (think a BitlBee logo here ;)</p></dd><dt><span class="term">:-S</span></dt><dd><p>Crooked smiley (Confused smiley)</p></dd><dt><span class="term">:-$</span></dt><dd><p>Embarrassed smiley</p></dd><dt><span class="term">(H)</span></dt><dd><p>Smiley with sunglasses</p></dd><dt><span class="term">:-@</span></dt><dd><p>Angry smiley</p></dd><dt><span class="term">(A)</span></dt><dd><p>Angel smiley</p></dd><dt><span class="term">(L)</span></dt><dd><p>Red heart (Love)</p></dd><dt><span class="term">(U)</span></dt><dd><p>Broken heart</p></dd><dt><span class="term">(K)</span></dt><dd><p>Red lips (Kiss)</p></dd><dt><span class="term">(G)</span></dt><dd><p>Gift with bow</p></dd><dt><span class="term">(F)</span></dt><dd><p>Red rose</p></dd><dt><span class="term">(W)</span></dt><dd><p>Wilted rose</p></dd><dt><span class="term">(P)</span></dt><dd><p>Camera</p></dd><dt><span class="term">(~)</span></dt><dd><p>Film strip</p></dd><dt><span class="term">(T)</span></dt><dd><p>Telephone receiver</p></dd><dt><span class="term">(@)</span></dt><dd><p>Cat face</p></dd><dt><span class="term">(&amp;)</span></dt><dd><p>Dog's head</p></dd><dt><span class="term">(C)</span></dt><dd><p>Coffee cup</p></dd><dt><span class="term">(I)</span></dt><dd><p>Light bulb</p></dd><dt><span class="term">(S)</span></dt><dd><p>Half-moon (Case sensitive!)</p></dd><dt><span class="term">(*)</span></dt><dd><p>Star</p></dd><dt><span class="term">(8)</span></dt><dd><p>Musical eighth note</p></dd><dt><span class="term">(E)</span></dt><dd><p>Envelope</p></dd><dt><span class="term">(^)</span></dt><dd><p>Birthday cake</p></dd><dt><span class="term">(O)</span></dt><dd><p>Clock</p></dd></dl></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="groupchats"></a>Groupchats</h2></div></div></div><p>
486
</p><div class="variablelist"><dl><dt><span class="term">(Y)</span></dt><dd><p>Thumbs up</p></dd><dt><span class="term">(N)</span></dt><dd><p>Thumbs down</p></dd><dt><span class="term">(B)</span></dt><dd><p>Beer mug</p></dd><dt><span class="term">(D)</span></dt><dd><p>Martini glass</p></dd><dt><span class="term">(X)</span></dt><dd><p>Girl</p></dd><dt><span class="term">(Z)</span></dt><dd><p>Boy</p></dd><dt><span class="term">(6)</span></dt><dd><p>Devil smiley</p></dd><dt><span class="term">:-[</span></dt><dd><p>Vampire bat</p></dd><dt><span class="term">(})</span></dt><dd><p>Right hug</p></dd><dt><span class="term">({)</span></dt><dd><p>Left hug</p></dd><dt><span class="term">(M)</span></dt><dd><p>MSN Messenger or Windows Messenger icon (think a BitlBee logo here ;)</p></dd><dt><span class="term">:-S</span></dt><dd><p>Crooked smiley (Confused smiley)</p></dd><dt><span class="term">:-$</span></dt><dd><p>Embarrassed smiley</p></dd><dt><span class="term">(H)</span></dt><dd><p>Smiley with sunglasses</p></dd><dt><span class="term">:-@</span></dt><dd><p>Angry smiley</p></dd><dt><span class="term">(A)</span></dt><dd><p>Angel smiley</p></dd><dt><span class="term">(L)</span></dt><dd><p>Red heart (Love)</p></dd><dt><span class="term">(U)</span></dt><dd><p>Broken heart</p></dd><dt><span class="term">(K)</span></dt><dd><p>Red lips (Kiss)</p></dd><dt><span class="term">(G)</span></dt><dd><p>Gift with bow</p></dd><dt><span class="term">(F)</span></dt><dd><p>Red rose</p></dd><dt><span class="term">(W)</span></dt><dd><p>Wilted rose</p></dd><dt><span class="term">(P)</span></dt><dd><p>Camera</p></dd><dt><span class="term">(~)</span></dt><dd><p>Film strip</p></dd><dt><span class="term">(T)</span></dt><dd><p>Telephone receiver</p></dd><dt><span class="term">(@)</span></dt><dd><p>Cat face</p></dd><dt><span class="term">(&amp;)</span></dt><dd><p>Dog's head</p></dd><dt><span class="term">(C)</span></dt><dd><p>Coffee cup</p></dd><dt><span class="term">(I)</span></dt><dd><p>Light bulb</p></dd><dt><span class="term">(S)</span></dt><dd><p>Half-moon (Case sensitive!)</p></dd><dt><span class="term">(*)</span></dt><dd><p>Star</p></dd><dt><span class="term">(8)</span></dt><dd><p>Musical eighth note</p></dd><dt><span class="term">(E)</span></dt><dd><p>Envelope</p></dd><dt><span class="term">(^)</span></dt><dd><p>Birthday cake</p></dd><dt><span class="term">(O)</span></dt><dd><p>Clock</p></dd></dl></div><p>
488
BitlBee now supports groupchats on all IM networks. This text will try to explain you how they work.
487
This list was extracted from <a href="http://help.msn.com/!data/en_us/data/messengerv50.its51/%24content%24/EMOTICONS.HTM?H_APP=" target="_top">http://help.msn.com/!data/en_us/data/messengerv50.its51/$content$/EMOTICONS.HTM?H_APP=</a>.
488
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="groupchats"></a>Groupchats</h2></div></div></div><p>
489
Since version 0.8x, BitlBee supports groupchats on the MSN and Yahoo! networks. This text will try to explain you how they work.
489
</p><p>
490
</p><p>
490
As soon as someone invites you into a groupchat, you will be force-joined or invited (depending on the protocol) into a new virtual channel with all the people in there. You can leave the channel at any time, just like you would close the window in regular IM clients. Please note that root-commands don't work in groupchat channels, they only work in the control channel (or to root directly).
491
As soon as someone invites you into a groupchat, you will be force-joined or invited (depending on the protocol) into a new virtual channel with all the people in there. You can leave the channel at any time, just like you would close the window in regular IM clients. Please note that root-commands don't work in groupchat channels, they only work in the control channel (or to root directly).
491
</p><p>
492
</p><p>
492
Of course you can also create your own groupchats. Type <span class="emphasis"><em>help groupchats2</em></span> to see how.
493
Of course you can also create your own groupchats. Type <span class="emphasis"><em>help groupchats2</em></span> to see how.
493
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="groupchats2"></a>Creating groupchats</h2></div></div></div><p>
494
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="groupchats2"></a>Creating groupchats</h2></div></div></div><p>
494
If you want to start a groupchat with the person <span class="emphasis"><em>lisa_msn</em></span> in it, just join the channel <span class="emphasis"><em>#lisa_msn</em></span>. BitlBee will refuse to join you to the channel with that name, but it will create a new virtual channel with root, you and lisa_msn in it.
495
If you want to start a groupchat with the person <span class="emphasis"><em>jim_msn</em></span> in it, just join the channel <span class="emphasis"><em>#jim_msn</em></span>. BitlBee will refuse to join you to the channel with that name, but it will create a new virtual channel with root, you and jim_msn in it.
495
</p><p>
496
</p><p>
496
Of course a channel with only two people isn't really exciting yet. So the next step is to invite some other people to the channel. For this, you can use the <span class="emphasis"><em>/invite</em></span> command of your IRC client. Please do keep in mind that all the people have to be on the same network and contact list! You can't invite Yahoo! buddies into an MSN groupchat.
497
Of course a channel with only two people isn't really exciting yet. So the next step is to invite some other people to the channel. For this, you can use the <span class="emphasis"><em>/invite</em></span> command of your IRC client. Please do keep in mind that all the people have to be on the same network and contact list! You can't invite Yahoo! buddies into an MSN groupchat.
497
</p><p>
498
</p><p>
498
Some protocols (like Jabber) also support named groupchats. BitlBee now supports these too. You can use the <span class="emphasis"><em>join_chat</em></span> command to join them. See <span class="emphasis"><em>help join_chat</em></span> for more information.
499
Some protocols (like Jabber) also support named groupchats. BitlBee now supports these too. You can use the <span class="emphasis"><em>join_chat</em></span> command to join them. See <span class="emphasis"><em>help join_chat</em></span> for more information.
500
</p><p>
501
This is all you'll probably need to know. If you have any problems, please read <span class="emphasis"><em>help groupchats3</em></span>.
502
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="groupchats3"></a>Groupchat channel names</h2></div></div></div><p>
503
Obviously the (numbered) channel names don't make a lot of sense. Problem is that groupchats usually don't have names at all in the IM-world, while IRC insists on a name. So BitlBee just generates something random, just don't pay attention to it. :-)
504
</p><p>
505
Please also note that BitlBee doesn't support groupchats for all protocols yet. BitlBee will tell you so. Support for other protocols will hopefully come later.
499
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="away"></a>Away states</h2></div></div></div><p>
506
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="away"></a>Away states</h2></div></div></div><p>
500
As you might've expected, you can just use the <span class="emphasis"><em>/away</em></span> command in your IRC client to set an away-state. BitlBee supports most away-states supported by the protocols.
507
As you might've expected, you can just use the <span class="emphasis"><em>/away</em></span> command in your IRC client to set an away-state. BitlBee supports most away-states supported by the protocols.
501
</p><p>
508
</p><p>
502
Not all away states are supported by all protocols, and some protocols have different names for them. BitlBee will try to pick the best available alias from this list for every connection:
509
Not all away states are supported by all protocols, and some protocols have different names for them. BitlBee will try to pick the best available alias from this list for every connection:
503
</p><table class="simplelist" border="0" summary="Simple list"><tr><td>Away from computer, Away, Extended away</td></tr><tr><td>NA, N/A, Not available</td></tr><tr><td>Busy, Do not disturb, DND, Occupied</td></tr><tr><td>Be right back, BRB</td></tr><tr><td>On the phone, Phone, On phone</td></tr><tr><td>Out to lunch, Lunch, Food</td></tr><tr><td>Invisible, Hidden</td></tr></table><p>
510
</p><table class="simplelist" border="0" summary="Simple list"><tr><td>Away from computer, Away, Extended away</td></tr><tr><td>NA, N/A, Not available</td></tr><tr><td>Busy, Do not disturb, DND, Occupied</td></tr><tr><td>Be right back, BRB</td></tr><tr><td>On the phone, Phone, On phone</td></tr><tr><td>Out to lunch, Lunch, Food</td></tr></table><p>
504
So <span class="emphasis"><em>/away Food</em></span> will set your state to "Out to lunch" on your MSN connection, and for most other connections the default, "Away" or "Away from computer" will be chosen.
511
So <span class="emphasis"><em>/away Food</em></span> will set your state to "Out to lunch" on your MSN connection, and for most other connections the default, "Away" or "Away from computer" will be chosen.
505
</p><p>
512
</p><p>
506
You can also add more information to your away message. Setting it to "Busy - Fixing BitlBee bugs" will set your IM-away-states to Busy, but your away message will be more descriptive for people on IRC. Most IM-protocols can also show this additional information to your buddies.
513
You can also add more information to your away message. Setting it to "Busy - Fixing BitlBee bugs" will set your IM-away-states to Busy, but your away message will be more descriptive for people on IRC. Protocols like Yahoo! and Jabber will also show this complete away message to your buddies.
507
</p></div></div></div></body></html>
514
</p></div></div></div></body></html>
(-)bitlbee-1.2/doc/user-guide/user-guide.txt (-418 / +1384 lines)
Lines 1-442 Link Here
1
BitlBee User Guide
2
1
Jelmer Vernooij
3
Jelmer Vernooij
2
jelmer@samba.org
4
3
Wilmer van der Gaast
5
Wilmer van der Gaast
4
wilmer@gaast.net
6
5
Sjoerd Hemminga
7
Sjoerd Hemminga
6
sjoerd@huiswerkservice.nl
8
7
This is the BitlBee User Guide. For now, the on-line help is the most
9
This is the BitlBee User Guide. For now, the on-line help is the most
8
up-to-date documentation. Although this document shares some parts with the
10
up-to-date documentation. Although this document shares some parts with the
9
on-line help system, other parts might be very outdated. The latest BitlBee
11
on-line help system, other parts might be very outdated.
10
release is always available from http://www.bitlbee.org/. Download the package
12
11
with your favorite program and unpack it: tar xvfz bitlbee-<version>.tar.gz
13
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
where <version> is to be replaced by the version number of the BitlBee you
14
13
downloaded (e.g. 0.91). BitlBee's build system has to be configured before
15
Table of Contents
14
compiling. The configure script will do this for you. Just run it, it'll set up
16
15
with nice and hopefully well-working defaults. If you want to change some
17
1. Installation
16
settings, just try ./configure --help and see what you can do. Some variables
18
17
that might be of interest to the normal user: prefix, bindir, etcdir, mandir,
19
    Downloading the package
18
datadir - The place where all the BitlBee program files will be put. There's
20
    Compiling
19
usually no reason to specify them all separately, just specifying prefix (or
21
    Configuration
20
keeping the default /usr/local/) should be okay. config - The place where
22
21
BitlBee will save all the per-user settings and buddy information. /var/lib/
23
2. Usage
22
bitlbee/ is the default value. msn, jabber, oscar, yahoo - By default, support
24
23
for all these IM-protocols (OSCAR is the protocol used by both ICQ and AIM)
25
    Connecting to the server
24
will be compiled in. To make the binary a bit smaller, you can use these
26
    The &bitlbee control channel
25
options to leave out support for protocols you're not planning to use. debug -
27
    Talking to people
26
Generate an unoptimized binary with debugging symbols, mainly useful if you
28
27
want to do some debugging or help us to track down a problem. strip - By
29
3. Support
28
default, unnecessary parts of the generated binary will be stripped out to make
30
29
it as small as possible. If you don't want this (because it might cause
31
    BitlBee is beta software
30
problems on some platforms), set this to 0. flood - To secure your BitlBee
32
    Support channels
31
server against flooding attacks, you can use this option. It's not compiled in
33
32
by default because it needs more testing first. ssl - The MSN and Jabber
34
        The World Wide Web
33
modules require an SSL library for some of their tasks. BitlBee can use three
35
        IRC
34
different SSL libraries: GnuTLS, mozilla-nss and OpenSSL. (OpenSSL is, however,
36
        Mailinglists
35
a bit troublesome because of licensing issues, so don't forget to read the
37
36
information configure will give you when you try to use OpenSSL!) By default,
38
4. Quickstart
37
configure will try to detect GnuTLS or mozilla-nss. If none of them can be
39
38
found, it'll give up. If you want BitlBee to use OpenSSL, you have to
40
    Add and Connect To your IM Account(s)
39
explicitly specify that. After running configure, you should run make. After
41
    Managing Contact Lists: Rename
40
that, run make install as root. By default, BitlBee runs as the user nobody.
42
    Step Four: Managing Contact Lists: Add and Remove.
41
You might want to run it as a seperate user (some computers run named or apache
43
    Chatting
42
as nobody). Since BitlBee uses inetd, you should add the following line to /etc
44
    Further Resources
43
/inetd.conf: 6667 stream tcp nowait nobody /usr/local/sbin/bitlbee bitlbee
45
46
5. Bitlbee commands
47
48
    account - IM-account list maintenance
49
50
        account add
51
        account del
52
        account on
53
        account off
54
        account list
55
        account set
56
57
    add - Add a buddy to your contact list
58
    info - Request user information
59
    remove - Remove a buddy from your contact list
60
    block - Block someone
61
    allow - Unblock someone
62
    set - Miscellaneous settings
63
    help - BitlBee help system
64
    save - Save your account data
65
    auto_connect
66
    auto_reconnect
67
    auto_reconnect_delay
68
    away_devoice
69
    buddy_sendbuffer
70
    buddy_sendbuffer_delay
71
    charset
72
    debug
73
    default_target
74
    display_name
75
    display_namechanges
76
    handle_unknown
77
    lcnicks
78
    ops
79
    password
80
    port
81
    priority
82
    private
83
    query_order
84
    resource
85
    resource_select
86
    save_on_quit
87
    server
88
    simulate_netsplit
89
    ssl
90
    strip_html
91
    tls
92
    to_char
93
    typing_notice
94
    web_aware
95
    xmlconsole
96
    rename - Rename (renick) a buddy
97
    yes - Accept a request
98
    no - Deny a request
99
    qlist - List all the unanswered questions root asked
100
    register - Register yourself
101
    identify - Identify yourself with your password
102
    drop - Drop your account
103
    blist - List all the buddies in your contact list
104
    nick - Change friendly name, nick
105
    join_chat - Join a named groupchat/conference room
106
107
6. Misc Stuff
108
109
    Smileys
110
    Groupchats
111
    Creating groupchats
112
    Groupchat channel names
113
    Away states
114
115
Chapter 1. Installation
116
117
Table of Contents
118
119
Downloading the package
120
Compiling
121
Configuration
122
123
Downloading the package
124
125
The latest BitlBee release is always available from http://www.bitlbee.org/.
126
Download the package with your favorite program and unpack it: tar xvfz
127
bitlbee-<version>.tar.gz where <version> is to be replaced by the version
128
number of the BitlBee you downloaded (e.g. 0.91).
129
130
Compiling
131
132
BitlBee's build system has to be configured before compiling. The configure
133
script will do this for you. Just run it, it'll set up with nice and hopefully
134
well-working defaults. If you want to change some settings, just try ./
135
configure --help and see what you can do.
136
137
Some variables that might be of interest to the normal user:
138
139
  ● prefix, bindir, etcdir, mandir, datadir - The place where all the BitlBee
140
    program files will be put. There's usually no reason to specify them all
141
    separately, just specifying prefix (or keeping the default /usr/local/)
142
    should be okay.
143
144
  ● config - The place where BitlBee will save all the per-user settings and
145
    buddy information. /var/lib/bitlbee/ is the default value.
146
147
  ● msn, jabber, oscar, yahoo - By default, support for all these IM-protocols
148
    (OSCAR is the protocol used by both ICQ and AIM) will be compiled in. To
149
    make the binary a bit smaller, you can use these options to leave out
150
    support for protocols you're not planning to use.
151
152
  ● debug - Generate an unoptimized binary with debugging symbols, mainly
153
    useful if you want to do some debugging or help us to track down a problem.
154
155
  ● strip - By default, unnecessary parts of the generated binary will be
156
    stripped out to make it as small as possible. If you don't want this
157
    (because it might cause problems on some platforms), set this to 0.
158
159
  ● flood - To secure your BitlBee server against flooding attacks, you can use
160
    this option. It's not compiled in by default because it needs more testing
161
    first.
162
163
  ● ssl - The MSN and Jabber modules require an SSL library for some of their
164
    tasks. BitlBee can use three different SSL libraries: GnuTLS, mozilla-nss
165
    and OpenSSL. (OpenSSL is, however, a bit troublesome because of licensing
166
    issues, so don't forget to read the information configure will give you
167
    when you try to use OpenSSL!) By default, configure will try to detect
168
    GnuTLS or mozilla-nss. If none of them can be found, it'll give up. If you
169
    want BitlBee to use OpenSSL, you have to explicitly specify that.
170
171
After running configure, you should run make. After that, run make install as
172
root.
173
174
Configuration
175
176
By default, BitlBee runs as the user nobody. You might want to run it as a
177
seperate user (some computers run named or apache as nobody).
178
179
Since BitlBee uses inetd, you should add the following line to /etc/inetd.conf:
180
181
6667    stream  tcp     nowait nobody /usr/local/sbin/bitlbee bitlbee
182
44
Inetd has to be restarted after changing the configuration. Either killall -HUP
183
Inetd has to be restarted after changing the configuration. Either killall -HUP
45
inetd or /etc/init.d/inetd restart should do the job on most systems. You might
184
inetd or /etc/init.d/inetd restart should do the job on most systems.
46
be one of the.. ehr, lucky people running an xinetd-powered distro. xinetd is
185
47
quite different and they seem to be proud of that.. ;-) Anyway, if you want
186
You might be one of the.. ehr, lucky people running an xinetd-powered distro.
48
BitlBee to work with xinetd, just copy the bitlbee.xinetd file to your /etc/
187
xinetd is quite different and they seem to be proud of that.. ;-) Anyway, if
49
xinetd.d/ directory (and probably edit it to suit your needs). You should
188
you want BitlBee to work with xinetd, just copy the bitlbee.xinetd file to your
50
create a directory where BitlBee can store it's data files. This should be the
189
/etc/xinetd.d/ directory (and probably edit it to suit your needs).
51
directory named after the value 'CONFIG' in Makefile.settings. The default is /
190
52
var/lib/bitlbee, which can be created with the command mkdir -p /var/lib/
191
You should create a directory where BitlBee can store it's data files. This
53
bitlbee. This directory has to be owned by the user that runs bitlbee. To make
192
should be the directory named after the value 'CONFIG' in Makefile.settings.
54
'nobody' owner of this directory, run chown nobody /var/lib/bitlbee. Because
193
The default is /var/lib/bitlbee, which can be created with the command mkdir -p
55
things like passwords are saved in this directory, it's probably a good idea to
194
/var/lib/bitlbee. This directory has to be owned by the user that runs bitlbee.
56
make this directory owner-read-/writable only. Since BitlBee acts just like any
195
To make 'nobody' owner of this directory, run chown nobody /var/lib/bitlbee.
57
other irc daemon, you can connect to it with your favorite irc client. Launch
196
Because things like passwords are saved in this directory, it's probably a good
58
it and connect to localhost port 6667 (or whatever host/port you are running
197
idea to make this directory owner-read-/writable only.
59
bitlbee on). Once you are connected to the BitlBee server, you are
198
60
automatically joined to &bitlbee on that server. This channel acts like the
199
Chapter 2. Usage
61
'buddy list' you have on the various other chat networks. The user 'root'
200
62
always hangs around in &bitlbee and acts as your interface to bitlbee. All
201
Table of Contents
63
commands you give on &bitlbee are 'answered' by root. You might be slightly
202
64
confused by the & in the channel name. This is, however, completely allowed by
203
Connecting to the server
65
the IRC standards. Just try it on a regular IRC server, it should work. The
204
The &bitlbee control channel
66
difference between the standard #channels and &channels is that the #channels
205
Talking to people
67
are distributed over all the servers on the IRC network, while &channels are
206
68
local to one server. Because the BitlBee control channel is local to one server
207
Connecting to the server
69
(and in fact, to one person), this name seems more suitable. Also, with this
208
70
name, it's harder to confuse the control channel with the #bitlbee channel on
209
Since BitlBee acts just like any other irc daemon, you can connect to it with
71
OFTC. You can talk to by starting a query with them. In most irc clients, this
210
your favorite irc client. Launch it and connect to localhost port 6667 (or
72
can be done with either /msg <nick> <text> or /query <nick>. To keep the number
211
whatever host/port you are running bitlbee on).
73
of open query windows limited, you can also talk to people in the control
212
74
channel, like <nick>: <text>. BitlBee doesn't come with a warranty and is still
213
The &bitlbee control channel
75
(and will probably always be) under development. That means it can crash at any
214
76
time, corrupt your data or whatever. Don't use it in any production environment
215
Once you are connected to the BitlBee server, you are automatically joined to &
77
and don't rely on it, or at least don't blame us if things blow up. :-) http://
216
bitlbee on that server. This channel acts like the 'buddy list' you have on the
78
www.bitlbee.org/ is the homepage of bitlbee and contains the most recent news
217
various other chat networks.
79
on bitlbee and the latest releases. BitlBee is discussed on #bitlbee on the
218
80
OFTC IRC network (server: irc.oftc.net). BitlBee doesn't have any mailinglists.
219
The user 'root' always hangs around in &bitlbee and acts as your interface to
220
bitlbee. All commands you give on &bitlbee are 'answered' by root.
221
222
You might be slightly confused by the & in the channel name. This is, however,
223
completely allowed by the IRC standards. Just try it on a regular IRC server,
224
it should work. The difference between the standard #channels and &channels is
225
that the #channels are distributed over all the servers on the IRC network,
226
while &channels are local to one server. Because the BitlBee control channel is
227
local to one server (and in fact, to one person), this name seems more
228
suitable. Also, with this name, it's harder to confuse the control channel with
229
the #bitlbee channel on OFTC.
230
231
Talking to people
232
233
You can talk to by starting a query with them. In most irc clients, this can be
234
done with either /msg <nick> <text> or /query <nick>.
235
236
To keep the number of open query windows limited, you can also talk to people
237
in the control channel, like <nick>: <text>.
238
239
Chapter 3. Support
240
241
Table of Contents
242
243
BitlBee is beta software
244
Support channels
245
246
    The World Wide Web
247
    IRC
248
    Mailinglists
249
250
BitlBee is beta software
251
252
Although BitlBee has quite some functionality it is still beta. That means it
253
can crash at any time, corrupt your data or whatever. Don't use it in any
254
production environment and don't rely on it.
255
256
Support channels
257
258
The World Wide Web
259
260
http://www.bitlbee.org/ is the homepage of bitlbee and contains the most recent
261
news on bitlbee and the latest releases.
262
263
IRC
264
265
BitlBee is discussed on #bitlbee on the OFTC IRC network (server:
266
irc.oftc.net).
267
268
Mailinglists
269
270
BitlBee doesn't have any mailinglists.
271
272
Chapter 4. Quickstart
273
274
Table of Contents
275
276
Add and Connect To your IM Account(s)
277
Managing Contact Lists: Rename
278
Step Four: Managing Contact Lists: Add and Remove.
279
Chatting
280
Further Resources
281
81
Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber and Yahoo Instant
282
Welcome to BitlBee, your IRC gateway to ICQ, MSN, AOL, Jabber and Yahoo Instant
82
Messaging Systems. The center of BitlBee is the control channel, &bitlbee. Two
283
Messaging Systems.
83
users will always be there, you (where "you" is the nickname you are using) and
284
84
the system user, root. You need register so that all your IM settings
285
The center of BitlBee is the control channel, &bitlbee. Two users will always
85
(passwords, contacts, etc) can be saved on the BitlBee server. It's important
286
be there, you (where "you" is the nickname you are using) and the system user,
86
that you pick a good password so no one else can access your account. Register
287
root.
87
with this password using the register command: register <password> (without the
288
88
brackets!). Be sure to remember your password. The next time you connect to the
289
You need register so that all your IM settings (passwords, contacts, etc) can
89
BitlBee server you will need to identify <password> so that you will be
290
be saved on the BitlBee server. It's important that you pick a good password so
90
recognised and logged in to all the IM services automatically. When finished,
291
no one else can access your account. Register with this password using the
91
type help quickstart2 to continue. Step Two: Add and Connect To your IM Account
292
register command: register <password> (without the brackets!).
92
(s). To add an account to the account list you will need to use the account add
293
93
command: account add <protocol> <username> <password> [<server>]. For instance,
294
Be sure to remember your password. The next time you connect to the BitlBee
94
suppose you have a Jabber account at jabber.org with handle bitlbee@jabber.org
295
server you will need to identify <password> so that you will be recognised and
95
with password QuickStart, you would: < you> account add jabber
296
logged in to all the IM services automatically.
96
bitlbee@jabber.org QuickStart < root> Account successfully added Other
297
97
available IM protocols are msn, oscar, and yahoo. OSCAR is the protocol used by
298
When finished, type help quickstart2 to continue.
98
ICQ and AOL. For more information about the account add command, see help
299
99
account add. When you are finished adding your account(s) use the account on
300
Add and Connect To your IM Account(s)
100
command to enable all your accounts, type help quickstart3 to continue. Step
301
101
Three: Managing Contact Lists: Rename Now BitlBee logs in and downloads the
302
Step Two: Add and Connect To your IM Account(s).
102
contact list from the IM server. In a few seconds, all your on-line buddies
303
103
should show up in the control channel. BitlBee will convert names into
304
To add an account to the account list you will need to use the account add
104
IRC-friendly form (for instance: tux@example.com will be given the nickname
305
command: account add <protocol> <username> <password> [<server>].
105
tux). If you have more than one person who would have the same name by this
306
106
logic (for instance: tux@example.com and tux@bitlbee.org) the second one to log
307
For instance, suppose you have an ICQ account with UIN 72696705 with password
107
on will be tux_. The same is true if you have a tux log on to AOL and a tux log
308
QuickStart, you would:
108
on from Yahoo. It would be easy to get these two mixed up, so BitlBee has a
309
109
rename command to change the nickname into something more suitable: rename
310
< you> account add oscar 72696705 QuickStart login.icq.com
110
<oldnick> <newnick> < you> rename tux_ bitlbeetux * tux_ is now known as
311
< root> Account successfully added
111
bitlbeetux < root> Nick successfully changed When finished, type help
312
112
quickstart4 to continue. Step Four: Managing Contact Lists: Add and Remove. Now
313
Other available IM protocols are jabber, msn, and yahoo. Oscar is the protocol
113
you might want to add some contacts, to do this we will use the add command. It
314
used by ICQ and AOL. For oscar, you need to specify the IM-server as a fourth
114
needs two arguments: a connection ID (which can be a number (try account list),
315
argument (for msn and yahoo there is no fourth argument). For AOL Instant
115
protocol name or (part of) the screenname) and the user's handle. It is used in
316
Messenger, the server name is login.oscar.aol.com. For ICQ, the server name is
116
the following way: add <connection> <handle> < you> add 0 r2d2@example.com *
317
login.icq.com.
117
r2d2 has joined &bitlbee In this case r2d2 is online, since he/she joins the
318
118
channel immediately. If the user is not online you will not see them join until
319
When you are finished adding your account(s) use the account on command to
119
they log on. Lets say you accidentally added r2d3@example.com rather than
320
enable all your accounts, type help quickstart3 to continue.
120
r2d2@example.com, or maybe you just want to remove a user from your list
321
121
because you never talk to them. To remove a name you will want to use the
322
Managing Contact Lists: Rename
122
remove command: remove <nick> When finished, type help quickstart5 to continue.
323
123
Step Five: Chatting. First of all, a person must be on your contact list for
324
Step Three: Managing Contact Lists: Rename
124
you to chat with them (unless it's a group chat, help groupchats for more). If
325
125
someone not on your contact list sends you a message, simply add them to the
326
For most protocols (currently MSN, Jabber, Yahoo and AOL) BitlBee can download
126
proper account with the add command. Once they are on your list and online, you
327
the contact list automatically from the IM server and all the on-line users
127
can chat with them in &bitlbee: < you> tux: hey, how's the weather down there?
328
should appear in the control channel when you log in.
128
< tux> you: a bit chilly! Note that, although all contacts are in the &bitlbee
329
129
channel, only tux will actually receive this message. The &bitlbee channel
330
BitlBee will convert names into irc-friendly form (for instance:
130
shouldn't be confused with a real IRC channel. If you prefer chatting in a
331
tux@example.com will be given the nickname tux). If you have more than one
131
separate window, use the /msg or /query command, just like on real IRC. BitlBee
332
person who would have the same name by this logic (for instance:
132
will remember how you talk to someone and show his/her responses the same way.
333
tux@example.com and tux@bitlbee.org) the second one to log on will be tux_. The
133
If you want to change the default behaviour (for people you haven't talked to
334
same is true if you have a tux log on to AOL and a tux log on from Yahoo.
134
yet), see help set private. You know the basics. If you want to get to know
335
135
more about BitlBee, please type help quickstart6. So you want more than just
336
It would be easy to get these two mixed up, so BitlBee has a rename command to
136
chatting? Or maybe you're just looking for a feature? You can type help set to
337
change the nickname into something more suitable: rename <oldnick> <newnick>
137
learn more about the possible BitlBee user settings. Among these user settings
338
138
you will find options for common issues, such as changing the charset, HTML
339
< you> rename tux_ bitlbeetux
139
stripping and automatic connecting (simply type set to see current user
340
 * tux_ is now known as bitlbeetux
140
settings). For more subjects (like groupchats and away states), please type
341
< root> Nick successfully changed
141
help index. If you're still looking for something, please visit us in #bitlbee
342
142
on the OFTC network (you can connect via irc.bitlbee.org), or mail us your
343
When finished, type help quickstart4 to continue.
143
problem/suggestion. Good luck and enjoy the Bee! account <action> [<arguments>]
344
345
Step Four: Managing Contact Lists: Add and Remove.
346
347
Step Four: Managing Contact Lists: Add and Remove.
348
349
Now you might want to add some contacts, to do this we will use the add
350
command. It needs two arguments: a connection ID (which can be a number (try
351
account list), protocol name or (part of) the screenname) and the user's
352
handle. It is used in the following way: add <connection> <handle>
353
354
< you> add 0 r2d2@example.com
355
 * r2d2 has joined &bitlbee
356
357
In this case r2d2 is online, since he/she joins the channel immediately. If the
358
user is not online you will not see them join until they log on.
359
360
Lets say you accidentally added r2d3@example.com rather than r2d2@example.com,
361
or maybe you just want to remove a user from your list because you never talk
362
to them. To remove a name you will want to use the remove command: remove
363
<nick>
364
365
When finished, type help quickstart5 to continue.
366
367
Chatting
368
369
Step Five: Chatting.
370
371
First of all, a person must be on your contact list for you to chat with them
372
(unless it's a group chat, help groupchats for more). If someone not on your
373
contact list sends you a message, simply add them to the proper account with
374
the add command. Once they are on your list and online, you can chat with them
375
in &bitlbee:
376
377
< you> tux: hey, how's the weather down there?
378
< tux> you: a bit chilly!
379
380
If you'd rather chat with them in a separate window use the /msg or /query
381
command, just like you would for a private message in IRC. If you want to have
382
messages automatically come up in private messages rather than in the &bitlbee
383
channel, use the set private command: set private true (set private false to
384
change back).
385
386
You know the basics. If you want to get to know more about BitlBee, please type
387
help quickstart6.
388
389
Further Resources
390
391
So you want more than just chatting? Or maybe you're just looking for a
392
feature?
393
394
You can type help set to learn more about the possible BitlBee user settings.
395
Among these user settings you will find options for common issues, such as
396
changing the charset, HTML stripping and automatic connecting (simply type set
397
to see current user settings).
398
399
For more subjects (like groupchats and away states), please type help index.
400
401
If you're still looking for something, please visit us in #bitlbee on the OFTC
402
network (you can connect via irc.bitlbee.org), or mail us your problem/
403
suggestion. Good luck and enjoy the Bee!
404
405
Chapter 5. Bitlbee commands
406
407
Table of Contents
408
409
account - IM-account list maintenance
410
411
    account add
412
    account del
413
    account on
414
    account off
415
    account list
416
    account set
417
418
add - Add a buddy to your contact list
419
info - Request user information
420
remove - Remove a buddy from your contact list
421
block - Block someone
422
allow - Unblock someone
423
set - Miscellaneous settings
424
help - BitlBee help system
425
save - Save your account data
426
auto_connect
427
auto_reconnect
428
auto_reconnect_delay
429
away_devoice
430
buddy_sendbuffer
431
buddy_sendbuffer_delay
432
charset
433
debug
434
default_target
435
display_name
436
display_namechanges
437
handle_unknown
438
lcnicks
439
ops
440
password
441
port
442
priority
443
private
444
query_order
445
resource
446
resource_select
447
save_on_quit
448
server
449
simulate_netsplit
450
ssl
451
strip_html
452
tls
453
to_char
454
typing_notice
455
web_aware
456
xmlconsole
457
rename - Rename (renick) a buddy
458
yes - Accept a request
459
no - Deny a request
460
qlist - List all the unanswered questions root asked
461
register - Register yourself
462
identify - Identify yourself with your password
463
drop - Drop your account
464
blist - List all the buddies in your contact list
465
nick - Change friendly name, nick
466
join_chat - Join a named groupchat/conference room
467
468
account - IM-account list maintenance
469
470
Syntax: 
471
472
account <action> [<arguments>]
473
144
Available actions: add, del, list, on, off and set. See help account <action>
474
Available actions: add, del, list, on, off and set. See help account <action>
145
for more information. account add <protocol> <username> <password> Adds an
475
for more information.
146
account on the given server with the specified protocol, username and password
476
147
to the account list. Supported protocols right now are: Jabber, MSN, OSCAR (AIM
477
account add
148
/ICQ) and Yahoo. For more information about adding an account, see help account
478
149
add <protocol>. account add jabber <handle@server.tld> <password> The handle
479
Syntax: 
150
should be a full handle, including the domain name. You can specify a
480
151
servername if necessary. Normally BitlBee doesn't need this though, since it's
481
account add <protocol> <username> <password> [<server>]
152
able to find out the server by doing DNS SRV lookups. In previous versions it
482
153
was also possible to specify port numbers and/or SSL in the server tag. This is
483
Adds an account on the given server with the specified protocol, username and
154
deprecated and should now be done using the account set command. This also
484
password to the account list. Supported protocols right now are: Jabber, MSN,
155
applies to specifying a resource in the handle (like wilmer@bitlbee.org/work). 
485
OSCAR (AIM/ICQ) and Yahoo. For more information about adding an account, see
156
account add msn <handle@server.tld> <password> For MSN connections there are no
486
help account add <protocol>.
157
special arguments. account add oscar <handle> <password> OSCAR is the protocol
487
158
used to connect to AIM and/or ICQ. The servers will automatically detect if
488
account add jabber
159
you're using a numeric or non-numeric username so there's no need to tell which
489
160
network you want to connect to. < wilmer> account add oscar 72696705
490
Syntax: 
161
hobbelmeeuw < root> Account successfully added account add yahoo <handle>
491
162
<password> For Yahoo! connections there are no special arguments. account del
492
account add jabber <handle@server.tld> <password> [<servertag>]
163
<account id> This commands deletes an account from your account list. You
493
164
should signoff the account before deleting it. The account ID can be a number
494
The handle should be a full handle, including the domain name. You can specify
165
(see account list), the protocol name or (part of) the screenname, as long as
495
a servername if necessary. Normally BitlBee doesn't need this though, since
166
it matches only one connection. account on [<account id>] This command will try
496
it's able to find out the server by doing DNS SRV lookups.
167
to log into the specified account. If no account is specified, BitlBee will log
497
168
into all the accounts that have the auto_connect flag set. The account ID can
498
In previous versions it was also possible to specify port numbers and/or SSL in
169
be a number (see account list), the protocol name or (part of) the screenname,
499
the server tag. This is deprecated and should now be done using the account set
170
as long as it matches only one connection. account off [<account id>] This
500
command. This also applies to specifying a resource in the handle (like
171
command disconnects the connection for the specified account. If no account is
501
wilmer@bitlbee.org/work).
172
specified, BitlBee will deactivate all active accounts and cancel all pending
502
173
reconnects. The account ID can be a number (see account list), the protocol
503
account add msn
174
name or (part of) the screenname, as long as it matches only one connection. 
504
175
account list This command gives you a list of all the accounts known by
505
Syntax: 
176
BitlBee, including the numbers you'll need for most account commands. account
506
177
set <account id> account set <account id>/<setting> account set <account id>/
507
account add msn <handle@server.tld> <password>
178
<setting> <value> account set -del <account id>/<setting> This account can be
508
179
used to change various settings for IM accounts. For all protocols, this
509
For MSN connections there are no special arguments.
180
command can be used to change the handle or the password BitlBee uses to log in
510
181
and if it should be logged in automatically. Some protocols have additional
511
account add oscar
182
settings. You can see the settings available for a connection by typing account
512
183
set <account id>. For more infomation about a setting, see help set <setting>.
513
Syntax: 
184
For details about the syntax of this command, see help set. The account ID can
514
185
be a number (see account list), the protocol name or (part of) the screenname,
515
account add oscar <handle> <password> [<servername>]
186
as long as it matches only one connection. add <connection> <handle> [<nick>]
516
187
add -tmp <connection> <handle> [<nick>] Adds the given buddy at the specified
517
Specifying a server is required for OSCAR, since OSCAR can be used for both
188
connection to your buddy list. The account ID can be a number (see account
518
ICQ- and AIM-connections. Although these days it's supposed to be possible to
189
list), the protocol name or (part of) the screenname, as long as it matches
519
connect to ICQ via AIM-servers and vice versa, we like to stick with this
190
only one connection. If you want, you can also tell BitlBee what nick to give
520
separation for now. For ICQ connections, the servername is login.icq.com, for
191
the new contact. The -tmp option adds the buddy to the internal BitlBee
521
AIM connections it's login.oscar.aol.com.
192
structures only, not to the real contact list (like done by set handle_unknown
522
193
add). This allows you to talk to people who are not in your contact list. This
523
< wilmer> account add oscar 72696705 hobbelmeeuw login.icq.com
194
normally won't show you any presence notifications. < ctrlsoft> add 3
524
< root> Account successfully added
195
gryp@jabber.org grijp * grijp has joined &bitlbee info <connection> <handle>
525
196
info <nick> Requests IM-network-specific information about the specified user.
526
account add yahoo
197
The amount of information you'll get differs per protocol. For some protocols
527
198
(ATM Yahoo! and MSN) it'll give you an URL which you can visit with a normal
528
Syntax: 
199
web browser to get the information. < ctrlsoft> info 0 72696705 < root> User
529
200
info - UIN: 72696705 Nick: Lintux First/Last name: Wilmer van der Gaast E-mail:
530
account add yahoo <handle> <password>
201
lintux@lintux.cx remove <nick> Removes the specified nick from your buddy list.
531
202
< ctrlsoft> remove gryp * gryp has quit [Leaving...] block <nick> block
532
For Yahoo! connections there are no special arguments.
203
<connection> <handle> block <connection> Puts the specified user on your ignore
533
204
list. Either specify the user's nick when you have him/her in your contact list
534
account del
205
or a connection number and a user handle. When called with only a connection
535
206
specification as an argument, the command displays the current block list for
536
Syntax: 
207
that connection. allow <nick> allow <connection> <handle> Reverse of block.
537
208
Unignores the specified user or user handle on specified connection. When
538
account del <account id>
209
called with only a connection specification as an argument, the command
539
210
displays the current allow list for that connection. set set <variable> set
540
This commands deletes an account from your account list. You should signoff the
211
<variable> <value> set -del <variable> Without any arguments, this command
541
account before deleting it.
212
lists all the set variables. You can also specify a single argument, a variable
542
213
name, to get that variable's value. To change this value, specify the new value
543
The account ID can be a number (see account list), the protocol name or (part
214
as the second argument. With -del you can reset a setting to its default value.
544
of) the screenname, as long as it matches only one connection.
215
To get more help information about a setting, try: < ctrlsoft> help set private
545
216
help [subject] This command gives you the help information you're reading right
546
account on
217
now. If you don't give any arguments, it'll give a short help index. save This
547
218
command saves all your nicks and accounts immediately. Handy if you have the
548
Syntax: 
219
autosave functionality disabled, or if you don't trust the program's
549
220
stability... ;-) Type: boolean With this option enabled, when you identify
550
account on [<account id>]
221
BitlBee will automatically connect to your accounts, with this disabled it will
551
222
not do this. This setting can also be changed for specific accounts using the
552
This command will try to log into the specified account. If no account is
223
account set command. (However, these values will be ignored if the global
553
specified, BitlBee will log into all the accounts that have the auto_connect
224
auto_connect setting is disabled!) Type: boolean If an IM-connections breaks,
554
flag set.
225
you're supposed to bring it back up yourself. Having BitlBee do this
555
226
automatically might not always be a good idea, for several reasons. If you want
556
The account ID can be a number (see account list), the protocol name or (part
227
the connections to be restored automatically, you can enable this setting. See
557
of) the screenname, as long as it matches only one connection.
228
also the auto_reconnect_delay setting. This setting can also be changed for
558
229
specific accounts using the account set command. (However, these values will be
559
account off
230
ignored if the global auto_reconnect setting is disabled!) Type: integer Tell
560
231
BitlBee after how many seconds it should attempt to bring an IM-connection back
561
Syntax: 
232
up after a crash. It's not a good idea to set this value very low, it will
562
233
cause too much useless traffic when an IM-server is down for a few hours. See
563
account off [<account id>]
234
also the auto_reconnect setting. Type: boolean With this option enabled, the
564
235
root user devoices people when they go away (just away, not offline) and gives
565
This command disconnects the connection for the specified account. If no
236
the voice back when they come back. You might dislike the voice-floods you'll
566
account is specified, BitlBee will deactivate all active accounts and cancel
237
get if your contact list is huge, so this option can be disabled. Type: boolean
567
all pending reconnects.
568
569
The account ID can be a number (see account list), the protocol name or (part
570
of) the screenname, as long as it matches only one connection.
571
572
account list
573
574
Syntax: 
575
576
account list
577
578
This command gives you a list of all the accounts known by BitlBee, including
579
the numbers you'll need for most account commands.
580
581
account set
582
583
Syntax: 
584
585
account set <account id>
586
account set <account id>/<setting>
587
account set <account id>/<setting> <value>
588
account set -del <account id>/<setting>
589
590
This account can be used to change various settings for IM accounts. For all
591
protocols, this command can be used to change the handle or the password
592
BitlBee uses to log in and if it should be logged in automatically. Some
593
protocols have additional settings. You can see the settings available for a
594
connection by typing account set <account id>.
595
596
For more infomation about a setting, see help set <setting>. For details about
597
the syntax of this command, see help set.
598
599
The account ID can be a number (see account list), the protocol name or (part
600
of) the screenname, as long as it matches only one connection.
601
602
add - Add a buddy to your contact list
603
604
Syntax: 
605
606
add <connection> <handle> [<nick>]
607
add -tmp <connection> <handle> [<nick>]
608
609
Adds the given buddy at the specified connection to your buddy list. The
610
account ID can be a number (see account list), the protocol name or (part of)
611
the screenname, as long as it matches only one connection.
612
613
If you want, you can also tell BitlBee what nick to give the new contact. Of
614
course you can also use the rename command for that, but sometimes this might
615
be more convenient.
616
617
Adding -tmp adds the buddy to the internal BitlBee structures only, not to the
618
real contact list (like done by set handle_unknown add). This allows you to
619
talk to people who are not in your contact list.
620
621
< ctrlsoft> add 3 gryp@jabber.org grijp
622
 * grijp has joined &bitlbee
623
624
info - Request user information
625
626
Syntax: 
627
628
info <connection> <handle>
629
info <nick>
630
631
Requests IM-network-specific information about the specified user. The amount
632
of information you'll get differs per protocol. For some protocols (ATM Yahoo!
633
and MSN) it'll give you an URL which you can visit with a normal web browser to
634
get the information.
635
636
< ctrlsoft> info 0 72696705
637
< root> User info - UIN: 72696705 Nick: Lintux First/Last name: Wilmer van der Gaast E-mail: lintux@lintux.cx
638
639
remove - Remove a buddy from your contact list
640
641
Syntax: 
642
643
remove <nick>
644
645
Removes the specified nick from your buddy list.
646
647
< ctrlsoft> remove gryp
648
 * gryp has quit [Leaving...]
649
650
block - Block someone
651
652
Syntax: 
653
654
block <nick>
655
block <connection> <handle>
656
block <connection>
657
658
Puts the specified user on your ignore list. Either specify the user's nick
659
when you have him/her in your contact list or a connection number and a user
660
handle.
661
662
When called with only a connection specification as an argument, the command
663
displays the current block list for that connection.
664
665
allow - Unblock someone
666
667
Syntax: 
668
669
allow <nick>
670
allow <connection> <handle>
671
672
Reverse of block. Unignores the specified user or user handle on specified
673
connection.
674
675
When called with only a connection specification as an argument, the command
676
displays the current allow list for that connection.
677
678
set - Miscellaneous settings
679
680
Syntax: 
681
682
set
683
set <variable>
684
set <variable> <value>
685
set -del <variable>
686
687
Without any arguments, this command lists all the set variables. You can also
688
specify a single argument, a variable name, to get that variable's value. To
689
change this value, specify the new value as the second argument. With -del you
690
can reset a setting to its default value.
691
692
To get more help information about a setting, try:
693
694
< ctrlsoft> help set private
695
696
help - BitlBee help system
697
698
Syntax: 
699
700
help [subject]
701
702
This command gives you the help information you're reading right now. If you
703
don't give any arguments, it'll give a short help index.
704
705
save - Save your account data
706
707
Syntax: 
708
709
save
710
711
This command saves all your nicks and accounts immediately. Handy if you have
712
the autosave functionality disabled, or if you don't trust the program's
713
stability... ;-)
714
715
auto_connect
716
717
Type: boolean
718
719
With this option enabled, when you identify BitlBee will automatically connect
720
to your accounts, with this disabled it will not do this.
721
722
This setting can also be changed for specific accounts using the account set
723
command. (However, these values will be ignored if the global auto_connect
724
setting is disabled!)
725
726
auto_reconnect
727
728
Type: boolean
729
730
If an IM-connections breaks, you're supposed to bring it back up yourself.
731
Having BitlBee do this automatically might not always be a good idea, for
732
several reasons. If you want the connections to be restored automatically, you
733
can enable this setting.
734
735
See also the auto_reconnect_delay setting.
736
737
This setting can also be changed for specific accounts using the account set
738
command. (However, these values will be ignored if the global auto_reconnect
739
setting is disabled!)
740
741
auto_reconnect_delay
742
743
Type: integer
744
745
Tell BitlBee after how many seconds it should attempt to bring an IM-connection
746
back up after a crash. It's not a good idea to set this value very low, it will
747
cause too much useless traffic when an IM-server is down for a few hours.
748
749
See also the auto_reconnect setting.
750
751
away_devoice
752
753
Type: boolean
754
755
With this option enabled, the root user devoices people when they go away (just
756
away, not offline) and gives the voice back when they come back. You might
757
dislike the voice-floods you'll get if your contact list is huge, so this
758
option can be disabled.
759
760
buddy_sendbuffer
761
762
Type: boolean
763
238
By default, when you send a message to someone, BitlBee forwards this message
764
By default, when you send a message to someone, BitlBee forwards this message
239
to the user immediately. When you paste a large number of lines, the lines will
765
to the user immediately. When you paste a large number of lines, the lines will
240
be sent in separate messages, which might not be very nice to read. If you
766
be sent in separate messages, which might not be very nice to read. If you
241
enable this setting, BitlBee will buffer your messages and wait for more data.
767
enable this setting, BitlBee will buffer your messages and wait for more data.
768
242
Using the buddy_sendbuffer_delay setting you can specify the number of seconds
769
Using the buddy_sendbuffer_delay setting you can specify the number of seconds
243
BitlBee should wait for more data before the complete message is sent. Please
770
BitlBee should wait for more data before the complete message is sent.
244
note that if you remove a buddy from your list (or if the connection to that
771
245
user drops) and there's still data in the buffer, this data will be lost.
772
Please note that if you remove a buddy from your list (or if the connection to
246
BitlBee will not try to send the message to the user in those cases. Type:
773
that user drops) and there's still data in the buffer, this data will be lost.
247
integer Tell BitlBee after how many (mili)seconds a buffered message should be
774
BitlBee will not try to send the message to the user in those cases.
248
sent. Values greater than 5 will be interpreted as miliseconds, 5 and lower as
775
249
seconds. See also the buddy_sendbuffer setting. Type: string This setting tells
776
buddy_sendbuffer_delay
250
BitlBee what your IRC client sends and expects. It should be equal to the
777
251
charset setting of your IRC client if you want to be able to send and receive
778
Type: integer
252
non-ASCII text properly. Most systems use UTF-8 these days. On older systems,
779
253
an iso8859 charset may work better. For example, iso8859-1 is the best choice
780
Tell BitlBee after how many (mili)seconds a buffered message should be sent.
254
for most Western countries. You can try to find what works best for you on
781
Values greater than 5 will be interpreted as miliseconds, 5 and lower as
255
http://www.unicodecharacter.com/charsets/iso8859.html Type: boolean Some
782
seconds.
256
debugging messages can be sent to the control channel if you wish. They're
783
784
See also the buddy_sendbuffer setting.
785
786
charset
787
788
Type: string
789
790
The charset setting enables you to use different character sets in BitlBee.
791
These get converted to UTF-8 before sending and from UTF-8 when receiving.
792
793
If you don't know what's the best value for this, at least iso8859-1 is the
794
best choice for most Western countries. You can try to find what works best for
795
you on http://czyborra.com/charsets/iso8859.html
796
797
debug
798
799
Type: boolean
800
801
Some debugging messages can be sent to the control channel if you wish. They're
257
probably not really useful for you, unless you're doing some development on
802
probably not really useful for you, unless you're doing some development on
258
BitlBee. Type: string With this value set to root, lines written in the control
803
BitlBee.
259
channel without any nickname in front of them will be interpreted as commands.
804
260
If you want BitlBee to send those lines to the last person you addressed in the
805
default_target
261
control channel, set this to last. Type: string Currently only available for
806
262
MSN connections. This setting allows you to read and change your "friendly
807
Type: string
263
name" for this connection. Since this is a server-side setting, it can't be
808
264
changed when the account is off-line. Type: boolean With this option enabled,
809
With this value set to root, lines written in the control channel without any
265
root will inform you when someone in your buddy list changes his/her "friendly
810
nickname in front of them will be interpreted as commands. If you want BitlBee
266
name". Type: string Messages from unknown users are echoed like this by
811
to send those lines to the last person you addressed in the control channel,
267
default: If you want this lame user to be added automatically, you can set this
812
set this to last.
268
setting to "add". If you prefer to ignore messages from people you don't know,
813
269
you can set this one to "ignore". "add_private" and "add_channel" are like add,
814
display_name
270
but you can use them to make messages from unknown buddies appear in the
815
271
channel instead of a query window. Type: boolean Hereby you can change whether
816
Type: string
272
you want all lower case nick names or leave the case as it intended by your
817
273
peer. Type: boolean Some protocols (MSN, Yahoo!) can notify via IM about new
818
Currently only available for MSN connections. This setting allows you to read
274
e-mail. Since most people use their Hotmail/Yahoo! addresses as a spam-box,
819
and change your "friendly name" for this connection. Since this is a
275
this is disabled default. If you want these notifications, you can enable this
820
server-side setting, it can't be changed when the account is off-line.
276
setting. Type: string Some people prefer themself and root to have operator
821
277
status in &bitlbee, other people don't. You can change these states using this
822
display_namechanges
278
setting. The value "both" means both user and root get ops. "root" means, well,
823
279
just root. "user" means just the user. "none" means nobody will get operator
824
Type: boolean
280
status. Type: string Use this global setting to change your "NickServ"
825
281
password. This setting is also available for all IM accounts to change the
826
With this option enabled, root will inform you when someone in your buddy list
282
password BitlBee uses to connect to the service. Note that BitlBee will always
827
changes his/her "friendly name".
283
say this setting is empty. This doesn't mean there is no password, it just
828
284
means that, for security reasons, BitlBee stores passwords somewhere else so
829
handle_unknown
285
they can't just be retrieved in plain text. Type: integer Currently only
830
286
available for Jabber connections. Specifies the port number to connect to.
831
Type: string
287
Usually this should be set to 5222, or 5223 for SSL-connections. Type: integer
832
833
Messages from unknown users are echoed like this by default:
834
835
If you want this lame user to be added automatically, you can set this setting
836
to "add". If you prefer to ignore messages from people you don't know, you can
837
set this one to "ignore". "add_private" and "add_channel" are like add, but you
838
can use them to make messages from unknown buddies appear in the channel
839
instead of a query window.
840
841
lcnicks
842
843
Type: boolean
844
845
Hereby you can change whether you want all lower case nick names or leave the
846
case as it intended by your peer.
847
848
ops
849
850
Type: string
851
852
Some people prefer themself and root to have operator status in &bitlbee, other
853
people don't. You can change these states using this setting.
854
855
The value "both" means both user and root get ops. "root" means, well, just
856
root. "user" means just the user. "none" means nobody will get operator status.
857
858
password
859
860
Type: string
861
862
Use this global setting to change your "NickServ" password.
863
864
This setting is also available for all IM accounts to change the password
865
BitlBee uses to connect to the service.
866
867
Note that BitlBee will always say this setting is empty. This doesn't mean
868
there is no password, it just means that, for security reasons, BitlBee stores
869
passwords somewhere else so they can't just be retrieved in plain text.
870
871
port
872
873
Type: integer
874
875
Currently only available for Jabber connections. Specifies the port number to
876
connect to. Usually this should be set to 5222, or 5223 for SSL-connections.
877
878
priority
879
880
Type: integer
881
288
Can be set for Jabber connections. When connecting to one account from multiple
882
Can be set for Jabber connections. When connecting to one account from multiple
289
places, this priority value will help the server to determine where to deliver
883
places, this priority value will help the server to determine where to deliver
290
incoming messages (that aren't addressed to a specific resource already).
884
incoming messages (that aren't addressed to a specific resource already).
885
291
According to RFC 3921 servers will always deliver messages to the server with
886
According to RFC 3921 servers will always deliver messages to the server with
292
the highest priority value. Mmessages will not be delivered to resources with a
887
the highest priority value. Mmessages will not be delivered to resources with a
293
negative priority setting (and should be saved as an off-line message if all
888
negative priority setting (and should be saved as an off-line message if all
294
available resources have a negative priority value). Type: boolean If value is
889
available resources have a negative priority value).
295
true, messages from users will appear in separate query windows. If false,
890
296
messages from users will appear in the control channel. This setting is
891
private
297
remembered (during one session) per-user, this setting only changes the default
892
298
state. This option takes effect as soon as you reconnect. Type: string This
893
Type: boolean
299
changes the order in which the questions from root (usually authorization
894
895
If value is true, messages from users will appear in separate query windows. If
896
false, messages from users will appear in the control channel.
897
898
This setting is remembered (during one session) per-user, this setting only
899
changes the default state. This option takes effect as soon as you reconnect.
900
901
query_order
902
903
Type: string
904
905
This changes the order in which the questions from root (usually authorization
300
requests from buddies) should be answered. When set to lifo, BitlBee
906
requests from buddies) should be answered. When set to lifo, BitlBee
301
immediately displays all new questions and they should be answered in reverse
907
immediately displays all new questions and they should be answered in reverse
302
order. When this is set to fifo, BitlBee displays the first question which
908
order. When this is set to fifo, BitlBee displays the first question which
303
comes in and caches all the others until you answer the first one. Although the
909
comes in and caches all the others until you answer the first one.
304
fifo setting might sound more logical (and used to be the default behaviour in
910
305
older BitlBee versions), it turned out not to be very convenient for many users
911
Although the fifo setting might sound more logical (and used to be the default
306
when they missed the first question (and never received the next ones). Type:
912
behaviour in older BitlBee versions), it turned out not to be very convenient
307
string Can be set for Jabber connections. You can use this to connect to your
913
for many users when they missed the first question (and never received the next
308
Jabber account from multiple clients at once, with every client using a
914
ones).
309
different resource string. Type: string Because the IRC interface makes it
915
310
pretty hard to specify the resource to talk to (when a buddy is online through
916
resource
311
different resources), this setting was added. Normally it's set to priority
917
312
which means messages will always be delivered to the buddy's resource with the
918
Type: string
313
highest priority. If the setting is set to time, messages will be delivered to
919
314
the resource that was last used to send you a message (or the resource that
920
Can be set for Jabber connections. You can use this to connect to your Jabber
315
most recently connected). Type: boolean If enabled causes BitlBee to save all
921
account from multiple clients at once, with every client using a different
316
current settings and account details when user disconnects. This is enabled by
922
resource string.
317
default, and these days there's not really a reason to have it disabled
923
318
anymore. Type: string Can be set for Jabber- and OSCAR-connections. For Jabber,
924
resource_select
319
you might have to set this if the servername isn't equal to the part after the
925
320
@ in the Jabber handle. For OSCAR this shouldn't be necessary anymore in recent
926
Type: string
321
BitlBee versions. Type: boolean Some IRC clients parse quit messages sent by
927
322
the IRC server to see if someone really left or just disappeared because of a
928
Because the IRC interface makes it pretty hard to specify the resource to talk
323
netsplit. By default, BitlBee tries to simulate netsplit-like quit messages to
929
to (when a buddy is online through different resources), this setting was
324
keep the control channel window clean. If you don't like this (or if your IRC
930
added.
325
client doesn't support this) you can disable this setting. Type: boolean
931
932
Normally it's set to priority which means messages will always be delivered to
933
the buddy's resource with the highest priority. If the setting is set to time,
934
messages will be delivered to the resource that was last used to send you a
935
message (or the resource that most recently connected).
936
937
save_on_quit
938
939
Type: boolean
940
941
If enabled causes BitlBee to save all current settings and account details when
942
user disconnects. This is enabled by default, and these days there's not really
943
a reason to have it disabled anymore.
944
945
server
946
947
Type: string
948
949
Can be set for Jabber- and OSCAR-connections. For OSCAR, this must be set to
950
login.icq.com if it's an ICQ connection, or login.oscar.aol.com if it's an AIM
951
connection. For Jabber, you have to set this if the servername isn't equal to
952
the part after the @ in the Jabber handle.
953
954
simulate_netsplit
955
956
Type: boolean
957
958
Some IRC clients parse quit messages sent by the IRC server to see if someone
959
really left or just disappeared because of a netsplit. By default, BitlBee
960
tries to simulate netsplit-like quit messages to keep the control channel
961
window clean. If you don't like this (or if your IRC client doesn't support
962
this) you can disable this setting.
963
964
ssl
965
966
Type: boolean
967
326
Currently only available for Jabber connections. Set this to true if the server
968
Currently only available for Jabber connections. Set this to true if the server
327
accepts SSL connections. Type: boolean Determines what BitlBee should do with
969
accepts SSL connections.
328
HTML in messages. Normally this is turned on and HTML will be stripped from
970
329
messages, if BitlBee thinks there is HTML. If BitlBee fails to detect this
971
strip_html
330
sometimes (most likely in AIM messages over an ICQ connection), you can set
972
331
this setting to always, but this might sometimes accidentally strip non-HTML
973
Type: boolean
332
things too. Type: boolean Newer Jabber servers allow clients to convert a
974
333
plain-text session to a TLS/SSL-encrypted session. Normally (with this setting
975
Determines what BitlBee should do with HTML in messages. Normally this is
334
set to try) BitlBee will do this, if possible. If you want to force BitlBee to
976
turned on and HTML will be stripped from messages, if BitlBee thinks there is
335
use TLS sessions only (and to give up if that doesn't seem to be possible) you
977
HTML.
336
can set this setting to true. Set it to false if you want the session to remain
978
337
plain-text. Type: string It's customary that messages meant for one specific
979
If BitlBee fails to detect this sometimes (most likely in AIM messages over an
338
person on an IRC channel are prepended by his/her alias followed by a colon
980
ICQ connection), you can set this setting to always, but this might sometimes
339
':'. BitlBee does this by default. If you prefer a different character, you can
981
accidentally strip non-HTML things too.
340
set it using set to_char. Please note that this setting is only used for
982
341
incoming messages. For outgoing messages you can use ':' (colon) or ',' to
983
tls
342
separate the destination nick from the message, and this is not configurable. 
984
343
Type: boolean Sends you a /notice when a user starts typing a message (if
985
Type: boolean
344
supported by the IM protocol and the user's client). To use this, you most
986
345
likely want to use a script in your IRC client to show this information in a
987
Newer Jabber servers allow clients to convert a plain-text session to a TLS/
346
more sensible way. Type: string ICQ allows people to see if you're on-line via
988
SSL-encrypted session. Normally (with this setting set to try) BitlBee will do
347
a CGI-script. (http://status.icq.com/online.gif?icq=UIN) This can be nice to
989
this, if possible.
348
put on your website, but it seems that spammers also use it to see if you're
990
349
online without having to add you to their contact list. So to prevent ICQ
991
If you want to force BitlBee to use TLS sessions only (and to give up if that
350
spamming, recent versions of BitlBee disable this feature by default. Unless
992
doesn't seem to be possible) you can set this setting to true. Set it to false
351
you really intend to use this feature somewhere (on forums or maybe a website),
993
if you want the session to remain plain-text.
352
it's probably better to keep this setting disabled. Type: boolean The Jabber
994
353
module allows you to add a buddy xmlconsole to your contact list, which will
995
to_char
354
then show you the raw XMPP stream between you and the server. You can also send
996
355
XMPP packets to this buddy, which will then be sent to the server. If you want
997
Type: string
356
to enable this XML console permanently (and at login time already), you can set
998
357
this setting. rename <oldnick> <newnick> Renick a user in your buddy list. Very
999
It's customary that messages meant for one specific person on an IRC channel
358
useful, in fact just very important, if you got a lot of people with stupid
1000
are prepended by his/her alias followed by a colon ':'. BitlBee does this by
359
account names (or hard ICQ numbers). < itsme> rename itsme_ you * itsme_ is now
1001
default. If you prefer a different character, you can set it using set to_char.
360
known as you yes [<number>] Sometimes an IM-module might want to ask you a
1002
361
question. (Accept this user as your buddy or not?) To accept a question, use
1003
Please note that this setting is only used for incoming messages. For outgoing
362
the yes command. By default, this answers the first unanswered question. You
1004
messages you can use ':' (colon) or ',' to separate the destination nick from
363
can also specify a different question as an argument. You can use the qlist
1005
the message, and this is not configurable.
364
command for a list of questions. no [<number>] Sometimes an IM-module might
1006
365
want to ask you a question. (Accept this user as your buddy or not?) To reject
1007
typing_notice
366
a question, use the no command. By default, this answers the first unanswered
1008
367
question. You can also specify a different question as an argument. You can use
1009
Type: boolean
368
the qlist command for a list of questions. qlist This gives you a list of all
1010
369
the unanswered questions from root. register <password> BitlBee can save your
1011
Sends you a /notice when a user starts typing a message (if the protocol
370
settings so you won't have to enter all your IM passwords every time you log
1012
supports it, MSN for example). This is a bug, not a feature. (But please don't
371
in. If you want the Bee to save your settings, use the register command. Please
1013
report it.. ;-) You don't want to use it. Really. In fact the
372
do pick a secure password, don't just use your nick as your password. Please
1014
typing-notification is just one of the least useful 'innovations' ever. It's
373
note that IRC is not an encrypted protocol, so the passwords still go over the
1015
just there because some guy will probably ask me about it anyway. ;-)
374
network in plaintext. Evil people with evil sniffers will read it all. (So
1016
375
don't use your root password.. ;-) To identify yourself in later sessions, you
1017
web_aware
376
can use the identify command. To change your password later, you can use the
1018
377
set password command. identify <password> BitlBee saves all your settings
1019
Type: string
378
(contacts, accounts, passwords) on-server. To prevent other users from just
1020
379
logging in as you and getting this information, you'll have to identify
1021
ICQ allows people to see if you're on-line via a CGI-script. (http://
380
yourself with your password. You can register this password using the register
1022
status.icq.com/online.gif?icq=UIN) This can be nice to put on your website, but
381
command. Once you're registered, you can change your password using set
1023
it seems that spammers also use it to see if you're online without having to
382
password <password>. drop <password> Drop your BitlBee registration. Your
1024
add you to their contact list. So to prevent ICQ spamming, recent versions of
383
account files will be removed and your password will be forgotten. For obvious
1025
BitlBee disable this feature by default.
384
security reasons, you have to specify your NickServ password to make this
1026
385
command work. blist [all|online|offline|away] You can get a better readable
1027
Unless you really intend to use this feature somewhere (on forums or maybe a
386
buddy list using the blist command. If you want a complete list (including the
1028
website), it's probably better to keep this setting disabled.
387
offline users) you can use the all argument. nick <connection> [<new nick>]
1029
388
nick <connection> Deprecated: Use the per-account display_name setting to read
1030
xmlconsole
389
and change this information. < wouter> account set 1/display_name "The majestik
1031
390
møøse" < root> display_name = `The majestik møøse' join_chat <connection> <room
1032
Type: boolean
391
name> [<channel name>] [<room nickname>] [<password>] On most IM-networks
1033
392
groupchats can be started using the /join command. (/join #foo to start a
1034
The Jabber module allows you to add a buddy xmlconsole to your contact list,
393
chatroom with you and foo) This doesn't work with names groupchats though
1035
which will then show you the raw XMPP stream between you and the server. You
394
(which exist on Jabber networks and AIM, for example), instead you can use this
1036
can also send XMPP packets to this buddy, which will then be sent to the
395
command. The first two arguments are required. room name is the name of the
1037
server.
396
chatroom on the IM-network. channel name is the IRC channel name BitlBee should
1038
397
map this to. room nickname is the nickname you want to have in this channel. If
1039
If you want to enable this XML console permanently (and at login time already),
398
you don't give these options, BitlBee will do the right guesses. The following
1040
you can set this setting.
399
command will join you to the chatroom called bitlbee@conference.bitlbee.org.
1041
400
The channel will be called &bitlbee-help because &bitlbee will already be in
1042
rename - Rename (renick) a buddy
401
use. Your nickname will be help-me. < wilmer> join_chat jabber
1043
402
bitlbee@conference.bitlbee.org &bitlbee-help help-me All MSN smileys (except
1044
Syntax: 
403
one) are case insensitive and work without the nose too. (Y) Thumbs up (N)
1045
404
Thumbs down (B) Beer mug (D) Martini glass (X) Girl (Z) Boy (6) Devil smiley :-
1046
rename <oldnick> <newnick>
405
[ Vampire bat (}) Right hug ({) Left hug (M) MSN Messenger or Windows Messenger
1047
406
icon (think a BitlBee logo here ;) :-S Crooked smiley (Confused smiley) :-$
1048
Renick a user in your buddy list. Very useful, in fact just very important, if
407
Embarrassed smiley (H) Smiley with sunglasses :-@ Angry smiley (A) Angel smiley
1049
you got a lot of people with stupid account names (or hard ICQ numbers).
408
(L) Red heart (Love) (U) Broken heart (K) Red lips (Kiss) (G) Gift with bow (F)
1050
409
Red rose (W) Wilted rose (P) Camera (~) Film strip (T) Telephone receiver (@)
1051
< itsme> rename itsme_ you
410
Cat face (&) Dog's head (C) Coffee cup (I) Light bulb (S) Half-moon (Case
1052
 * itsme_ is now known as you
411
sensitive!) (*) Star (8) Musical eighth note (E) Envelope (^) Birthday cake (O)
1053
412
Clock BitlBee now supports groupchats on all IM networks. This text will try to
1054
yes - Accept a request
413
explain you how they work. As soon as someone invites you into a groupchat, you
1055
414
will be force-joined or invited (depending on the protocol) into a new virtual
1056
Syntax: 
415
channel with all the people in there. You can leave the channel at any time,
1057
416
just like you would close the window in regular IM clients. Please note that
1058
yes [<number>]
417
root-commands don't work in groupchat channels, they only work in the control
1059
418
channel (or to root directly). Of course you can also create your own
1060
Sometimes an IM-module might want to ask you a question. (Accept this user as
419
groupchats. Type help groupchats2 to see how. If you want to start a groupchat
1061
your buddy or not?) To accept a question, use the yes command.
420
with the person lisa_msn in it, just join the channel #lisa_msn. BitlBee will
1062
421
refuse to join you to the channel with that name, but it will create a new
1063
By default, this answers the first unanswered question. You can also specify a
422
virtual channel with root, you and lisa_msn in it. Of course a channel with
1064
different question as an argument. You can use the qlist command for a list of
423
only two people isn't really exciting yet. So the next step is to invite some
1065
questions.
424
other people to the channel. For this, you can use the /invite command of your
1066
425
IRC client. Please do keep in mind that all the people have to be on the same
1067
no - Deny a request
426
network and contact list! You can't invite Yahoo! buddies into an MSN
1068
427
groupchat. Some protocols (like Jabber) also support named groupchats. BitlBee
1069
Syntax: 
428
now supports these too. You can use the join_chat command to join them. See
1070
429
help join_chat for more information. As you might've expected, you can just use
1071
no [<number>]
430
the /away command in your IRC client to set an away-state. BitlBee supports
1072
431
most away-states supported by the protocols. Not all away states are supported
1073
Sometimes an IM-module might want to ask you a question. (Accept this user as
432
by all protocols, and some protocols have different names for them. BitlBee
1074
your buddy or not?) To reject a question, use the no command.
433
will try to pick the best available alias from this list for every connection:
1075
434
Away from computer, Away, Extended away NA, N/A, Not available Busy, Do not
1076
By default, this answers the first unanswered question. You can also specify a
435
disturb, DND, Occupied Be right back, BRB On the phone, Phone, On phone Out to
1077
different question as an argument. You can use the qlist command for a list of
436
lunch, Lunch, Food Invisible, Hidden So /away Food will set your state to "Out
1078
questions.
437
to lunch" on your MSN connection, and for most other connections the default,
1079
438
"Away" or "Away from computer" will be chosen. You can also add more
1080
qlist - List all the unanswered questions root asked
439
information to your away message. Setting it to "Busy - Fixing BitlBee bugs"
1081
440
will set your IM-away-states to Busy, but your away message will be more
1082
Syntax: 
441
descriptive for people on IRC. Most IM-protocols can also show this additional
1083
442
information to your buddies.
1084
qlist
1085
1086
This gives you a list of all the unanswered questions from root.
1087
1088
register - Register yourself
1089
1090
Syntax: 
1091
1092
register <password>
1093
1094
BitlBee can save your settings so you won't have to enter all your IM passwords
1095
every time you log in. If you want the Bee to save your settings, use the
1096
register command.
1097
1098
Please do pick a secure password, don't just use your nick as your password.
1099
Please note that IRC is not an encrypted protocol, so the passwords still go
1100
over the network in plaintext. Evil people with evil sniffers will read it all.
1101
(So don't use your root password.. ;-)
1102
1103
To identify yourself in later sessions, you can use the identify command. To
1104
change your password later, you can use the set password command.
1105
1106
identify - Identify yourself with your password
1107
1108
Syntax: 
1109
1110
identify <password>
1111
1112
BitlBee saves all your settings (contacts, accounts, passwords) on-server. To
1113
prevent other users from just logging in as you and getting this information,
1114
you'll have to identify yourself with your password. You can register this
1115
password using the register command.
1116
1117
Once you're registered, you can change your password using set password
1118
<password>.
1119
1120
drop - Drop your account
1121
1122
Syntax: 
1123
1124
drop <password>
1125
1126
Drop your BitlBee registration. Your account files will be removed and your
1127
password will be forgotten. For obvious security reasons, you have to specify
1128
your NickServ password to make this command work.
1129
1130
blist - List all the buddies in your contact list
1131
1132
Syntax: 
1133
1134
blist [all|online|offline|away]
1135
1136
You can get a better readable buddy list using the blist command. If you want a
1137
complete list (including the offline users) you can use the all argument.
1138
1139
nick - Change friendly name, nick
1140
1141
Syntax: 
1142
1143
nick <connection> [<new nick>]
1144
nick
1145
1146
This command allows to set the friendly name of an im account. If no new name
1147
is specified the command will report the current name. When the name contains
1148
spaces, don't forget to quote the whole nick in double quotes. Currently this
1149
command is only supported by the MSN protocol.
1150
1151
It is recommended to use the per-account display_name setting to read and
1152
change this information. The nick command is deprecated.
1153
1154
< wouter> nick 1 "Wouter Paesen"
1155
< root> Setting your name on connection 1 to `Wouter Paesen'
1156
1157
join_chat - Join a named groupchat/conference room
1158
1159
Syntax: 
1160
1161
join_chat <connection> <room name> [<channel name>] [<room nickname>] [<password>]
1162
1163
On most IM-networks groupchats can be started using the /join command. (/join #
1164
foo to start a chatroom with you and foo) This doesn't work with names
1165
groupchats though (which exist on Jabber networks and AIM, for example),
1166
instead you can use this command.
1167
1168
The first two arguments are required. room name is the name of the chatroom on
1169
the IM-network. channel name is the IRC channel name BitlBee should map this
1170
to. room nickname is the nickname you want to have in this channel. If you
1171
don't give these options, BitlBee will do the right guesses.
1172
1173
The following command will join you to the chatroom called
1174
bitlbee@conference.bitlbee.org. The channel will be called &bitlbee-help
1175
because &bitlbee will already be in use. Your nickname will be help-me.
1176
1177
< wilmer> join_chat jabber bitlbee@conference.bitlbee.org &bitlbee-help help-me
1178
1179
Chapter 6. Misc Stuff
1180
1181
Table of Contents
1182
1183
Smileys
1184
Groupchats
1185
Creating groupchats
1186
Groupchat channel names
1187
Away states
1188
1189
Smileys
1190
1191
All MSN smileys (except one) are case insensitive and work without the nose
1192
too.
1193
1194
(Y)
1195
1196
    Thumbs up
1197
1198
(N)
1199
1200
    Thumbs down
1201
1202
(B)
1203
1204
    Beer mug
1205
1206
(D)
1207
1208
    Martini glass
1209
1210
(X)
1211
1212
    Girl
1213
1214
(Z)
1215
1216
    Boy
1217
1218
(6)
1219
1220
    Devil smiley
1221
1222
:-[
1223
1224
    Vampire bat
1225
1226
(})
1227
1228
    Right hug
1229
1230
({)
1231
1232
    Left hug
1233
1234
(M)
1235
1236
    MSN Messenger or Windows Messenger icon (think a BitlBee logo here ;)
1237
1238
:-S
1239
1240
    Crooked smiley (Confused smiley)
1241
1242
:-$
1243
1244
    Embarrassed smiley
1245
1246
(H)
1247
1248
    Smiley with sunglasses
1249
1250
:-@
1251
1252
    Angry smiley
1253
1254
(A)
1255
1256
    Angel smiley
1257
1258
(L)
1259
1260
    Red heart (Love)
1261
1262
(U)
1263
1264
    Broken heart
1265
1266
(K)
1267
1268
    Red lips (Kiss)
1269
1270
(G)
1271
1272
    Gift with bow
1273
1274
(F)
1275
1276
    Red rose
1277
1278
(W)
1279
1280
    Wilted rose
1281
1282
(P)
1283
1284
    Camera
1285
1286
(~)
1287
1288
    Film strip
1289
1290
(T)
1291
1292
    Telephone receiver
1293
1294
(@)
1295
1296
    Cat face
1297
1298
(&)
1299
1300
    Dog's head
1301
1302
(C)
1303
1304
    Coffee cup
1305
1306
(I)
1307
1308
    Light bulb
1309
1310
(S)
1311
1312
    Half-moon (Case sensitive!)
1313
1314
(*)
1315
1316
    Star
1317
1318
(8)
1319
1320
    Musical eighth note
1321
1322
(E)
1323
1324
    Envelope
1325
1326
(^)
1327
1328
    Birthday cake
1329
1330
(O)
1331
1332
    Clock
1333
1334
This list was extracted from http://help.msn.com/!data/en_us/data/
1335
messengerv50.its51/$content$/EMOTICONS.HTM?H_APP=.
1336
1337
Groupchats
1338
1339
Since version 0.8x, BitlBee supports groupchats on the MSN and Yahoo! networks.
1340
This text will try to explain you how they work.
1341
1342
As soon as someone invites you into a groupchat, you will be force-joined or
1343
invited (depending on the protocol) into a new virtual channel with all the
1344
people in there. You can leave the channel at any time, just like you would
1345
close the window in regular IM clients. Please note that root-commands don't
1346
work in groupchat channels, they only work in the control channel (or to root
1347
directly).
1348
1349
Of course you can also create your own groupchats. Type help groupchats2 to see
1350
how.
1351
1352
Creating groupchats
1353
1354
If you want to start a groupchat with the person jim_msn in it, just join the
1355
channel #jim_msn. BitlBee will refuse to join you to the channel with that
1356
name, but it will create a new virtual channel with root, you and jim_msn in
1357
it.
1358
1359
Of course a channel with only two people isn't really exciting yet. So the next
1360
step is to invite some other people to the channel. For this, you can use the /
1361
invite command of your IRC client. Please do keep in mind that all the people
1362
have to be on the same network and contact list! You can't invite Yahoo!
1363
buddies into an MSN groupchat.
1364
1365
Some protocols (like Jabber) also support named groupchats. BitlBee now
1366
supports these too. You can use the join_chat command to join them. See help
1367
join_chat for more information.
1368
1369
This is all you'll probably need to know. If you have any problems, please read
1370
help groupchats3.
1371
1372
Groupchat channel names
1373
1374
Obviously the (numbered) channel names don't make a lot of sense. Problem is
1375
that groupchats usually don't have names at all in the IM-world, while IRC
1376
insists on a name. So BitlBee just generates something random, just don't pay
1377
attention to it. :-)
1378
1379
Please also note that BitlBee doesn't support groupchats for all protocols yet.
1380
BitlBee will tell you so. Support for other protocols will hopefully come
1381
later.
1382
1383
Away states
1384
1385
As you might've expected, you can just use the /away command in your IRC client
1386
to set an away-state. BitlBee supports most away-states supported by the
1387
protocols.
1388
1389
Not all away states are supported by all protocols, and some protocols have
1390
different names for them. BitlBee will try to pick the best available alias
1391
from this list for every connection:
1392
1393
Away from computer, Away, Extended away
1394
NA, N/A, Not available
1395
Busy, Do not disturb, DND, Occupied
1396
Be right back, BRB
1397
On the phone, Phone, On phone
1398
Out to lunch, Lunch, Food
1399
1400
So /away Food will set your state to "Out to lunch" on your MSN connection, and
1401
for most other connections the default, "Away" or "Away from computer" will be
1402
chosen.
1403
1404
You can also add more information to your away message. Setting it to "Busy -
1405
Fixing BitlBee bugs" will set your IM-away-states to Busy, but your away
1406
message will be more descriptive for people on IRC. Protocols like Yahoo! and
1407
Jabber will also show this complete away message to your buddies.
1408
(-)bitlbee-1.2/irc.c (-112 / +201 lines)
Lines 27-32 Link Here
27
#include "bitlbee.h"
27
#include "bitlbee.h"
28
#include "crypting.h"
28
#include "crypting.h"
29
#include "ipc.h"
29
#include "ipc.h"
30
#include "dcc.h"
31
32
#include <regex.h>
33
#include <netinet/in.h>
30
34
31
static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond );
35
static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond );
32
36
Lines 41-46 Link Here
41
	return NULL;
45
	return NULL;
42
}
46
}
43
47
48
static char *set_eval_charset( set_t *set, char *value )
49
{
50
	irc_t *irc = set->data;
51
	GIConv ic, oc;
52
53
	if( g_strcasecmp( value, "none" ) == 0 )
54
		value = g_strdup( "utf-8" );
55
56
	if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 )
57
	{
58
		return NULL;
59
	}
60
	if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 )
61
	{
62
		g_iconv_close( ic );
63
		return NULL;
64
	}
65
	
66
	if( irc->iconv != (GIConv) -1 )
67
		g_iconv_close( irc->iconv );
68
	if( irc->oconv != (GIConv) -1 )
69
		g_iconv_close( irc->oconv );
70
	
71
	irc->iconv = ic;
72
	irc->oconv = oc;
73
74
	return value;
75
}
76
44
irc_t *irc_new( int fd )
77
irc_t *irc_new( int fd )
45
{
78
{
46
	irc_t *irc;
79
	irc_t *irc;
Lines 64-69 Link Here
64
	irc->mynick = g_strdup( ROOT_NICK );
97
	irc->mynick = g_strdup( ROOT_NICK );
65
	irc->channel = g_strdup( ROOT_CHAN );
98
	irc->channel = g_strdup( ROOT_CHAN );
66
	
99
	
100
	irc->iconv = (GIConv) -1;
101
	irc->oconv = (GIConv) -1;
102
	
67
	if( global.conf->hostname )
103
	if( global.conf->hostname )
68
	{
104
	{
69
		irc->myhost = g_strdup( global.conf->hostname );
105
		irc->myhost = g_strdup( global.conf->hostname );
Lines 118-123 Link Here
118
	set_add( &irc->set, "password", NULL, passchange, irc );
154
	set_add( &irc->set, "password", NULL, passchange, irc );
119
	set_add( &irc->set, "private", "true", set_eval_bool, irc );
155
	set_add( &irc->set, "private", "true", set_eval_bool, irc );
120
	set_add( &irc->set, "query_order", "lifo", NULL, irc );
156
	set_add( &irc->set, "query_order", "lifo", NULL, irc );
157
	set_add( &irc->set, "root_nick", irc->mynick, set_eval_root_nick, irc );
121
	set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc );
158
	set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc );
122
	set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc );
159
	set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc );
123
	set_add( &irc->set, "strip_html", "true", NULL, irc );
160
	set_add( &irc->set, "strip_html", "true", NULL, irc );
Lines 126-131 Link Here
126
	
163
	
127
	conf_loaddefaults( irc );
164
	conf_loaddefaults( irc );
128
	
165
	
166
	/* Evaluator sets the iconv/oconv structures. */
167
	set_eval_charset( set_find( &irc->set, "charset" ), set_getstr( &irc->set, "charset" ) );
168
	
129
	return( irc );
169
	return( irc );
130
}
170
}
131
171
Lines 163-174 Link Here
163
	irc->status |= USTATUS_SHUTDOWN;
203
	irc->status |= USTATUS_SHUTDOWN;
164
	if( irc->sendbuffer && !immed )
204
	if( irc->sendbuffer && !immed )
165
	{
205
	{
166
		/* We won't read from this socket anymore. Instead, we'll connect a timer
206
		/* Set up a timeout event that should shut down the connection
167
		   to it that should shut down the connection in a second, just in case
207
		   in a second, just in case ..._write doesn't do it first. */
168
		   bitlbee_.._write doesn't do it first. */
169
		
208
		
170
		b_event_remove( irc->r_watch_source_id );
209
		b_event_remove( irc->r_watch_source_id );
171
		irc->r_watch_source_id = b_timeout_add( 1000, (b_event_handler) irc_free, irc );
210
		irc->r_watch_source_id = 0;
211
		
212
		b_event_remove( irc->ping_source_id );
213
		irc->ping_source_id = b_timeout_add( 1000, (b_event_handler) irc_free, irc );
172
	}
214
	}
173
	else
215
	else
174
	{
216
	{
Lines 184-192 Link Here
184
}
226
}
185
227
186
/* Because we have no garbage collection, this is quite annoying */
228
/* Because we have no garbage collection, this is quite annoying */
187
void irc_free(irc_t * irc)
229
void irc_free( irc_t * irc )
188
{
230
{
189
	account_t *account;
190
	user_t *user, *usertmp;
231
	user_t *user, *usertmp;
191
	
232
	
192
	log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd );
233
	log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd );
Lines 195-270 Link Here
195
		if( storage_save( irc, TRUE ) != STORAGE_OK )
236
		if( storage_save( irc, TRUE ) != STORAGE_OK )
196
			irc_usermsg( irc, "Error while saving settings!" );
237
			irc_usermsg( irc, "Error while saving settings!" );
197
	
238
	
198
	closesocket( irc->fd );
199
	
200
	if( irc->ping_source_id > 0 )
201
		b_event_remove( irc->ping_source_id );
202
	b_event_remove( irc->r_watch_source_id );
203
	if( irc->w_watch_source_id > 0 )
204
		b_event_remove( irc->w_watch_source_id );
205
	
206
	irc_connection_list = g_slist_remove( irc_connection_list, irc );
239
	irc_connection_list = g_slist_remove( irc_connection_list, irc );
207
	
240
	
208
	for (account = irc->accounts; account; account = account->next) {
241
	while( irc->accounts )
209
		if (account->ic) {
242
	{
210
			imc_logout(account->ic, TRUE);
243
		if( irc->accounts->ic )
211
		} else if (account->reconnect) {
244
			imc_logout( irc->accounts->ic, FALSE );
212
			cancel_auto_reconnect(account);
245
		else if( irc->accounts->reconnect )
213
		}
246
			cancel_auto_reconnect( irc->accounts );
214
	}
247
		
215
	
248
		if( irc->accounts->ic == NULL )
216
	g_free(irc->sendbuffer);
249
			account_del( irc, irc->accounts );
217
	g_free(irc->readbuffer);
218
	
219
	g_free(irc->nick);
220
	g_free(irc->user);
221
	g_free(irc->host);
222
	g_free(irc->realname);
223
	g_free(irc->password);
224
	
225
	g_free(irc->myhost);
226
	g_free(irc->mynick);
227
	
228
	g_free(irc->channel);
229
	
230
	while (irc->queries != NULL)
231
		query_del(irc, irc->queries);
232
	
233
	while (irc->accounts)
234
		if (irc->accounts->ic == NULL)
235
			account_del(irc, irc->accounts);
236
		else
250
		else
237
			/* Nasty hack, but account_del() doesn't work in this
251
			/* Nasty hack, but account_del() doesn't work in this
238
			   case and we don't want infinite loops, do we? ;-) */
252
			   case and we don't want infinite loops, do we? ;-) */
239
			irc->accounts = irc->accounts->next;
253
			irc->accounts = irc->accounts->next;
254
	}
255
	
256
	while( irc->queries != NULL )
257
		query_del( irc, irc->queries );
240
	
258
	
241
	while (irc->set)
259
	while( irc->set )
242
		set_del(&irc->set, irc->set->key);
260
		set_del( &irc->set, irc->set->key );
243
	
261
	
244
	if (irc->users != NULL) {
262
	if (irc->users != NULL)
263
	{
245
		user = irc->users;
264
		user = irc->users;
246
		while (user != NULL) {
265
		while( user != NULL )
247
			g_free(user->nick);
266
		{
248
			g_free(user->away);
267
			g_free( user->nick );
249
			g_free(user->handle);
268
			g_free( user->away );
250
			if(user->user!=user->nick) g_free(user->user);
269
			g_free( user->handle );
251
			if(user->host!=user->nick) g_free(user->host);
270
			if( user->user != user->nick ) g_free( user->user );
252
			if(user->realname!=user->nick) g_free(user->realname);
271
			if( user->host != user->nick ) g_free( user->host );
253
			b_event_remove(user->sendbuf_timer);
272
			if( user->realname != user->nick ) g_free( user->realname );
273
			b_event_remove( user->sendbuf_timer );
254
					
274
					
255
			usertmp = user;
275
			usertmp = user;
256
			user = user->next;
276
			user = user->next;
257
			g_free(usertmp);
277
			g_free( usertmp );
258
		}
278
		}
259
	}
279
	}
260
	
280
	
261
	g_hash_table_foreach_remove(irc->userhash, irc_free_hashkey, NULL);
281
	if( irc->ping_source_id > 0 )
262
	g_hash_table_destroy(irc->userhash);
282
		b_event_remove( irc->ping_source_id );
283
	if( irc->r_watch_source_id > 0 )
284
		b_event_remove( irc->r_watch_source_id );
285
	if( irc->w_watch_source_id > 0 )
286
		b_event_remove( irc->w_watch_source_id );
287
	
288
	closesocket( irc->fd );
289
	irc->fd = -1;
290
	
291
	g_hash_table_foreach_remove( irc->userhash, irc_free_hashkey, NULL );
292
	g_hash_table_destroy( irc->userhash );
293
	
294
	g_hash_table_foreach_remove( irc->watches, irc_free_hashkey, NULL );
295
	g_hash_table_destroy( irc->watches );
296
	
297
	if( irc->iconv != (GIConv) -1 )
298
		g_iconv_close( irc->iconv );
299
	if( irc->oconv != (GIConv) -1 )
300
		g_iconv_close( irc->oconv );
301
	
302
	g_free( irc->sendbuffer );
303
	g_free( irc->readbuffer );
304
	
305
	g_free( irc->nick );
306
	g_free( irc->user );
307
	g_free( irc->host );
308
	g_free( irc->realname );
309
	g_free( irc->password );
310
	
311
	g_free( irc->myhost );
312
	g_free( irc->mynick );
313
	
314
	g_free( irc->channel );
263
	
315
	
264
	g_hash_table_foreach_remove(irc->watches, irc_free_hashkey, NULL);
316
	g_free( irc->last_target );
265
	g_hash_table_destroy(irc->watches);
266
	
317
	
267
	g_free(irc);
318
	g_free( irc );
268
	
319
	
269
	if( global.conf->runmode == RUNMODE_INETD || global.conf->runmode == RUNMODE_FORKDAEMON )
320
	if( global.conf->runmode == RUNMODE_INETD || global.conf->runmode == RUNMODE_FORKDAEMON )
270
		b_main_quit();
321
		b_main_quit();
Lines 285-291 Link Here
285
336
286
void irc_process( irc_t *irc )
337
void irc_process( irc_t *irc )
287
{
338
{
288
	char **lines, *temp, **cmd, *cs;
339
	char **lines, *temp, **cmd;
289
	int i;
340
	int i;
290
341
291
	if( irc->readbuffer != NULL )
342
	if( irc->readbuffer != NULL )
Lines 294-304 Link Here
294
		
345
		
295
		for( i = 0; *lines[i] != '\0'; i ++ )
346
		for( i = 0; *lines[i] != '\0'; i ++ )
296
		{
347
		{
297
			char conv[IRC_MAX_LINE+1];
348
			char *conv = NULL;
298
			
349
			
299
			/* [WvG] Because irc_tokenize splits at every newline, the lines[] list
350
			/* [WvG] If the last line isn't empty, it's an incomplete line and we
300
			    should end with an empty string. This is why this actually works.
351
			   should wait for the rest to come in before processing it. */
301
			    Took me a while to figure out, Maurits. :-P */
302
			if( lines[i+1] == NULL )
352
			if( lines[i+1] == NULL )
303
			{
353
			{
304
				temp = g_strdup( lines[i] );
354
				temp = g_strdup( lines[i] );
Lines 308-317 Link Here
308
				break;
358
				break;
309
			}
359
			}
310
			
360
			
311
			if( ( cs = set_getstr( &irc->set, "charset" ) ) )
361
			if( irc->iconv != (GIConv) -1 )
312
			{
362
			{
313
				conv[IRC_MAX_LINE] = 0;
363
				gsize bytes_read, bytes_written;
314
				if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) == -1 )
364
				
365
				conv = g_convert_with_iconv( lines[i], -1, irc->iconv,
366
				                             &bytes_read, &bytes_written, NULL );
367
				
368
				if( conv == NULL || bytes_read != strlen( lines[i] ) )
315
				{
369
				{
316
					/* GLib can do strange things if things are not in the expected charset,
370
					/* GLib can do strange things if things are not in the expected charset,
317
					   so let's be a little bit paranoid here: */
371
					   so let's be a little bit paranoid here: */
Lines 323-337 Link Here
323
						                  "that charset, or tell BitlBee which charset to "
377
						                  "that charset, or tell BitlBee which charset to "
324
						                  "expect by changing the charset setting. See "
378
						                  "expect by changing the charset setting. See "
325
						                  "`help set charset' for more information. Your "
379
						                  "`help set charset' for more information. Your "
326
						                  "message was ignored.", cs );
380
						                  "message was ignored.",
327
						*conv = 0;
381
						                  set_getstr( &irc->set, "charset" ) );
382
						
383
						g_free( conv );
384
						conv = NULL;
328
					}
385
					}
329
					else
386
					else
330
					{
387
					{
331
						irc_write( irc, ":%s NOTICE AUTH :%s", irc->myhost,
388
						irc_write( irc, ":%s NOTICE AUTH :%s", irc->myhost,
332
						           "Warning: invalid (non-UTF8) characters received at login time." );
389
						           "Warning: invalid characters received at login time." );
333
						
390
						
334
						strncpy( conv, lines[i], IRC_MAX_LINE );
391
						conv = g_strdup( lines[i] );
335
						for( temp = conv; *temp; temp ++ )
392
						for( temp = conv; *temp; temp ++ )
336
							if( *temp & 0x80 )
393
							if( *temp & 0x80 )
337
								*temp = '?';
394
								*temp = '?';
Lines 340-350 Link Here
340
				lines[i] = conv;
397
				lines[i] = conv;
341
			}
398
			}
342
			
399
			
343
			if( ( cmd = irc_parse_line( lines[i] ) ) == NULL )
400
			if( lines[i] )
344
				continue;
401
			{
345
			irc_exec( irc, cmd );
402
				if( ( cmd = irc_parse_line( lines[i] ) ) == NULL )
403
					continue;
404
				irc_exec( irc, cmd );
405
				g_free( cmd );
406
			}
346
			
407
			
347
			g_free( cmd );
408
			g_free( conv );
348
			
409
			
349
			/* Shouldn't really happen, but just in case... */
410
			/* Shouldn't really happen, but just in case... */
350
			if( !g_slist_find( irc_connection_list, irc ) )
411
			if( !g_slist_find( irc_connection_list, irc ) )
Lines 368-409 Link Here
368
   contains an incomplete line at the end, ends with an empty string. */
429
   contains an incomplete line at the end, ends with an empty string. */
369
char **irc_tokenize( char *buffer )
430
char **irc_tokenize( char *buffer )
370
{
431
{
371
	int i, j;
432
	int i, j, n = 3;
372
	char **lines;
433
	char **lines;
373
434
374
	/* Count the number of elements we're gonna need. */
435
	/* Allocate n+1 elements. */
375
	for( i = 0, j = 1; buffer[i] != '\0'; i ++ )
436
	lines = g_new( char *, n + 1 );
376
	{
377
		if( buffer[i] == '\n' )
378
			if( buffer[i+1] != '\r' && buffer[i+1] != '\n' )
379
				j ++;
380
	}
381
	
382
	/* Allocate j+1 elements. */
383
	lines = g_new( char *, j + 1 );
384
	
385
	/* NULL terminate our list. */ 
386
	lines[j] = NULL;
387
	
437
	
388
	lines[0] = buffer;
438
	lines[0] = buffer;
389
	
439
	
390
	/* Split the buffer in several strings, using \r\n as our seperator, where \r is optional.
440
	/* Split the buffer in several strings, and accept any kind of line endings,
391
	 * Although this is not in the RFC, some braindead ircds (newnet's) use this, so some clients might too. 
441
	 * knowing that ERC on Windows may send something interesting like \r\r\n,
392
	 */
442
	 * and surely there must be clients that think just \n is enough... */
393
	for( i = 0, j = 0; buffer[i] != '\0'; i ++)
443
	for( i = 0, j = 0; buffer[i] != '\0'; i ++ )
394
	{
444
	{
395
		if( buffer[i] == '\n' )
445
		if( buffer[i] == '\r' || buffer[i] == '\n' )
396
		{
446
		{
397
			buffer[i] = '\0';
447
			while( buffer[i] == '\r' || buffer[i] == '\n' )
448
				buffer[i++] = '\0';
449
			
450
			lines[++j] = buffer + i;
398
			
451
			
399
			if( i > 0 && buffer[i-1] == '\r' )
452
			if( j >= n )
400
				buffer[i-1] = '\0';
453
			{
401
			if( buffer[i+1] != '\r' && buffer[i+1] != '\n' )
454
				n *= 2;
402
				lines[++j] = buffer + i + 1;
455
				lines = g_renew( char *, lines, n + 1 );
456
			}
457
458
			if( buffer[i] == '\0' )
459
				break;
403
		}
460
		}
404
	}
461
	}
405
	
462
	
406
	return( lines );
463
	/* NULL terminate our list. */ 
464
	lines[++j] = NULL;
465
	
466
	return lines;
407
}
467
}
408
468
409
/* Split an IRC-style line into little parts/arguments. */
469
/* Split an IRC-style line into little parts/arguments. */
Lines 537-567 Link Here
537
	va_end( params );
597
	va_end( params );
538
598
539
	return;
599
	return;
540
541
}
600
}
542
601
543
void irc_vawrite( irc_t *irc, char *format, va_list params )
602
void irc_vawrite( irc_t *irc, char *format, va_list params )
544
{
603
{
545
	int size;
604
	int size;
546
	char line[IRC_MAX_LINE+1], *cs;
605
	char line[IRC_MAX_LINE+1];
547
		
606
		
548
	/* Don't try to write anything new anymore when shutting down. */
607
	/* Don't try to write anything new anymore when shutting down. */
549
	if( irc->status & USTATUS_SHUTDOWN )
608
	if( irc->status & USTATUS_SHUTDOWN )
550
		return;
609
		return;
551
	
610
	
552
	line[IRC_MAX_LINE] = 0;
611
	memset( line, 0, sizeof( line ) );
553
	g_vsnprintf( line, IRC_MAX_LINE - 2, format, params );
612
	g_vsnprintf( line, IRC_MAX_LINE - 2, format, params );
554
	
555
	strip_newlines( line );
613
	strip_newlines( line );
556
	if( ( cs = set_getstr( &irc->set, "charset" ) ) && ( g_strcasecmp( cs, "utf-8" ) != 0 ) )
614
	
615
	if( irc->oconv != (GIConv) -1 )
557
	{
616
	{
558
		char conv[IRC_MAX_LINE+1];
617
		gsize bytes_read, bytes_written;
618
		char *conv;
559
		
619
		
560
		conv[IRC_MAX_LINE] = 0;
620
		conv = g_convert_with_iconv( line, -1, irc->oconv,
561
		if( do_iconv( "UTF-8", cs, line, conv, 0, IRC_MAX_LINE - 2 ) != -1 )
621
		                             &bytes_read, &bytes_written, NULL );
562
			strcpy( line, conv );
622
623
		if( bytes_read == strlen( line ) )
624
			strncpy( line, conv, IRC_MAX_LINE - 2 );
625
		
626
		g_free( conv );
563
	}
627
	}
564
	strcat( line, "\r\n" );
628
	g_strlcat( line, "\r\n", IRC_MAX_LINE + 1 );
565
	
629
	
566
	if( irc->sendbuffer != NULL )
630
	if( irc->sendbuffer != NULL )
567
	{
631
	{
Lines 734-745 Link Here
734
	u->online = 1;
798
	u->online = 1;
735
	irc_spawn( irc, u );
799
	irc_spawn( irc, u );
736
	
800
	
737
	irc_usermsg( irc, "Welcome to the BitlBee gateway!\n\nIf you've never used BitlBee before, please do read the help information using the \x02help\x02 command. Lots of FAQs are answered there." );
801
	irc_usermsg( irc, "Welcome to the BitlBee gateway!\n\n"
802
	                  "If you've never used BitlBee before, please do read the help "
803
	                  "information using the \x02help\x02 command. Lots of FAQs are "
804
	                  "answered there.\n"
805
	                  "If you already have an account on this server, just use the "
806
	                  "\x02identify\x02 command to identify yourself." );
738
	
807
	
739
	if( global.conf->runmode == RUNMODE_FORKDAEMON || global.conf->runmode == RUNMODE_DAEMON )
808
	if( global.conf->runmode == RUNMODE_FORKDAEMON || global.conf->runmode == RUNMODE_DAEMON )
740
		ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->host, irc->nick, irc->realname );
809
		ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->host, irc->nick, irc->realname );
741
	
810
	
742
	irc->status |= USTATUS_LOGGED_IN;
811
	irc->status |= USTATUS_LOGGED_IN;
812
	
813
	/* This is for bug #209 (use PASS to identify to NickServ). */
814
	if( irc->password != NULL )
815
	{
816
		char *send_cmd[] = { "identify", g_strdup( irc->password ), NULL };
817
		
818
		irc_setpass( irc, NULL );
819
		root_command( irc, send_cmd );
820
		g_free( send_cmd[1] );
821
	}
743
}
822
}
744
823
745
void irc_motd( irc_t *irc )
824
void irc_motd( irc_t *irc )
Lines 994-1002 Link Here
994
			}
1073
			}
995
			return( 1 );
1074
			return( 1 );
996
		}
1075
		}
1076
		else if( g_strncasecmp( s + 1, "DCC", 3 ) == 0 )
1077
		{
1078
			if( u && u->ic && u->ic->acc->prpl->transfer_request )
1079
			{
1080
				file_transfer_t *ft = dcc_request( u->ic, s + 5 );
1081
				if ( ft )
1082
					u->ic->acc->prpl->transfer_request( u->ic, ft, u->handle );
1083
			}
1084
			return( 1 );
1085
		}		
997
		else
1086
		else
998
		{
1087
		{
999
			irc_usermsg( irc, "Non-ACTION CTCP's aren't supported" );
1088
			irc_usermsg( irc, "Supported CTCPs are ACTION, VERSION, PING, TYPING, DCC" );
1000
			return( 0 );
1089
			return( 0 );
1001
		}
1090
		}
1002
	}
1091
	}
(-)bitlbee-1.2/irc_commands.c (-5 / +22 lines)
Lines 29-35 Link Here
29
29
30
static void irc_cmd_pass( irc_t *irc, char **cmd )
30
static void irc_cmd_pass( irc_t *irc, char **cmd )
31
{
31
{
32
	if( global.conf->auth_pass &&
32
	if( irc->status & USTATUS_LOGGED_IN )
33
	{
34
		char *send_cmd[] = { "identify", cmd[1], NULL };
35
		
36
		/* We're already logged in, this client seems to send the PASS
37
		   command last. (Possibly it won't send it at all if it turns
38
		   out we don't require it, which will break this feature.)
39
		   Try to identify using the given password. */
40
		return root_command( irc, send_cmd );
41
	}
42
	/* Handling in pre-logged-in state, first see if this server is
43
	   password-protected: */
44
	else if( global.conf->auth_pass &&
33
	    ( strncmp( global.conf->auth_pass, "md5:", 4 ) == 0 ?
45
	    ( strncmp( global.conf->auth_pass, "md5:", 4 ) == 0 ?
34
	        md5_verify_password( cmd[1], global.conf->auth_pass + 4 ) == 0 :
46
	        md5_verify_password( cmd[1], global.conf->auth_pass + 4 ) == 0 :
35
	        strcmp( cmd[1], global.conf->auth_pass ) == 0 ) )
47
	        strcmp( cmd[1], global.conf->auth_pass ) == 0 ) )
Lines 37-46 Link Here
37
		irc->status |= USTATUS_AUTHORIZED;
49
		irc->status |= USTATUS_AUTHORIZED;
38
		irc_check_login( irc );
50
		irc_check_login( irc );
39
	}
51
	}
40
	else
52
	else if( global.conf->auth_pass )
41
	{
53
	{
42
		irc_reply( irc, 464, ":Incorrect password" );
54
		irc_reply( irc, 464, ":Incorrect password" );
43
	}
55
	}
56
	else
57
	{
58
		/* Remember the password and try to identify after USER/NICK. */
59
		irc_setpass( irc, cmd[1] );
60
		irc_check_login( irc );
61
	}
44
}
62
}
45
63
46
static void irc_cmd_user( irc_t *irc, char **cmd )
64
static void irc_cmd_user( irc_t *irc, char **cmd )
Lines 259-266 Link Here
259
			
277
			
260
			if( cmd[1] != irc->last_target )
278
			if( cmd[1] != irc->last_target )
261
			{
279
			{
262
				if( irc->last_target )
280
				g_free( irc->last_target );
263
					g_free( irc->last_target );
264
				irc->last_target = g_strdup( cmd[1] );
281
				irc->last_target = g_strdup( cmd[1] );
265
			}
282
			}
266
		}
283
		}
Lines 580-586 Link Here
580
}
597
}
581
598
582
static const command_t irc_commands[] = {
599
static const command_t irc_commands[] = {
583
	{ "pass",        1, irc_cmd_pass,        IRC_CMD_PRE_LOGIN },
600
	{ "pass",        1, irc_cmd_pass,        0 },
584
	{ "user",        4, irc_cmd_user,        IRC_CMD_PRE_LOGIN },
601
	{ "user",        4, irc_cmd_user,        IRC_CMD_PRE_LOGIN },
585
	{ "nick",        1, irc_cmd_nick,        0 },
602
	{ "nick",        1, irc_cmd_nick,        0 },
586
	{ "quit",        0, irc_cmd_quit,        0 },
603
	{ "quit",        0, irc_cmd_quit,        0 },
(-)bitlbee-1.2/irc.h (-1 / +5 lines)
Lines 60-65 Link Here
60
	int pinging;
60
	int pinging;
61
	char *sendbuffer;
61
	char *sendbuffer;
62
	char *readbuffer;
62
	char *readbuffer;
63
	GIConv iconv, oconv;
63
64
64
	int sentbytes;
65
	int sentbytes;
65
	time_t oldtime;
66
	time_t oldtime;
Lines 68-74 Link Here
68
	char *user;
69
	char *user;
69
	char *host;
70
	char *host;
70
	char *realname;
71
	char *realname;
71
	char *password;
72
	char *password; /* HACK: Used to save the user's password, but before
73
	                   logging in, this may contain a password we should
74
	                   send to identify after USER/NICK are received. */
72
75
73
	char umode[8];
76
	char umode[8];
74
	
77
	
Lines 83-88 Link Here
83
	
86
	
84
	struct query *queries;
87
	struct query *queries;
85
	struct account *accounts;
88
	struct account *accounts;
89
	GSList *file_transfers;
86
	
90
	
87
	struct __USER *users;
91
	struct __USER *users;
88
	GHashTable *userhash;
92
	GHashTable *userhash;
(-)bitlbee-1.2/lib/arc.h (+4 lines)
Lines 30-35 Link Here
30
	unsigned char i, j;
30
	unsigned char i, j;
31
};
31
};
32
32
33
#ifndef G_GNUC_MALLOC
34
#define G_GNUC_MALLOC
35
#endif
36
33
G_GNUC_MALLOC struct arc_state *arc_keymaker( unsigned char *key, int kl, int cycles );
37
G_GNUC_MALLOC struct arc_state *arc_keymaker( unsigned char *key, int kl, int cycles );
34
unsigned char arc_getbyte( struct arc_state *st );
38
unsigned char arc_getbyte( struct arc_state *st );
35
int arc_encode( char *clear, int clear_len, unsigned char **crypt, char *password, int pad_to );
39
int arc_encode( char *clear, int clear_len, unsigned char **crypt, char *password, int pad_to );
(-)bitlbee-1.2/lib/events_glib.c (-2 / +3 lines)
Lines 50-60 Link Here
50
	gpointer data;
50
	gpointer data;
51
} GaimIOClosure;
51
} GaimIOClosure;
52
52
53
static GMainLoop *loop;
53
static GMainLoop *loop = NULL;
54
54
55
void b_main_init()
55
void b_main_init()
56
{
56
{
57
	loop = g_main_new( FALSE );
57
	if( loop == NULL )
58
		loop = g_main_new( FALSE );
58
}
59
}
59
60
60
void b_main_run()
61
void b_main_run()
(-)bitlbee-1.2/lib/proxy.c (-2 / +2 lines)
Lines 529-535 Link Here
529
{
529
{
530
	struct PHB *phb;
530
	struct PHB *phb;
531
	
531
	
532
	if (!host || !port || (port == -1) || !func || strlen(host) > 128) {
532
	if (!host || port <= 0 || !func || strlen(host) > 128) {
533
		return -1;
533
		return -1;
534
	}
534
	}
535
	
535
	
Lines 537-543 Link Here
537
	phb->func = func;
537
	phb->func = func;
538
	phb->data = data;
538
	phb->data = data;
539
	
539
	
540
	if ((proxytype == PROXY_NONE) || strlen(proxyhost) > 0 || !proxyport || (proxyport == -1))
540
	if (proxytype == PROXY_NONE || !proxyhost[0] || proxyport <= 0)
541
		return proxy_connect_none(host, port, phb);
541
		return proxy_connect_none(host, port, phb);
542
	else if (proxytype == PROXY_HTTP)
542
	else if (proxytype == PROXY_HTTP)
543
		return proxy_connect_http(host, port, phb);
543
		return proxy_connect_http(host, port, phb);
(-)bitlbee-1.2/lib/ssl_client.h (+3 lines)
Lines 59-64 Link Here
59
G_MODULE_EXPORT int ssl_read( void *conn, char *buf, int len );
59
G_MODULE_EXPORT int ssl_read( void *conn, char *buf, int len );
60
G_MODULE_EXPORT int ssl_write( void *conn, const char *buf, int len );
60
G_MODULE_EXPORT int ssl_write( void *conn, const char *buf, int len );
61
61
62
/* See ssl_openssl.c for an explanation. */
63
G_MODULE_EXPORT int ssl_pending( void *conn );
64
62
/* Abort the SSL connection and disconnect the socket. Do not use close()
65
/* Abort the SSL connection and disconnect the socket. Do not use close()
63
   directly, both the SSL library and the peer will be unhappy! */
66
   directly, both the SSL library and the peer will be unhappy! */
64
G_MODULE_EXPORT void ssl_disconnect( void *conn_ );
67
G_MODULE_EXPORT void ssl_disconnect( void *conn_ );
(-)bitlbee-1.2/lib/ssl_gnutls.c (+6 lines)
Lines 210-215 Link Here
210
	return st;
210
	return st;
211
}
211
}
212
212
213
/* See ssl_openssl.c for an explanation. */
214
int ssl_pending( void *conn )
215
{
216
	return 0;
217
}
218
213
void ssl_disconnect( void *conn_ )
219
void ssl_disconnect( void *conn_ )
214
{
220
{
215
	struct scd *conn = conn_;
221
	struct scd *conn = conn_;
(-)bitlbee-1.2/lib/ssl_nss.c (+6 lines)
Lines 168-173 Link Here
168
	return( PR_Write ( ((struct scd*)conn)->prfd, buf, len ) );
168
	return( PR_Write ( ((struct scd*)conn)->prfd, buf, len ) );
169
}
169
}
170
170
171
/* See ssl_openssl.c for an explanation. */
172
int ssl_pending( void *conn )
173
{
174
	return 0;
175
}
176
171
void ssl_disconnect( void *conn_ )
177
void ssl_disconnect( void *conn_ )
172
{
178
{
173
	struct scd *conn = conn_;
179
	struct scd *conn = conn_;
(-)bitlbee-1.2/lib/ssl_openssl.c (-4 / +19 lines)
Lines 61-76 Link Here
61
	struct scd *conn = g_new0( struct scd, 1 );
61
	struct scd *conn = g_new0( struct scd, 1 );
62
	
62
	
63
	conn->fd = proxy_connect( host, port, ssl_connected, conn );
63
	conn->fd = proxy_connect( host, port, ssl_connected, conn );
64
	conn->func = func;
65
	conn->data = data;
66
	conn->inpa = -1;
67
	
68
	if( conn->fd < 0 )
64
	if( conn->fd < 0 )
69
	{
65
	{
70
		g_free( conn );
66
		g_free( conn );
71
		return NULL;
67
		return NULL;
72
	}
68
	}
73
	
69
	
70
	conn->func = func;
71
	conn->data = data;
72
	conn->inpa = -1;
73
	
74
	return conn;
74
	return conn;
75
}
75
}
76
76
Lines 230-235 Link Here
230
	return st;
230
	return st;
231
}
231
}
232
232
233
/* Only OpenSSL *really* needs this (and well, maybe NSS). See for more info:
234
   http://www.gnu.org/software/gnutls/manual/gnutls.html#index-gnutls_005frecord_005fcheck_005fpending-209
235
   http://www.openssl.org/docs/ssl/SSL_pending.html
236
   
237
   Required because OpenSSL empties the TCP buffer completely but doesn't
238
   necessarily give us all the unencrypted data.
239
   
240
   Returns 0 if there's nothing left or if we don't have to care (GnuTLS),
241
   1 if there's more data. */
242
int ssl_pending( void *conn )
243
{
244
	return ( ((struct scd*)conn) && ((struct scd*)conn)->established ) ?
245
	       SSL_pending( ((struct scd*)conn)->ssl ) > 0 : 0;
246
}
247
233
void ssl_disconnect( void *conn_ )
248
void ssl_disconnect( void *conn_ )
234
{
249
{
235
	struct scd *conn = conn_;
250
	struct scd *conn = conn_;
(-)bitlbee-1.2/Makefile (-2 / +2 lines)
Lines 9-16 Link Here
9
-include Makefile.settings
9
-include Makefile.settings
10
10
11
# Program variables
11
# Program variables
12
objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) unix.o user.o
12
objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) unix.o user.o dcc.o
13
headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h
13
headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h dcc.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h protocols/ft.h
14
subdirs = lib protocols
14
subdirs = lib protocols
15
15
16
# Expansion of variables
16
# Expansion of variables
(-)bitlbee-1.2/protocols/ft.h (+173 lines)
Line 0 Link Here
1
/********************************************************************\
2
* BitlBee -- An IRC to other IM-networks gateway                     *
3
*                                                                    *
4
* Copyright 2006 Marijn Kruisselbrink and others                     *
5
\********************************************************************/
6
7
/* Generic file transfer header                                     */
8
9
/*
10
  This program is free software; you can redistribute it and/or modify
11
  it under the terms of the GNU General Public License as published by
12
  the Free Software Foundation; either version 2 of the License, or
13
  (at your option) any later version.
14
15
  This program is distributed in the hope that it will be useful,
16
  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
  GNU General Public License for more details.
19
20
  You should have received a copy of the GNU General Public License with
21
  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
22
  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23
  Suite 330, Boston, MA  02111-1307  USA
24
*/
25
26
#ifndef _FT_H
27
#define _FT_H
28
29
/*
30
 * One buffer is needed for each transfer. The receiver stores a message
31
 * in it and gives it to the sender. The sender will stall the receiver
32
 * till the buffer has been sent out.
33
 */
34
#define FT_BUFFER_SIZE 2048
35
36
typedef enum {
37
	FT_STATUS_LISTENING	= 1,
38
	FT_STATUS_TRANSFERRING	= 2,
39
	FT_STATUS_FINISHED	= 4,
40
	FT_STATUS_CANCELED	= 8,
41
	FT_STATUS_CONNECTING	= 16
42
} file_status_t;
43
44
/*
45
 * This structure holds all irc specific information regarding an incoming (from the point of view of
46
 * the irc client) file transfer. New instances of this struct should only be created by calling the
47
 * imcb_file_send_start() method, which will initialize most of the fields. The data field and the various
48
 * methods are zero-initialized. Instances will automatically be deleted once the transfer is completed,
49
 * canceled, or the connection to the irc client has been lost (note that also if only the irc connection
50
 * and not the file transfer connection is lost, the file transfer will still be canceled and freed).
51
 *
52
 * The following (poor ascii-art) diagram illustrates what methods are called for which status-changes:
53
 *
54
 *	                        /-----------\                    /----------\
55
 *	               -------> | LISTENING | -----------------> | CANCELED |
56
 *	                        \-----------/  [canceled,]free   \----------/
57
 *	                              |
58
 *	                              | accept
59
 *	                              V
60
 *	               /------ /-------------\                    /------------------------\
61
 *	   out_of_data |       | TRANSFERING | -----------------> | TRANSFERING | CANCELED |
62
 *	               \-----> \-------------/  [canceled,]free   \------------------------/
63
 *	                              |
64
 *	                              | finished,free
65
 *	                              V
66
 *	                 /------------------------\
67
 *	                 | TRANSFERING | FINISHED |
68
 *	                 \------------------------/
69
 */
70
typedef struct file_transfer {
71
72
	/* Are we sending something? */
73
	int sending;
74
75
	/*
76
	 * The current status of this file transfer.
77
	 */ 
78
	file_status_t status;
79
	
80
	/*
81
	 * file size
82
	 */
83
	size_t file_size;
84
	
85
	/*
86
	 * Number of bytes that have been successfully transferred.
87
	 */
88
	size_t bytes_transferred;
89
90
	/*
91
	 * Time started. Used to calculate kb/s.
92
	 */
93
	time_t started;
94
95
	/*
96
	 * file name
97
	 */
98
	char *file_name;
99
100
	/*
101
	 * A unique local ID for this file transfer.
102
	 */
103
	unsigned int local_id;
104
105
	/*
106
	 * IM-protocol specific data associated with this file transfer.
107
	 */
108
	gpointer data;
109
	
110
	/*
111
	 * Private data.
112
	 */
113
	gpointer priv;
114
	
115
	/*
116
	 * If set, called after succesful connection setup.
117
	 */
118
	void (*accept) ( struct file_transfer *file );
119
	
120
	/*
121
	 * If set, called when the transfer is canceled or finished.
122
	 * Subsequently, this structure will be freed.
123
	 *
124
	 */
125
	void (*free) ( struct file_transfer *file );
126
	
127
	/*
128
	 * If set, called when the transfer is finished and successful.
129
	 */
130
	void (*finished) ( struct file_transfer *file );
131
	
132
	/*
133
	 * If set, called when the transfer is canceled.
134
	 * ( canceled either by the transfer implementation or by
135
	 *  a call to imcb_file_canceled )
136
	 */
137
	void (*canceled) ( struct file_transfer *file, char *reason );
138
	
139
	/*
140
	 * called by the sending side to indicate that it is writable.
141
	 * The callee should check if data is available and call the 
142
	 * function(as seen below) if that is the case.
143
	 */
144
	gboolean (*write_request) ( struct file_transfer *file );
145
146
	/*
147
	 * When sending files, protocols register this function to receive data.
148
	 * This should only be called once after write_request is called. The caller
149
	 * should not read more data until write_request is called again. This technique
150
	 * avoids buffering.
151
	 */
152
	gboolean (*write) (struct file_transfer *file, char *buffer, unsigned int len );
153
154
	/* The send buffer associated with this transfer.
155
	 * Since receivers always wait for a write_request call one is enough.
156
	 */
157
	char buffer[FT_BUFFER_SIZE];
158
159
} file_transfer_t;
160
161
/*
162
 * This starts a file transfer from bitlbee to the user.
163
 */
164
file_transfer_t *imcb_file_send_start( struct im_connection *ic, char *user_nick, char *file_name, size_t file_size );
165
166
/*
167
 * This should be called by a protocol when the transfer is canceled. Note that
168
 * the canceled() and free() callbacks given in file will be called by this function.
169
 */
170
void imcb_file_canceled( file_transfer_t *file, char *reason );
171
172
gboolean imcb_file_recv_start( file_transfer_t *ft );
173
#endif
(-)bitlbee-1.2/protocols/jabber/io.c (-2 / +7 lines)
Lines 240-247 Link Here
240
		return FALSE;
240
		return FALSE;
241
	}
241
	}
242
	
242
	
243
	/* EAGAIN/etc or a successful read. */
243
	if( ssl_pending( jd->ssl ) )
244
	return TRUE;
244
		/* OpenSSL empties the TCP buffers completely but may keep some
245
		   data in its internap buffers. select() won't see that, but
246
		   ssl_pending() does. */
247
		return jabber_read_callback( data, fd, cond );
248
	else
249
		return TRUE;
245
}
250
}
246
251
247
gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond )
252
gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond )
(-)bitlbee-1.2/protocols/jabber/iq.c (-12 / +180 lines)
Lines 89-102 Link Here
89
				xt_add_attr( reply, "id", s );
89
				xt_add_attr( reply, "id", s );
90
			pack = 0;
90
			pack = 0;
91
		}
91
		}
92
		else if( strcmp( s, XMLNS_DISCOVER ) == 0 )
92
		else if( strcmp( s, XMLNS_DISCO_INFO ) == 0 )
93
		{
93
		{
94
			const char *features[] = { XMLNS_DISCOVER,
94
			const char *features[] = { XMLNS_DISCO_INFO,
95
			                           XMLNS_VERSION,
95
			                           XMLNS_VERSION,
96
			                           XMLNS_TIME,
96
			                           XMLNS_TIME,
97
			                           XMLNS_CHATSTATES,
97
			                           XMLNS_CHATSTATES,
98
			                           XMLNS_MUC,
98
			                           XMLNS_MUC,
99
			                           XMLNS_PING,
99
			                           XMLNS_PING,
100
						   XMLNS_SI,
101
						   XMLNS_BYTESTREAMS,
102
						   XMLNS_FILETRANSFER,
100
			                           NULL };
103
			                           NULL };
101
			const char **f;
104
			const char **f;
102
			
105
			
Lines 116-139 Link Here
116
		else
119
		else
117
		{
120
		{
118
			xt_free_node( reply );
121
			xt_free_node( reply );
119
			reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" );
122
			reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel", NULL );
120
			pack = 0;
123
			pack = 0;
121
		}
124
		}
122
	}
125
	}
123
	else if( strcmp( type, "set" ) == 0 )
126
	else if( strcmp( type, "set" ) == 0 )
124
	{
127
	{
125
		if( !( c = xt_find_node( node->children, "query" ) ) ||
128
		if(  ( c = xt_find_node( node->children, "si" ) ) &&
129
		     ( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_SI ) == 0 ) )
130
		{
131
			return jabber_si_handle_request( ic, node, c );
132
		} else if( !( c = xt_find_node( node->children, "query" ) ) ||
126
		    !( s = xt_find_attr( c, "xmlns" ) ) )
133
		    !( s = xt_find_attr( c, "xmlns" ) ) )
127
		{
134
		{
128
			imcb_log( ic, "Warning: Received incomplete IQ-%s packet", type );
135
			imcb_log( ic, "Warning: Received incomplete IQ-%s packet", type );
129
			return XT_HANDLED;
136
			return XT_HANDLED;
130
		}
137
		} else if( strcmp( s, XMLNS_ROSTER ) == 0 )
131
		
138
		{
132
		/* This is a roster push. XMPP servers send this when someone
139
		/* This is a roster push. XMPP servers send this when someone
133
		   was added to (or removed from) the buddy list. AFAIK they're
140
		   was added to (or removed from) the buddy list. AFAIK they're
134
		   sent even if we added this buddy in our own session. */
141
		   sent even if we added this buddy in our own session. */
135
		if( strcmp( s, XMLNS_ROSTER ) == 0 )
136
		{
137
			int bare_len = strlen( ic->acc->user );
142
			int bare_len = strlen( ic->acc->user );
138
			
143
			
139
			if( ( s = xt_find_attr( node, "from" ) ) == NULL ||
144
			if( ( s = xt_find_attr( node, "from" ) ) == NULL ||
Lines 150-163 Link Here
150
				imcb_log( ic, "Warning: %s tried to fake a roster push!", s ? s : "(unknown)" );
155
				imcb_log( ic, "Warning: %s tried to fake a roster push!", s ? s : "(unknown)" );
151
				
156
				
152
				xt_free_node( reply );
157
				xt_free_node( reply );
153
				reply = jabber_make_error_packet( node, "not-allowed", "cancel" );
158
				reply = jabber_make_error_packet( node, "not-allowed", "cancel", NULL );
154
				pack = 0;
159
				pack = 0;
155
			}
160
			}
156
		}
161
		} else if( strcmp( s, XMLNS_BYTESTREAMS ) == 0 )
157
		else
162
		{
163
		     	/* Bytestream Request (stage 2 of file transfer) */
164
			return jabber_bs_recv_request( ic, node, c );
165
		} else
158
		{
166
		{
159
			xt_free_node( reply );
167
			xt_free_node( reply );
160
			reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" );
168
			reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel", NULL );
161
			pack = 0;
169
			pack = 0;
162
		}
170
		}
163
	}
171
	}
Lines 592-594 Link Here
592
	xt_free_node( node );
600
	xt_free_node( node );
593
	return st;
601
	return st;
594
}
602
}
603
604
xt_status jabber_iq_parse_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
605
606
xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid )
607
{
608
	struct xt_node *node, *query;
609
	struct jabber_buddy *bud;
610
	
611
	if( ( bud = jabber_buddy_by_jid( ic, bare_jid , 0 ) ) == NULL )
612
	{
613
		/* Who cares about the unknown... */
614
		imcb_log( ic, "Couldnt find the man: %s", bare_jid);
615
		return 0;
616
	}
617
	
618
	if( bud->features ) /* been here already */
619
		return XT_HANDLED;
620
	
621
	node = xt_new_node( "query", NULL, NULL );
622
	xt_add_attr( node, "xmlns", XMLNS_DISCO_INFO );
623
	
624
	if( !( query = jabber_make_packet( "iq", "get", bare_jid, node ) ) )
625
	{
626
		imcb_log( ic, "WARNING: Couldn't generate feature query" );
627
		xt_free_node( node );
628
	}
629
630
	jabber_cache_add( ic, query, jabber_iq_parse_features );
631
632
	return jabber_write_packet( ic, query );
633
}
634
635
xt_status jabber_iq_parse_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
636
{
637
	struct xt_node *c;
638
	struct jabber_buddy *bud;
639
	char *feature;
640
641
	if( !( c = xt_find_node( node->children, "query" ) ) ||
642
	    !( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_DISCO_INFO ) == 0 ) )
643
	{
644
		imcb_log( ic, "WARNING: Received incomplete IQ-result packet for discover" );
645
		return XT_HANDLED;
646
	}
647
	if( ( bud = jabber_buddy_by_jid( ic, xt_find_attr( node, "from") , 0 ) ) == NULL )
648
	{
649
		/* Who cares about the unknown... */
650
		imcb_log( ic, "Couldnt find the man: %s", xt_find_attr( node, "from"));
651
		return 0;
652
	}
653
	
654
	c = c->children;
655
	while( ( c = xt_find_node( c, "feature" ) ) ) {
656
		feature = xt_find_attr( c, "var" );
657
		bud->features = g_slist_append(bud->features, g_strdup(feature) );
658
		c = c->next;
659
	}
660
661
	return XT_HANDLED;
662
}
663
664
xt_status jabber_iq_parse_server_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
665
666
xt_status jabber_iq_query_server( struct im_connection *ic, char *jid, char *xmlns )
667
{
668
	struct xt_node *node, *query;
669
	struct jabber_data *jd = ic->proto_data;
670
	
671
	node = xt_new_node( "query", NULL, NULL );
672
	xt_add_attr( node, "xmlns", xmlns );
673
	
674
	if( !( query = jabber_make_packet( "iq", "get", jid, node ) ) )
675
	{
676
		imcb_log( ic, "WARNING: Couldn't generate server query" );
677
		xt_free_node( node );
678
	}
679
680
	jd->have_streamhosts--;
681
	jabber_cache_add( ic, query, jabber_iq_parse_server_features );
682
683
	return jabber_write_packet( ic, query );
684
}
685
686
/*
687
 * Query the server for "items", query each "item" for identities, query each "item" that's a proxy for it's bytestream info
688
 */
689
xt_status jabber_iq_parse_server_features( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
690
{
691
	struct xt_node *c;
692
	struct jabber_data *jd = ic->proto_data;
693
694
	if( !( c = xt_find_node( node->children, "query" ) ) ||
695
	    !xt_find_attr( node, "from" ) )
696
	{
697
		imcb_log( ic, "WARNING: Received incomplete IQ-result packet for discover" );
698
		return XT_HANDLED;
699
	}
700
701
	jd->have_streamhosts++;
702
703
	if( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_DISCO_ITEMS ) == 0 )
704
	{
705
		char *item, *itemjid;
706
707
		/* answer from server */
708
	
709
		c = c->children;
710
		while( ( c = xt_find_node( c, "item" ) ) )
711
		{
712
			item = xt_find_attr( c, "name" );
713
			itemjid = xt_find_attr( c, "jid" );
714
715
			jabber_iq_query_server( ic, itemjid, XMLNS_DISCO_INFO );
716
717
			c = c->next;
718
		}
719
	} else if( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_DISCO_INFO ) == 0 )
720
	{
721
		char *category, *type;
722
723
		/* answer from potential proxy */
724
725
		c = c->children;
726
		while( ( c = xt_find_node( c, "identity" ) ) )
727
		{
728
			category = xt_find_attr( c, "category" );
729
			type = xt_find_attr( c, "type" );
730
731
			if( type && ( strcmp( type, "bytestreams" ) == 0 ) &&
732
			    category && ( strcmp( category, "proxy" ) == 0 ) )
733
				jabber_iq_query_server( ic, xt_find_attr( node, "from" ), XMLNS_BYTESTREAMS );
734
735
			c = c->next;
736
		}
737
	} else if( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_BYTESTREAMS ) == 0 )
738
	{
739
		char *host, *jid;
740
		int port;
741
742
		/* answer from proxy */
743
744
		if( ( c = xt_find_node( c->children, "streamhost" ) ) &&
745
		    ( host = xt_find_attr( c, "host" ) ) &&
746
		    ( port = atoi( xt_find_attr( c, "port" ) ) ) &&
747
		    ( jid = xt_find_attr( c, "jid" ) ) )
748
		{
749
			jabber_streamhost_t *sh = g_new0( jabber_streamhost_t, 1 );
750
			sh->jid = g_strdup( jid );
751
			sh->host = g_strdup( host );
752
			sprintf( sh->port, "%u", port );
753
754
			imcb_log( ic, "Proxy found: jid %s host %s port %u", jid, host, port );
755
			jd->streamhosts = g_slist_append( jd->streamhosts, sh );
756
		}
757
	}
758
759
	if( jd->have_streamhosts == 0 )
760
		jd->have_streamhosts++;
761
	return XT_HANDLED;
762
}
(-)bitlbee-1.2/protocols/jabber/jabber.c (+1 lines)
Lines 529-534 Link Here
529
	ret->keepalive = jabber_keepalive;
529
	ret->keepalive = jabber_keepalive;
530
	ret->send_typing = jabber_send_typing;
530
	ret->send_typing = jabber_send_typing;
531
	ret->handle_cmp = g_strcasecmp;
531
	ret->handle_cmp = g_strcasecmp;
532
	ret->transfer_request = jabber_si_transfer_request;
532
533
533
	register_protocol( ret );
534
	register_protocol( ret );
534
}
535
}
(-)bitlbee-1.2/protocols/jabber/jabber.h (-12 / +68 lines)
Lines 58-63 Link Here
58
	                                   have a real JID. */
58
	                                   have a real JID. */
59
} jabber_buddy_flags_t;
59
} jabber_buddy_flags_t;
60
60
61
/* Stores a streamhost's(a.k.a. proxy) data */
62
typedef struct
63
{
64
	char *jid;
65
	char *host;
66
	char port[6];
67
} jabber_streamhost_t;
68
61
typedef enum
69
typedef enum
62
{
70
{
63
	JCFLAG_MESSAGE_SENT = 1,        /* Set this after sending the first message, so
71
	JCFLAG_MESSAGE_SENT = 1,        /* Set this after sending the first message, so
Lines 88-93 Link Here
88
	char *cached_id_prefix;
96
	char *cached_id_prefix;
89
	GHashTable *node_cache;
97
	GHashTable *node_cache;
90
	GHashTable *buddies;
98
	GHashTable *buddies;
99
100
	GSList *filetransfers;
101
	GSList *streamhosts;
102
	int have_streamhosts;
91
};
103
};
92
104
93
struct jabber_away_state
105
struct jabber_away_state
Lines 117-122 Link Here
117
	int priority;
129
	int priority;
118
	struct jabber_away_state *away_state;
130
	struct jabber_away_state *away_state;
119
	char *away_message;
131
	char *away_message;
132
	GSList *features;
120
	
133
	
121
	time_t last_act;
134
	time_t last_act;
122
	jabber_buddy_flags_t flags;
135
	jabber_buddy_flags_t flags;
Lines 132-137 Link Here
132
	struct jabber_buddy *me;
145
	struct jabber_buddy *me;
133
};
146
};
134
147
148
struct jabber_transfer
149
{
150
	/* bitlbee's handle for this transfer */
151
	file_transfer_t *ft;
152
153
	/* the stream's private handle */
154
	gpointer streamhandle;
155
156
	struct im_connection *ic;
157
158
	int watch_in;
159
	int watch_out;
160
161
	char *ini_jid;
162
	char *tgt_jid;
163
	char *iq_id;
164
	char *sid;
165
	int accepted;
166
167
	size_t bytesread, byteswritten;
168
	int fd;
169
	struct sockaddr_storage saddr;
170
};
171
135
#define JABBER_XMLCONSOLE_HANDLE "xmlconsole"
172
#define JABBER_XMLCONSOLE_HANDLE "xmlconsole"
136
173
137
#define JABBER_PORT_DEFAULT "5222"
174
#define JABBER_PORT_DEFAULT "5222"
Lines 161-177 Link Here
161
#define XMLNS_ROSTER       "jabber:iq:roster"
198
#define XMLNS_ROSTER       "jabber:iq:roster"
162
199
163
/* Some supported extensions/legacy stuff */
200
/* Some supported extensions/legacy stuff */
164
#define XMLNS_AUTH         "jabber:iq:auth"                     /* XEP-0078 */
201
#define XMLNS_AUTH         "jabber:iq:auth"                                      /* XEP-0078 */
165
#define XMLNS_VERSION      "jabber:iq:version"                  /* XEP-0092 */
202
#define XMLNS_VERSION      "jabber:iq:version"                                   /* XEP-0092 */
166
#define XMLNS_TIME         "jabber:iq:time"                     /* XEP-0090 */
203
#define XMLNS_TIME         "jabber:iq:time"                                      /* XEP-0090 */
167
#define XMLNS_PING         "urn:xmpp:ping"                      /* XEP-0199 */
204
#define XMLNS_PING         "urn:xmpp:ping"                                       /* XEP-0199 */
168
#define XMLNS_VCARD        "vcard-temp"                         /* XEP-0054 */
205
#define XMLNS_VCARD        "vcard-temp"                                          /* XEP-0054 */
169
#define XMLNS_DELAY        "jabber:x:delay"                     /* XEP-0091 */
206
#define XMLNS_DELAY        "jabber:x:delay"                                      /* XEP-0091 */
170
#define XMLNS_CHATSTATES   "http://jabber.org/protocol/chatstates"  /* 0085 */
207
#define XMLNS_XDATA        "jabber:x:data"                                       /* XEP-0004 */
171
#define XMLNS_DISCOVER     "http://jabber.org/protocol/disco#info"  /* 0030 */
208
#define XMLNS_CHATSTATES   "http://jabber.org/protocol/chatstates"               /* XEP-0085 */
172
#define XMLNS_MUC          "http://jabber.org/protocol/muc"     /* XEP-0045 */
209
#define XMLNS_DISCO_INFO   "http://jabber.org/protocol/disco#info"               /* XEP-0030 */
173
#define XMLNS_MUC_USER     "http://jabber.org/protocol/muc#user"/* XEP-0045 */
210
#define XMLNS_DISCO_ITEMS  "http://jabber.org/protocol/disco#items"              /* XEP-0030 */
174
#define XMLNS_CAPS         "http://jabber.org/protocol/caps"    /* XEP-0115 */
211
#define XMLNS_MUC          "http://jabber.org/protocol/muc"                      /* XEP-0045 */
212
#define XMLNS_MUC_USER     "http://jabber.org/protocol/muc#user"                 /* XEP-0045 */
213
#define XMLNS_CAPS         "http://jabber.org/protocol/caps"                     /* XEP-0115 */
214
#define XMLNS_FEATURE      "http://jabber.org/protocol/feature-neg"              /* XEP-0020 */
215
#define XMLNS_SI           "http://jabber.org/protocol/si"                       /* XEP-0095 */
216
#define XMLNS_FILETRANSFER "http://jabber.org/protocol/si/profile/file-transfer" /* XEP-0096 */
217
#define XMLNS_BYTESTREAMS  "http://jabber.org/protocol/bytestreams"              /* XEP-0065 */
218
#define XMLNS_IBB          "http://jabber.org/protocol/ibb"                      /* XEP-0047 */
175
219
176
/* iq.c */
220
/* iq.c */
177
xt_status jabber_pkt_iq( struct xt_node *node, gpointer data );
221
xt_status jabber_pkt_iq( struct xt_node *node, gpointer data );
Lines 181-186 Link Here
181
int jabber_get_vcard( struct im_connection *ic, char *bare_jid );
225
int jabber_get_vcard( struct im_connection *ic, char *bare_jid );
182
int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name );
226
int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name );
183
int jabber_remove_from_roster( struct im_connection *ic, char *handle );
227
int jabber_remove_from_roster( struct im_connection *ic, char *handle );
228
xt_status jabber_iq_query_features( struct im_connection *ic, char *bare_jid );
229
xt_status jabber_iq_query_server( struct im_connection *ic, char *jid, char *xmlns );
230
231
/* si.c */
232
int jabber_si_handle_request( struct im_connection *ic, struct xt_node *node, struct xt_node *sinode );
233
void jabber_si_transfer_request( struct im_connection *ic, file_transfer_t *ft, char *who );
234
void jabber_si_free_transfer( file_transfer_t *ft);
235
236
/* s5bytestream.c */
237
int jabber_bs_recv_request( struct im_connection *ic, struct xt_node *node, struct xt_node *qnode);
238
gboolean jabber_bs_send_start( struct jabber_transfer *tf );
239
gboolean jabber_bs_send_write( file_transfer_t *ft, char *buffer, unsigned int len );
184
240
185
/* message.c */
241
/* message.c */
186
xt_status jabber_pkt_message( struct xt_node *node, gpointer data );
242
xt_status jabber_pkt_message( struct xt_node *node, gpointer data );
Lines 194-200 Link Here
194
char *set_eval_priority( set_t *set, char *value );
250
char *set_eval_priority( set_t *set, char *value );
195
char *set_eval_tls( set_t *set, char *value );
251
char *set_eval_tls( set_t *set, char *value );
196
struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children );
252
struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children );
197
struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type );
253
struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type, char *err_code );
198
void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func );
254
void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func );
199
struct xt_node *jabber_cache_get( struct im_connection *ic, char *id );
255
struct xt_node *jabber_cache_get( struct im_connection *ic, char *id );
200
void jabber_cache_entry_free( gpointer entry );
256
void jabber_cache_entry_free( gpointer entry );
(-)bitlbee-1.2/protocols/jabber/jabber_util.c (-3 / +18 lines)
Lines 96-102 Link Here
96
	return node;
96
	return node;
97
}
97
}
98
98
99
struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type )
99
struct xt_node *jabber_make_error_packet( struct xt_node *orig, char *err_cond, char *err_type, char *err_code )
100
{
100
{
101
	struct xt_node *node, *c;
101
	struct xt_node *node, *c;
102
	char *to;
102
	char *to;
Lines 109-114 Link Here
109
	c = xt_new_node( "error", NULL, c );
109
	c = xt_new_node( "error", NULL, c );
110
	xt_add_attr( c, "type", err_type );
110
	xt_add_attr( c, "type", err_type );
111
	
111
	
112
	/* Add the error code, if present */
113
	if (err_code)
114
		xt_add_attr( c, "code", err_code );
115
	
112
	/* To make the actual error packet, we copy the original packet and
116
	/* To make the actual error packet, we copy the original packet and
113
	   add our <error>/type="error" tag. Including the original packet
117
	   add our <error>/type="error" tag. Including the original packet
114
	   is recommended, so let's just do it. */
118
	   is recommended, so let's just do it. */
Lines 245-252 Link Here
245
	char *realname;
249
	char *realname;
246
};
250
};
247
251
248
static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla )
252
static void jabber_buddy_ask_yes( void *data )
249
{
253
{
254
	struct jabber_buddy_ask_data *bla = data;
255
	
250
	presence_send_request( bla->ic, bla->handle, "subscribed" );
256
	presence_send_request( bla->ic, bla->handle, "subscribed" );
251
	
257
	
252
	if( imcb_find_buddy( bla->ic, bla->handle ) == NULL )
258
	if( imcb_find_buddy( bla->ic, bla->handle ) == NULL )
Lines 256-263 Link Here
256
	g_free( bla );
262
	g_free( bla );
257
}
263
}
258
264
259
static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla )
265
static void jabber_buddy_ask_no( void *data )
260
{
266
{
267
	struct jabber_buddy_ask_data *bla = data;
268
	
261
	presence_send_request( bla->ic, bla->handle, "subscribed" );
269
	presence_send_request( bla->ic, bla->handle, "subscribed" );
262
	
270
	
263
	g_free( bla->handle );
271
	g_free( bla->handle );
Lines 286-292 Link Here
286
	len = strlen( orig );
294
	len = strlen( orig );
287
	new = g_new( char, len + 1 );
295
	new = g_new( char, len + 1 );
288
	for( i = 0; i < len; i ++ )
296
	for( i = 0; i < len; i ++ )
297
	{
298
		/* don't normalize the resource */
299
		if( orig[i] == '/' )
300
			break;
289
		new[i] = tolower( orig[i] );
301
		new[i] = tolower( orig[i] );
302
	}
303
	for( ; i < len; i ++ )
304
		new[i] = orig[i];
290
	
305
	
291
	new[i] = 0;
306
	new[i] = 0;
292
	return new;
307
	return new;
(-)bitlbee-1.2/protocols/jabber/Makefile (-1 / +1 lines)
Lines 9-15 Link Here
9
-include ../../Makefile.settings
9
-include ../../Makefile.settings
10
10
11
# [SH] Program variables
11
# [SH] Program variables
12
objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o
12
objects = conference.o io.o iq.o jabber.o jabber_util.o message.o presence.o sasl.o si.o s5bytestream.o
13
13
14
CFLAGS += -Wall
14
CFLAGS += -Wall
15
LFLAGS += -r
15
LFLAGS += -r
(-)bitlbee-1.2/protocols/jabber/s5bytestream.c (+1088 lines)
Line 0 Link Here
1
/***************************************************************************\
2
*                                                                           *
3
*  BitlBee - An IRC to IM gateway                                           *
4
*  Jabber module - SOCKS5 Bytestreams ( XEP-0065 )                          *
5
*                                                                           *
6
*  Copyright 2007 Uli Meis <a.sporto+bee@gmail.com>                         *
7
*                                                                           *
8
*  This program is free software; you can redistribute it and/or modify     *
9
*  it under the terms of the GNU General Public License as published by     *
10
*  the Free Software Foundation; either version 2 of the License, or        *
11
*  (at your option) any later version.                                      *
12
*                                                                           *
13
*  This program is distributed in the hope that it will be useful,          *
14
*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
15
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
16
*  GNU General Public License for more details.                             *
17
*                                                                           *
18
*  You should have received a copy of the GNU General Public License along  *
19
*  with this program; if not, write to the Free Software Foundation, Inc.,  *
20
*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.              *
21
*                                                                           *
22
\***************************************************************************/
23
24
#include "jabber.h"
25
#include "sha1.h"
26
#include <poll.h>
27
28
struct bs_transfer {
29
30
	struct jabber_transfer *tf;
31
32
	jabber_streamhost_t *sh;
33
	GSList *streamhosts;
34
35
	enum 
36
	{ 
37
		BS_PHASE_CONNECT, 
38
		BS_PHASE_CONNECTED, 
39
		BS_PHASE_REQUEST, 
40
		BS_PHASE_REPLY
41
	} phase;
42
43
	/* SHA1( SID + Initiator JID + Target JID) */
44
	char *pseudoadr;
45
46
	gint connect_timeout;
47
};
48
49
struct socks5_message
50
{
51
	unsigned char ver;
52
	union
53
	{
54
		unsigned char cmd;
55
		unsigned char rep;
56
	} cmdrep;
57
	unsigned char rsv;
58
	unsigned char atyp;
59
	unsigned char addrlen;
60
	unsigned char address[40];
61
	in_port_t port;
62
} __attribute__ ((packed)); 
63
64
/* connect() timeout in seconds. */
65
#define JABBER_BS_CONTIMEOUT 15
66
/* listen timeout */
67
#define JABBER_BS_LISTEN_TIMEOUT  90
68
69
/* very useful */
70
#define ASSERTSOCKOP(op, msg) \
71
	if( (op) == -1 ) \
72
		return jabber_bs_abort( bt , msg ": %s", strerror( errno ) );
73
74
gboolean jabber_bs_abort( struct bs_transfer *bt, char *format, ... );
75
void jabber_bs_canceled( file_transfer_t *ft , char *reason );
76
void jabber_bs_free_transfer( file_transfer_t *ft );
77
gboolean jabber_bs_connect_timeout( gpointer data, gint fd, b_input_condition cond );
78
gboolean jabber_bs_poll( struct bs_transfer *bt, int fd, short *revents );
79
gboolean jabber_bs_peek( struct bs_transfer *bt, void *buffer, int buflen );
80
81
void jabber_bs_recv_answer_request( struct bs_transfer *bt );
82
gboolean jabber_bs_recv_read( gpointer data, gint fd, b_input_condition cond );
83
gboolean jabber_bs_recv_write_request( file_transfer_t *ft );
84
gboolean jabber_bs_recv_handshake( gpointer data, gint fd, b_input_condition cond );
85
gboolean jabber_bs_recv_handshake_abort( struct bs_transfer *bt, char *error );
86
int jabber_bs_recv_request( struct im_connection *ic, struct xt_node *node, struct xt_node *qnode );
87
88
gboolean jabber_bs_send_handshake_abort( struct bs_transfer *bt, char *error );
89
gboolean jabber_bs_send_request( struct jabber_transfer *tf, GSList *streamhosts );
90
gboolean jabber_bs_send_handshake( gpointer data, gint fd, b_input_condition cond );
91
gboolean jabber_bs_send_listen( struct bs_transfer *bt, struct sockaddr_storage *saddr, char *host, char *port );
92
static xt_status jabber_bs_send_handle_activate( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
93
void jabber_bs_send_activate( struct bs_transfer *bt );
94
95
/*
96
 * Frees a bs_transfer struct and calls the SI free function
97
 */
98
void jabber_bs_free_transfer( file_transfer_t *ft) {
99
	struct jabber_transfer *tf = ft->data;
100
	struct bs_transfer *bt = tf->streamhandle;
101
	jabber_streamhost_t *sh;
102
103
	if ( bt->connect_timeout )
104
	{
105
		b_event_remove( bt->connect_timeout );
106
		bt->connect_timeout = 0;
107
	}
108
109
	if ( tf->watch_in )
110
		b_event_remove( tf->watch_in );
111
	
112
	if( tf->watch_out )
113
		b_event_remove( tf->watch_out );
114
	
115
	g_free( bt->pseudoadr );
116
117
	while( bt->streamhosts )
118
	{
119
		sh = bt->streamhosts->data;
120
		bt->streamhosts = g_slist_remove( bt->streamhosts, sh );
121
		g_free( sh->jid );
122
		g_free( sh->host );
123
		g_free( sh );
124
	}
125
	
126
	g_free( bt );
127
128
	jabber_si_free_transfer( ft );
129
}
130
131
/*
132
 * Checks if buflen data is available on the socket and
133
 * writes it to buffer if that's the case.
134
 */
135
gboolean jabber_bs_peek( struct bs_transfer *bt, void *buffer, int buflen )
136
{
137
	int ret;
138
	int fd = bt->tf->fd;
139
140
	ASSERTSOCKOP( ret = recv( fd, buffer, buflen, MSG_PEEK ), "MSG_PEEK'ing" );
141
142
	if( ret == 0 )
143
		return jabber_bs_abort( bt, "Remote end closed connection" );
144
		
145
	if( ret < buflen )
146
		return ret;
147
148
	ASSERTSOCKOP( ret = recv( fd, buffer, buflen, 0 ), "Dequeuing after MSG_PEEK" );
149
150
	if( ret != buflen )
151
		return jabber_bs_abort( bt, "recv returned less than previous recv with MSG_PEEK" );
152
	
153
	return ret;
154
}
155
156
157
/* 
158
 * This function is scheduled in bs_handshake via b_timeout_add after a (non-blocking) connect().
159
 */
160
gboolean jabber_bs_connect_timeout( gpointer data, gint fd, b_input_condition cond )
161
{
162
	struct bs_transfer *bt = data;
163
164
	bt->connect_timeout = 0;
165
166
	jabber_bs_abort( bt, "no connection after %d seconds", bt->tf->ft->sending ? JABBER_BS_LISTEN_TIMEOUT : JABBER_BS_CONTIMEOUT );
167
168
	return FALSE;
169
}
170
171
/* 
172
 * Polls the socket, checks for errors and removes a connect timer
173
 * if there is one.
174
 */
175
gboolean jabber_bs_poll( struct bs_transfer *bt, int fd, short *revents )
176
{
177
	struct pollfd pfd = { .fd = fd, .events = POLLHUP|POLLERR };
178
	
179
	if ( bt->connect_timeout )
180
	{
181
		b_event_remove( bt->connect_timeout );
182
		bt->connect_timeout = 0;
183
	}
184
185
	ASSERTSOCKOP( poll( &pfd, 1, 0 ), "poll()" )
186
187
	if( pfd.revents & POLLERR )
188
	{
189
		int sockerror;
190
		socklen_t errlen = sizeof( sockerror );
191
192
		if ( getsockopt( fd, SOL_SOCKET, SO_ERROR, &sockerror, &errlen ) )
193
			return jabber_bs_abort( bt, "getsockopt() failed, unknown socket error during SOCKS5 handshake (weird!)" );
194
195
		if ( bt->phase == BS_PHASE_CONNECTED )
196
			return jabber_bs_abort( bt, "connect failed: %s", strerror( sockerror ) );
197
198
		return jabber_bs_abort( bt, "Socket error during SOCKS5 handshake(weird!): %s", strerror( sockerror ) );
199
	}
200
201
	if( pfd.revents & POLLHUP )
202
		return jabber_bs_abort( bt, "Remote end closed connection" );
203
	
204
	*revents = pfd.revents;
205
	
206
	return TRUE;
207
}
208
209
/*
210
 * Used for receive and send path.
211
 */
212
gboolean jabber_bs_abort( struct bs_transfer *bt, char *format, ... )
213
{
214
	va_list params;
215
	va_start( params, format );
216
	char error[128];
217
218
	if( vsnprintf( error, 128, format, params ) < 0 )
219
		sprintf( error, "internal error parsing error string (BUG)" );
220
	va_end( params );
221
	if( bt->tf->ft->sending )
222
		return jabber_bs_send_handshake_abort( bt, error );
223
	else
224
		return jabber_bs_recv_handshake_abort( bt, error );
225
}
226
227
/* Bad luck */
228
void jabber_bs_canceled( file_transfer_t *ft , char *reason )
229
{
230
	struct jabber_transfer *tf = ft->data;
231
232
	imcb_log( tf->ic, "File transfer aborted: %s", reason );
233
}
234
235
/*
236
 * Parses an incoming bytestream request and calls jabber_bs_handshake on success.
237
 */
238
int jabber_bs_recv_request( struct im_connection *ic, struct xt_node *node, struct xt_node *qnode)
239
{
240
	char *sid, *ini_jid, *tgt_jid, *mode, *iq_id;
241
	struct jabber_data *jd = ic->proto_data;
242
	struct jabber_transfer *tf = NULL;
243
	GSList *tflist;
244
	struct bs_transfer *bt;
245
	GSList *shlist=NULL;
246
	struct xt_node *shnode;
247
248
	sha1_state_t sha;
249
	char hash_hex[41];
250
	unsigned char hash[20];
251
	int i;
252
	
253
	if( !(iq_id   = xt_find_attr( node, "id" ) ) ||
254
	    !(ini_jid = xt_find_attr( node, "from" ) ) ||
255
	    !(tgt_jid = xt_find_attr( node, "to" ) ) ||
256
	    !(sid     = xt_find_attr( qnode, "sid" ) ) )
257
	{
258
		imcb_log( ic, "WARNING: Received incomplete SI bytestream request");
259
		return XT_HANDLED;
260
	}
261
262
	if( ( mode = xt_find_attr( qnode, "mode" ) ) &&
263
	      ( strcmp( mode, "tcp" ) != 0 ) ) 
264
	{
265
		imcb_log( ic, "WARNING: Received SI Request for unsupported bytestream mode %s", xt_find_attr( qnode, "mode" ) );
266
		return XT_HANDLED;
267
	}
268
269
	shnode = qnode->children;
270
	while( ( shnode = xt_find_node( shnode, "streamhost" ) ) )
271
	{
272
		char *jid, *host;
273
		int port;
274
		if( ( jid = xt_find_attr( shnode, "jid" ) ) &&
275
		    ( host = xt_find_attr( shnode, "host" ) ) &&
276
		    ( ( port = atoi( xt_find_attr( shnode, "port" ) ) ) ) )
277
		{
278
			jabber_streamhost_t *sh = g_new0( jabber_streamhost_t, 1 );
279
			sh->jid = g_strdup(jid);
280
			sh->host = g_strdup(host);
281
			sprintf( sh->port, "%u", port );
282
			shlist = g_slist_append( shlist, sh );
283
		}
284
		shnode = shnode->next;
285
	}
286
	
287
	if( !shlist )
288
	{
289
		imcb_log( ic, "WARNING: Received incomplete SI bytestream request, no parseable streamhost entries");
290
		return XT_HANDLED;
291
	}
292
293
	/* Let's see if we can find out what this bytestream should be for... */
294
295
	for( tflist = jd->filetransfers ; tflist; tflist = g_slist_next(tflist) )
296
	{
297
		struct jabber_transfer *tft = tflist->data;
298
		if( ( strcmp( tft->sid, sid ) == 0 ) &&
299
		    ( strcmp( tft->ini_jid, ini_jid ) == 0 ) &&
300
		    ( strcmp( tft->tgt_jid, tgt_jid ) == 0 ) )
301
		{
302
		    	tf = tft;
303
			break;
304
		}
305
	}
306
307
	if (!tf) 
308
	{
309
		imcb_log( ic, "WARNING: Received bytestream request from %s that doesn't match an SI request", ini_jid );
310
		return XT_HANDLED;
311
	}
312
313
	/* iq_id and canceled can be reused since SI is done */
314
	g_free( tf->iq_id );
315
	tf->iq_id = g_strdup( iq_id );
316
317
	tf->ft->canceled = jabber_bs_canceled;
318
319
	/* SHA1( SID + Initiator JID + Target JID ) is given to the streamhost which it will match against the initiator's value */
320
	sha1_init( &sha );
321
	sha1_append( &sha, (unsigned char*) sid, strlen( sid ) );
322
	sha1_append( &sha, (unsigned char*) ini_jid, strlen( ini_jid ) );
323
	sha1_append( &sha, (unsigned char*) tgt_jid, strlen( tgt_jid ) );
324
	sha1_finish( &sha, hash );
325
	
326
	for( i = 0; i < 20; i ++ )
327
		sprintf( hash_hex + i * 2, "%02x", hash[i] );
328
		
329
	bt = g_new0( struct bs_transfer, 1 );
330
	bt->tf = tf;
331
	bt->streamhosts = shlist;
332
	bt->sh = shlist->data;
333
	bt->phase = BS_PHASE_CONNECT;
334
	bt->pseudoadr = g_strdup( hash_hex );
335
	tf->streamhandle = bt;
336
	tf->ft->free = jabber_bs_free_transfer;
337
338
	jabber_bs_recv_handshake( bt, 0, 0 ); 
339
340
	return XT_HANDLED;
341
}
342
343
/*
344
 * This is what a protocol handshake can look like in cooperative multitasking :)
345
 * Might be confusing at first because it's called from different places and is recursing.
346
 * (places being the event thread, bs_request, bs_handshake_abort, and itself)
347
 *
348
 * All in all, it turned out quite nice :)
349
 */
350
gboolean jabber_bs_recv_handshake( gpointer data, gint fd, b_input_condition cond )
351
{
352
353
	struct bs_transfer *bt = data;
354
	short revents;
355
	int gret;
356
357
	if ( ( fd != 0 ) && !jabber_bs_poll( bt, fd, &revents ) )
358
		return FALSE;
359
	
360
	switch( bt->phase ) 
361
	{
362
	case BS_PHASE_CONNECT:
363
		{
364
			struct addrinfo hints, *rp;
365
366
			memset( &hints, 0, sizeof( struct addrinfo ) );
367
			hints.ai_socktype = SOCK_STREAM;
368
369
			if ( ( gret = getaddrinfo( bt->sh->host, bt->sh->port, &hints, &rp ) ) != 0 )
370
				return jabber_bs_abort( bt, "getaddrinfo() failed: %s", gai_strerror( gret ) );
371
372
			ASSERTSOCKOP( bt->tf->fd = fd = socket( rp->ai_family, rp->ai_socktype, 0 ), "Opening socket" );
373
374
			sock_make_nonblocking( fd );
375
376
			imcb_log( bt->tf->ic, "File %s: Connecting to streamhost %s:%s", bt->tf->ft->file_name, bt->sh->host, bt->sh->port );
377
378
			if( ( connect( fd, rp->ai_addr, rp->ai_addrlen ) == -1 ) &&
379
			    ( errno != EINPROGRESS ) )
380
				return jabber_bs_abort( bt , "connect() failed: %s", strerror( errno ) );
381
382
			freeaddrinfo( rp );
383
384
			bt->phase = BS_PHASE_CONNECTED;
385
			
386
			bt->tf->watch_out = b_input_add( fd, GAIM_INPUT_WRITE, jabber_bs_recv_handshake, bt );
387
388
			/* since it takes forever(3mins?) till connect() fails on itself we schedule a timeout */
389
			bt->connect_timeout = b_timeout_add( JABBER_BS_CONTIMEOUT * 1000, jabber_bs_connect_timeout, bt );
390
391
			bt->tf->watch_in = 0;
392
			return FALSE;
393
		}
394
	case BS_PHASE_CONNECTED:
395
		{
396
			struct {
397
				unsigned char ver;
398
				unsigned char nmethods;
399
				unsigned char method;
400
			} socks5_hello = {
401
				.ver = 5,
402
				.nmethods = 1,
403
				.method = 0x00 /* no auth */
404
				/* one could also implement username/password. If you know
405
				 * a jabber client or proxy that actually does it, tell me.
406
				 */
407
			};
408
			
409
			ASSERTSOCKOP( send( fd, &socks5_hello, sizeof( socks5_hello ) , 0 ), "Sending auth request" );
410
411
			bt->phase = BS_PHASE_REQUEST;
412
413
			bt->tf->watch_in = b_input_add( fd, GAIM_INPUT_READ, jabber_bs_recv_handshake, bt );
414
415
			bt->tf->watch_out = 0;
416
			return FALSE;
417
		}
418
	case BS_PHASE_REQUEST:
419
		{
420
			struct socks5_message socks5_connect = 
421
			{
422
				.ver = 5,
423
				.cmdrep.cmd = 0x01,
424
				.rsv = 0,
425
				.atyp = 0x03,
426
				.addrlen = strlen( bt->pseudoadr ),
427
				.port = 0
428
			};
429
			int ret;
430
			char buf[2];
431
432
			/* If someone's trying to be funny and sends only one byte at a time we'll fail :) */
433
			ASSERTSOCKOP( ret = recv( fd, buf, 2, 0 ) , "Receiving auth reply" );
434
435
			if( !( ret == 2 ) ||
436
			    !( buf[0] == 5 ) ||
437
			    !( buf[1] == 0 ) )
438
				return jabber_bs_abort( bt, "Auth not accepted by streamhost (reply: len=%d, ver=%d, status=%d)",
439
									ret, buf[0], buf[1] );
440
441
			/* copy hash into connect message */
442
			memcpy( socks5_connect.address, bt->pseudoadr, socks5_connect.addrlen );
443
444
			ASSERTSOCKOP( send( fd, &socks5_connect, sizeof( struct socks5_message ), 0 ) , "Sending SOCKS5 Connect" );
445
446
			bt->phase = BS_PHASE_REPLY;
447
448
			return TRUE;
449
		}
450
	case BS_PHASE_REPLY:
451
		{
452
			struct socks5_message socks5_reply;
453
			int ret;
454
455
			if ( !( ret = jabber_bs_peek( bt, &socks5_reply, sizeof( struct socks5_message ) ) ) )
456
				return FALSE;
457
458
			if ( ret < sizeof( socks5_reply ) )
459
				return TRUE;
460
461
			if( !( socks5_reply.ver == 5 ) ||
462
			    !( socks5_reply.cmdrep.rep == 0 ) ||
463
			    !( socks5_reply.atyp == 3 ) ||
464
			    !( socks5_reply.addrlen == 40 ) )
465
				return jabber_bs_abort( bt, "SOCKS5 CONNECT failed (reply: ver=%d, rep=%d, atyp=%d, addrlen=%d", 
466
					socks5_reply.ver,
467
					socks5_reply.cmdrep.rep,
468
					socks5_reply.atyp,
469
					socks5_reply.addrlen);
470
471
			if( bt->tf->ft->sending )
472
				jabber_bs_send_activate( bt );
473
			else
474
				jabber_bs_recv_answer_request( bt );
475
476
			return FALSE;
477
		}
478
	default:
479
		/* BUG */
480
		imcb_log( bt->tf->ic, "BUG in file transfer code: undefined handshake phase" );
481
482
		bt->tf->watch_in = 0;
483
		return FALSE;
484
	}
485
}
486
487
/*
488
 * If the handshake failed we can try the next streamhost, if there is one.
489
 * An intelligent sender would probably specify himself as the first streamhost and
490
 * a proxy as the second (Kopete and PSI are examples here). That way, a (potentially) 
491
 * slow proxy is only used if neccessary. This of course also means, that the timeout
492
 * per streamhost should be kept short. If one or two firewalled adresses are specified,
493
 * they have to timeout first before a proxy is tried.
494
 */
495
gboolean jabber_bs_recv_handshake_abort( struct bs_transfer *bt, char *error )
496
{
497
	struct jabber_transfer *tf = bt->tf;
498
	struct xt_node *reply, *iqnode;
499
	GSList *shlist;
500
501
	imcb_log( tf->ic, "Transferring file %s: connection to streamhost %s:%s failed (%s)", 
502
		  tf->ft->file_name, 
503
		  bt->sh->host,
504
		  bt->sh->port,
505
		  error );
506
507
	/* Alright, this streamhost failed, let's try the next... */
508
	bt->phase = BS_PHASE_CONNECT;
509
	shlist = g_slist_find( bt->streamhosts, bt->sh );
510
	if( shlist && shlist->next )
511
	{
512
		bt->sh = shlist->next->data;
513
		return jabber_bs_recv_handshake( bt, 0, 0 );
514
	}
515
516
517
	/* out of stream hosts */
518
519
	iqnode = jabber_make_packet( "iq", "result", tf->ini_jid, NULL );
520
	reply = jabber_make_error_packet( iqnode, "item-not-found", "cancel" , "404" );
521
	xt_free_node( iqnode );
522
523
	xt_add_attr( reply, "id", tf->iq_id );
524
		
525
	if( !jabber_write_packet( tf->ic, reply ) )
526
		imcb_log( tf->ic, "WARNING: Error transmitting bytestream response" );
527
	xt_free_node( reply );
528
529
	imcb_file_canceled( tf->ft, "couldn't connect to any streamhosts" );
530
531
	bt->tf->watch_in = 0;
532
	return FALSE;
533
}
534
535
/* 
536
 * After the SOCKS5 handshake succeeds we need to inform the initiator which streamhost we chose.
537
 * If he is the streamhost himself, he might already know that. However, if it's a proxy,
538
 * the initiator will have to make a connection himself.
539
 */
540
void jabber_bs_recv_answer_request( struct bs_transfer *bt )
541
{
542
	struct jabber_transfer *tf = bt->tf;
543
	struct xt_node *reply;
544
545
	imcb_log( tf->ic, "File %s: established SOCKS5 connection to %s:%s", 
546
		  tf->ft->file_name, 
547
		  bt->sh->host,
548
		  bt->sh->port );
549
550
	tf->ft->data = tf;
551
	tf->watch_in = b_input_add( tf->fd, GAIM_INPUT_READ, jabber_bs_recv_read, bt );
552
	tf->ft->write_request = jabber_bs_recv_write_request;
553
554
	reply = xt_new_node( "streamhost-used", NULL, NULL );
555
	xt_add_attr( reply, "jid", bt->sh->jid );
556
557
	reply = xt_new_node( "query", NULL, reply );
558
	xt_add_attr( reply, "xmlns", XMLNS_BYTESTREAMS );
559
560
	reply = jabber_make_packet( "iq", "result", tf->ini_jid, reply );
561
562
	xt_add_attr( reply, "id", tf->iq_id );
563
		
564
	if( !jabber_write_packet( tf->ic, reply ) )
565
		imcb_file_canceled( tf->ft, "Error transmitting bytestream response" );
566
	xt_free_node( reply );
567
}
568
569
/* 
570
 * This function is called from write_request directly. If no data is available, it will install itself
571
 * as a watcher for input on fd and once that happens, deliver the data and unschedule itself again.
572
 */
573
gboolean jabber_bs_recv_read( gpointer data, gint fd, b_input_condition cond )
574
{
575
	int ret;
576
	struct bs_transfer *bt = data;
577
	struct jabber_transfer *tf = bt->tf;
578
579
	if( fd != 0 ) /* called via event thread */
580
	{
581
		tf->watch_in = 0;
582
		ASSERTSOCKOP( ret = recv( fd, tf->ft->buffer, sizeof( tf->ft->buffer ), 0 ) , "Receiving" );
583
	}
584
	else
585
	{
586
		/* called directly. There might not be any data available. */
587
		if( ( ( ret = recv( tf->fd, tf->ft->buffer, sizeof( tf->ft->buffer ), 0 ) ) == -1 ) &&
588
		    ( errno != EAGAIN ) )
589
		    return jabber_bs_abort( bt, "Receiving: %s", strerror( errno ) );
590
591
		if( ( ret == -1 ) && ( errno == EAGAIN ) )
592
		{
593
			tf->watch_in = b_input_add( tf->fd, GAIM_INPUT_READ, jabber_bs_recv_read, bt );
594
			return FALSE;
595
		}
596
	}
597
598
	/* shouldn't happen since we know the file size */
599
	if( ret == 0 )
600
		return jabber_bs_abort( bt, "Remote end closed connection" );
601
	
602
	if( tf->bytesread == 0 )
603
		tf->ft->started = time( NULL );
604
605
	tf->bytesread += ret;
606
607
	tf->ft->write( tf->ft, tf->ft->buffer, ret );	
608
609
	return FALSE;
610
}
611
612
/* 
613
 * imc callback that is invoked when it is ready to receive some data.
614
 */
615
gboolean jabber_bs_recv_write_request( file_transfer_t *ft )
616
{
617
	struct jabber_transfer *tf = ft->data;
618
619
	if( tf->watch_in )
620
	{
621
		imcb_file_canceled( ft, "BUG in jabber file transfer: write_request called when already watching for input" );
622
		return FALSE;
623
	}
624
	
625
	jabber_bs_recv_read( tf->streamhandle, 0 , 0 );
626
627
	return TRUE;
628
}
629
630
/* 
631
 * Issues a write_request to imc.
632
 * */
633
gboolean jabber_bs_send_can_write( gpointer data, gint fd, b_input_condition cond )
634
{
635
	struct bs_transfer *bt = data;
636
637
	bt->tf->watch_out = 0;
638
639
	bt->tf->ft->write_request( bt->tf->ft );
640
641
	return FALSE;
642
}
643
644
/*
645
 * This should only be called if we can write, so just do it.
646
 * Add a write watch so we can write more during the next cycle (if possible).
647
 */
648
gboolean jabber_bs_send_write( file_transfer_t *ft, char *buffer, unsigned int len )
649
{
650
	struct jabber_transfer *tf = ft->data;
651
	struct bs_transfer *bt = tf->streamhandle;
652
	int ret;
653
654
	if( tf->watch_out )
655
		return jabber_bs_abort( bt, "BUG: write() called while watching " );
656
	
657
	/* TODO: catch broken pipe */
658
	ASSERTSOCKOP( ret = send( tf->fd, buffer, len, 0 ), "Sending" );
659
660
	if( tf->byteswritten == 0 )
661
		tf->ft->started = time( NULL );
662
663
	tf->byteswritten += ret;
664
	
665
	/* TODO: this should really not be fatal */
666
	if( ret < len )
667
		return jabber_bs_abort( bt, "send() sent %d instead of %d (send buffer too big!)", ret, len );
668
669
	bt->tf->watch_out = b_input_add( tf->fd, GAIM_INPUT_WRITE, jabber_bs_send_can_write, bt );
670
		
671
	return TRUE;
672
}
673
674
/*
675
 * Handles the reply by the receiver containing the used streamhost.
676
 */
677
static xt_status jabber_bs_send_handle_reply(struct im_connection *ic, struct xt_node *node, struct xt_node *orig ) {
678
	struct jabber_transfer *tf = NULL;
679
	struct jabber_data *jd = ic->proto_data;
680
	struct bs_transfer *bt;
681
	GSList *tflist;
682
	struct xt_node *c;
683
	char *sid, *jid;
684
685
	if( !( c = xt_find_node( node->children, "query" ) ) ||
686
	    !( c = xt_find_node( c->children, "streamhost-used" ) ) ||
687
	    !( jid = xt_find_attr( c, "jid" ) ) )
688
689
	{
690
		imcb_log( ic, "WARNING: Received incomplete bytestream reply" );
691
		return XT_HANDLED;
692
	}
693
	
694
	if( !( c = xt_find_node( orig->children, "query" ) ) ||
695
	    !( sid = xt_find_attr( c, "sid" ) ) )
696
	{
697
		imcb_log( ic, "WARNING: Error parsing request corresponding to the incoming bytestream reply" );
698
		return XT_HANDLED;
699
	}
700
701
	/* Let's see if we can find out what this bytestream should be for... */
702
703
	for( tflist = jd->filetransfers ; tflist; tflist = g_slist_next(tflist) )
704
	{
705
		struct jabber_transfer *tft = tflist->data;
706
		if( ( strcmp( tft->sid, sid ) == 0 ) )
707
		{
708
		    	tf = tft;
709
			break;
710
		}
711
	}
712
713
	if( !tf )
714
	{
715
		imcb_log( ic, "WARNING: Received SOCKS5 bytestream reply to unknown request" );
716
		return XT_HANDLED;
717
	}
718
719
	bt = tf->streamhandle;
720
721
	tf->accepted = TRUE;
722
723
	if( strcmp( jid, tf->ini_jid ) == 0 )
724
	{
725
		/* we're streamhost and target */
726
		if( bt->phase == BS_PHASE_REPLY )
727
		{
728
			/* handshake went through, let's start transferring */
729
			tf->ft->write_request( tf->ft );
730
		}
731
	} else
732
	{
733
		/* using a proxy, abort listen */
734
735
		closesocket( tf->fd );
736
		tf->fd = 0;
737
738
		if ( bt->connect_timeout )
739
		{
740
			b_event_remove( bt->connect_timeout );
741
			bt->connect_timeout = 0;
742
		}
743
744
		GSList *shlist;
745
		for( shlist = jd->streamhosts ; shlist ; shlist = g_slist_next( shlist ) )
746
		{
747
			jabber_streamhost_t *sh = shlist->data;
748
			if( strcmp( sh->jid, jid ) == 0 )
749
			{
750
				bt->sh = sh;
751
				jabber_bs_recv_handshake( bt, 0, 0 );
752
				return XT_HANDLED;
753
			}
754
		}
755
756
		imcb_log( ic, "WARNING: Received SOCKS5 bytestream reply with unknown streamhost %s", jid );
757
	}
758
759
	return XT_HANDLED;
760
}
761
762
/* 
763
 * Tell the proxy to activate the stream. Looks like this:
764
 *
765
 * <iq type=set>
766
 * 	<query xmlns=bs sid=sid>
767
 * 		<activate>tgt_jid</activate>
768
 * 	</query>
769
 * </iq>
770
 */
771
void jabber_bs_send_activate( struct bs_transfer *bt )
772
{
773
	struct xt_node *node;
774
775
	node = xt_new_node( "activate", bt->tf->tgt_jid, NULL );
776
	node = xt_new_node( "query", NULL, node );
777
	xt_add_attr( node, "xmlns", XMLNS_BYTESTREAMS );
778
	xt_add_attr( node, "sid", bt->tf->sid );
779
	node = jabber_make_packet( "iq", "set", bt->sh->jid, node );
780
781
	jabber_cache_add( bt->tf->ic, node, jabber_bs_send_handle_activate );
782
783
	jabber_write_packet( bt->tf->ic, node );
784
}
785
786
/*
787
 * The proxy has activated the bytestream.
788
 * We can finally start pushing some data out.
789
 */
790
static xt_status jabber_bs_send_handle_activate( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
791
{
792
	char *sid;
793
	GSList *tflist;
794
	struct jabber_transfer *tf;
795
	struct xt_node *query;
796
	struct jabber_data *jd = ic->proto_data;
797
798
	query = xt_find_node( orig->children, "query" );
799
	sid = xt_find_attr( query, "sid" );
800
801
	for( tflist = jd->filetransfers ; tflist; tflist = g_slist_next(tflist) )
802
	{
803
		struct jabber_transfer *tft = tflist->data;
804
		if( ( strcmp( tft->sid, sid ) == 0 ) )
805
		{
806
		    	tf = tft;
807
			break;
808
		}
809
	}
810
811
	if( !tf )
812
	{
813
		imcb_log( ic, "WARNING: Received SOCKS5 bytestream activation for unknown stream" );
814
		return XT_HANDLED;
815
	}
816
817
	/* handshake went through, let's start transferring */
818
	tf->ft->write_request( tf->ft );
819
820
	return XT_HANDLED;
821
}
822
823
/*
824
 * Starts a bytestream.
825
 */
826
gboolean jabber_bs_send_start( struct jabber_transfer *tf )
827
{
828
	char host[INET6_ADDRSTRLEN];
829
	struct bs_transfer *bt;
830
	sha1_state_t sha;
831
	char hash_hex[41];
832
	unsigned char hash[20];
833
	int i,ret;
834
	struct jabber_data *jd = tf->ic->proto_data;
835
	jabber_streamhost_t sh;
836
	GSList *streamhosts = jd->streamhosts;
837
838
	/* SHA1( SID + Initiator JID + Target JID ) is given to the streamhost which it will match against the initiator's value */
839
	sha1_init( &sha );
840
	sha1_append( &sha, (unsigned char*) tf->sid, strlen( tf->sid ) );
841
	sha1_append( &sha, (unsigned char*) tf->ini_jid, strlen( tf->ini_jid ) );
842
	sha1_append( &sha, (unsigned char*) tf->tgt_jid, strlen( tf->tgt_jid ) );
843
	sha1_finish( &sha, hash );
844
	
845
	for( i = 0; i < 20; i ++ )
846
		sprintf( hash_hex + i * 2, "%02x", hash[i] );
847
		
848
	bt = g_new0( struct bs_transfer, 1 );
849
	bt->tf = tf;
850
	bt->phase = BS_PHASE_CONNECT;
851
	bt->pseudoadr = g_strdup( hash_hex );
852
	tf->streamhandle = bt;
853
	tf->ft->free = jabber_bs_free_transfer;
854
	tf->ft->canceled = jabber_bs_canceled;
855
856
	if ( !jabber_bs_send_listen( bt, &tf->saddr, sh.host = host, sh.port ) )
857
		return FALSE;
858
859
	bt->tf->watch_in = b_input_add( tf->fd, GAIM_INPUT_READ, jabber_bs_send_handshake, bt );
860
	bt->connect_timeout = b_timeout_add( JABBER_BS_LISTEN_TIMEOUT * 1000, jabber_bs_connect_timeout, bt );
861
862
	sh.jid = tf->ini_jid;
863
864
	/* temporarily add listen address to streamhosts, send the request and remove it */
865
	streamhosts = g_slist_prepend( streamhosts, &sh );
866
	ret = jabber_bs_send_request( tf, streamhosts);
867
	streamhosts = g_slist_remove( streamhosts, &sh );
868
869
	return ret;
870
}
871
872
gboolean jabber_bs_send_request( struct jabber_transfer *tf, GSList *streamhosts )
873
{
874
	struct xt_node *shnode, *query, *iq;
875
876
	query = xt_new_node( "query", NULL, NULL );
877
	xt_add_attr( query, "xmlns", XMLNS_BYTESTREAMS );
878
	xt_add_attr( query, "sid", tf->sid );
879
	xt_add_attr( query, "mode", "tcp" );
880
881
	while( streamhosts ) {
882
		jabber_streamhost_t *sh = streamhosts->data;
883
		shnode = xt_new_node( "streamhost", NULL, NULL );
884
		xt_add_attr( shnode, "jid", sh->jid );
885
		xt_add_attr( shnode, "host", sh->host );
886
		xt_add_attr( shnode, "port", sh->port );
887
888
		xt_add_child( query, shnode );
889
890
		streamhosts = g_slist_next( streamhosts );
891
	}
892
893
894
	iq = jabber_make_packet( "iq", "set", tf->tgt_jid, query );
895
	xt_add_attr( iq, "from", tf->ini_jid );
896
897
	jabber_cache_add( tf->ic, iq, jabber_bs_send_handle_reply );
898
899
	if( !jabber_write_packet( tf->ic, iq ) )
900
		imcb_file_canceled( tf->ft, "Error transmitting bytestream request" );
901
	return TRUE;
902
}
903
904
gboolean jabber_bs_send_handshake_abort(struct bs_transfer *bt, char *error )
905
{
906
	struct jabber_transfer *tf = bt->tf;
907
	struct jabber_data *jd = tf->ic->proto_data;
908
909
	/* TODO: did the receiver get here somehow??? */
910
	imcb_log( tf->ic, "Transferring file %s: SOCKS5 handshake failed: %s", 
911
		  tf->ft->file_name, 
912
		  error );
913
914
	if( jd->streamhosts==NULL ) /* we're done here unless we have a proxy to try */
915
		imcb_file_canceled( tf->ft, error );
916
917
	return FALSE;
918
}
919
920
/*
921
 * Creates a listening socket and returns it in saddr_ptr.
922
 */
923
gboolean jabber_bs_send_listen( struct bs_transfer *bt, struct sockaddr_storage *saddr, char *host, char *port )
924
{
925
	struct jabber_transfer *tf = bt->tf;
926
	int fd,gret;
927
	char hostname[ HOST_NAME_MAX + 1 ];
928
	struct addrinfo hints, *rp;
929
	socklen_t ssize = sizeof( struct sockaddr_storage );
930
931
	/* won't be long till someone asks for this to be configurable :) */
932
933
	ASSERTSOCKOP( gethostname( hostname, sizeof( hostname ) ), "gethostname()" );
934
935
	memset( &hints, 0, sizeof( struct addrinfo ) );
936
	hints.ai_socktype = SOCK_STREAM;
937
	hints.ai_flags = AI_NUMERICSERV;
938
939
	if ( ( gret = getaddrinfo( hostname, "0", &hints, &rp ) ) != 0 )
940
		return jabber_bs_abort( bt, "getaddrinfo() failed: %s", gai_strerror( gret ) );
941
942
	memcpy( saddr, rp->ai_addr, rp->ai_addrlen );
943
944
	ASSERTSOCKOP( fd = tf->fd = socket( saddr->ss_family, SOCK_STREAM, 0 ), "Opening socket" );
945
946
	ASSERTSOCKOP( bind( fd, ( struct sockaddr *)saddr, rp->ai_addrlen ), "Binding socket" );
947
	
948
	freeaddrinfo( rp );
949
950
	ASSERTSOCKOP( listen( fd, 1 ), "Making socket listen" );
951
952
	if ( !inet_ntop( saddr->ss_family, saddr->ss_family == AF_INET ?
953
			( void * )&( ( struct sockaddr_in * ) saddr )->sin_addr.s_addr : ( void * )&( ( struct sockaddr_in6 * ) saddr )->sin6_addr.s6_addr
954
			, host, INET6_ADDRSTRLEN ) )
955
		return jabber_bs_abort( bt, "inet_ntop failed on listening socket" );
956
957
	ASSERTSOCKOP( getsockname( fd, ( struct sockaddr *)saddr, &ssize ), "Getting socket name" );
958
959
	if( saddr->ss_family == AF_INET )
960
		sprintf( port, "%d", ntohs( ( ( struct sockaddr_in *) saddr )->sin_port ) );
961
	else
962
		sprintf( port, "%d", ntohs( ( ( struct sockaddr_in6 *) saddr )->sin6_port ) );
963
964
	return TRUE;
965
}
966
967
/*
968
 * SOCKS5BYTESTREAM protocol for the sender
969
 */
970
gboolean jabber_bs_send_handshake( gpointer data, gint fd, b_input_condition cond )
971
{
972
	struct bs_transfer *bt = data;
973
	struct jabber_transfer *tf = bt->tf;
974
	short revents;
975
976
	if ( !jabber_bs_poll( bt, fd, &revents ) )
977
		return FALSE;
978
	
979
	switch( bt->phase ) 
980
	{
981
	case BS_PHASE_CONNECT:
982
		{
983
			struct sockaddr_storage clt_addr;
984
			socklen_t ssize = sizeof( clt_addr );
985
			
986
			/* Connect */
987
988
			ASSERTSOCKOP( tf->fd = accept( fd, (struct sockaddr *) &clt_addr, &ssize ), "Accepting connection" );
989
990
			closesocket( fd );
991
			fd = tf->fd;
992
			sock_make_nonblocking( fd );
993
			
994
			bt->phase = BS_PHASE_CONNECTED;
995
996
			bt->tf->watch_in = b_input_add( fd, GAIM_INPUT_READ, jabber_bs_send_handshake, bt );
997
			return FALSE;
998
		}
999
	case BS_PHASE_CONNECTED:
1000
		{
1001
			int ret, have_noauth=FALSE;
1002
			struct {
1003
				unsigned char ver;
1004
				unsigned char method;
1005
			} socks5_auth_reply = { .ver = 5, .method = 0 };
1006
			struct {
1007
				unsigned char ver;
1008
				unsigned char nmethods;
1009
				unsigned char method;
1010
			} socks5_hello;
1011
1012
			if( !( ret = jabber_bs_peek( bt, &socks5_hello, sizeof( socks5_hello ) ) ) )
1013
				return FALSE;
1014
1015
			if( ret < sizeof( socks5_hello ) )
1016
				return TRUE;
1017
1018
			if( !( socks5_hello.ver == 5 ) ||
1019
			    !( socks5_hello.nmethods >= 1 ) ||
1020
			    !( socks5_hello.nmethods < 32 ) )
1021
				return jabber_bs_abort( bt, "Invalid auth request ver=%d nmethods=%d method=%d", socks5_hello.ver, socks5_hello.nmethods, socks5_hello.method );
1022
1023
			have_noauth = socks5_hello.method == 0;
1024
1025
			if( socks5_hello.nmethods > 1 )
1026
			{
1027
				char mbuf[32];
1028
				int i;
1029
				ASSERTSOCKOP( ret = recv( fd, mbuf, socks5_hello.nmethods - 1, 0 ) , "Receiving auth methods" );
1030
				if( ret < ( socks5_hello.nmethods - 1 ) )
1031
					return jabber_bs_abort( bt, "Partial auth request");
1032
				for( i = 0 ; !have_noauth && ( i < socks5_hello.nmethods - 1 ) ; i ++ )
1033
					if( mbuf[i] == 0 )
1034
						have_noauth = TRUE;
1035
			}
1036
			
1037
			if( !have_noauth )
1038
				return jabber_bs_abort( bt, "Auth request didn't include no authentication" );
1039
1040
			ASSERTSOCKOP( send( fd, &socks5_auth_reply, sizeof( socks5_auth_reply ) , 0 ), "Sending auth reply" );
1041
1042
			bt->phase = BS_PHASE_REQUEST;
1043
1044
			return TRUE;
1045
		}
1046
	case BS_PHASE_REQUEST:
1047
		{
1048
			struct socks5_message socks5_connect;
1049
			int msgsize = sizeof( struct socks5_message );
1050
1051
			if( !jabber_bs_peek( bt, &socks5_connect, msgsize ) )
1052
				return FALSE;
1053
1054
			if( !( socks5_connect.ver == 5) ||
1055
			    !( socks5_connect.cmdrep.cmd == 1 ) ||
1056
			    !( socks5_connect.atyp == 3 ) ||
1057
			    !(socks5_connect.addrlen == 40 ) )
1058
				return jabber_bs_abort( bt, "Invalid SOCKS5 Connect message (addrlen=%d, ver=%d, cmd=%d, atyp=%d)", socks5_connect.addrlen, socks5_connect.ver, socks5_connect.cmdrep.cmd, socks5_connect.atyp );
1059
			if( !( memcmp( socks5_connect.address, bt->pseudoadr, 40 ) == 0 ) )
1060
				return jabber_bs_abort( bt, "SOCKS5 Connect message contained wrong digest");
1061
1062
			socks5_connect.cmdrep.rep = 0;
1063
1064
			ASSERTSOCKOP( send( fd, &socks5_connect, msgsize, 0 ), "Sending connect reply" );
1065
1066
			bt->phase = BS_PHASE_REPLY;
1067
1068
			imcb_log( tf->ic, "File %s: SOCKS5 handshake successful! Transfer about to start...", tf->ft->file_name );
1069
1070
			if( tf->accepted )
1071
			{
1072
				/* streamhost-used message came already in(possible?), let's start sending */
1073
				tf->ft->write_request( tf->ft );
1074
			}
1075
1076
			tf->watch_in = 0;
1077
			return FALSE;
1078
1079
		}
1080
	default:
1081
		/* BUG */
1082
		imcb_log( bt->tf->ic, "BUG in file transfer code: undefined handshake phase" );
1083
1084
		bt->tf->watch_in = 0;
1085
		return FALSE;
1086
	}
1087
}
1088
#undef ASSERTSOCKOP
(-)bitlbee-1.2/protocols/jabber/si.c (+438 lines)
Line 0 Link Here
1
/***************************************************************************\
2
*                                                                           *
3
*  BitlBee - An IRC to IM gateway                                           *
4
*  Jabber module - SI packets                                               *
5
*                                                                           *
6
*  Copyright 2007 Uli Meis <a.sporto+bee@gmail.com>                         *
7
*                                                                           *
8
*  This program is free software; you can redistribute it and/or modify     *
9
*  it under the terms of the GNU General Public License as published by     *
10
*  the Free Software Foundation; either version 2 of the License, or        *
11
*  (at your option) any later version.                                      *
12
*                                                                           *
13
*  This program is distributed in the hope that it will be useful,          *
14
*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
15
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
16
*  GNU General Public License for more details.                             *
17
*                                                                           *
18
*  You should have received a copy of the GNU General Public License along  *
19
*  with this program; if not, write to the Free Software Foundation, Inc.,  *
20
*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.              *
21
*                                                                           *
22
\***************************************************************************/
23
24
#include "jabber.h"
25
#include "sha1.h"
26
27
void jabber_si_answer_request( file_transfer_t *ft );
28
int jabber_si_send_request(struct im_connection *ic, char *who, struct jabber_transfer *tf );
29
30
/* file_transfer free() callback */
31
void jabber_si_free_transfer( file_transfer_t *ft)
32
{
33
	struct jabber_transfer *tf = ft->data;
34
	struct jabber_data *jd = tf->ic->proto_data;
35
36
	if ( tf->watch_in )
37
		b_event_remove( tf->watch_in );
38
39
	jd->filetransfers = g_slist_remove( jd->filetransfers, tf );
40
41
	if( tf->fd )
42
	{
43
		close( tf->fd );
44
		tf->fd = 0;
45
	}
46
47
	g_free( tf->ini_jid );
48
	g_free( tf->tgt_jid );
49
	g_free( tf->iq_id );
50
	g_free( tf->sid );
51
}
52
53
/* file_transfer finished() callback */
54
void jabber_si_finished( file_transfer_t *ft )
55
{
56
	struct jabber_transfer *tf = ft->data;
57
58
	imcb_log( tf->ic, "File %s transferred successfully!" , ft->file_name );
59
}
60
61
/* file_transfer canceled() callback */
62
void jabber_si_canceled( file_transfer_t *ft, char *reason )
63
{
64
	struct jabber_transfer *tf = ft->data;
65
	struct xt_node *reply, *iqnode;
66
67
	if( tf->accepted )
68
		return;
69
	
70
	iqnode = jabber_make_packet( "iq", "error", tf->ini_jid, NULL );
71
	xt_add_attr( iqnode, "id", tf->iq_id );
72
	reply = jabber_make_error_packet( iqnode, "forbidden", "cancel", "403" );
73
	xt_free_node( iqnode );
74
	
75
	if( !jabber_write_packet( tf->ic, reply ) )
76
		imcb_log( tf->ic, "WARNING: Error generating reply to file transfer request" );
77
	xt_free_node( reply );
78
79
}
80
81
void jabber_si_transfer_request( struct im_connection *ic, file_transfer_t *ft, char *who ) 
82
{
83
	struct jabber_transfer *tf;
84
	struct jabber_data *jd = ic->proto_data;
85
	char *server  = jd->server;
86
87
	imcb_log( ic, "Trying to send %s(%zd bytes) to %s", ft->file_name, ft->file_size, who );
88
89
	tf = g_new0( struct jabber_transfer, 1 );
90
91
	tf->ic = ic;
92
	tf->ft = ft;
93
	tf->ft->data = tf;
94
	tf->ft->free = jabber_si_free_transfer;
95
	tf->ft->finished = jabber_si_finished;
96
	ft->write = jabber_bs_send_write;
97
98
	jd->filetransfers = g_slist_prepend( jd->filetransfers, tf );
99
100
	/* query the buddy's features */
101
	jabber_iq_query_features( ic, who );
102
103
	/* query proxies from the server */
104
	if( !jd->have_streamhosts )
105
		jabber_iq_query_server( ic, server, XMLNS_DISCO_ITEMS );
106
107
	/* send the request to our buddy */
108
	jabber_si_send_request( ic, who, tf );
109
110
	/* and start the receive logic */
111
	imcb_file_recv_start( ft );
112
}
113
114
/*
115
 * First function that gets called when a file transfer request comes in.
116
 * A lot to parse.
117
 *
118
 * We choose a stream type from the options given by the initiator.
119
 * Then we wait for imcb to call the accept or cancel callbacks.
120
 */
121
int jabber_si_handle_request( struct im_connection *ic, struct xt_node *node, struct xt_node *sinode)
122
{
123
	struct xt_node *c, *d, *reply;
124
	char *sid, *ini_jid, *tgt_jid, *iq_id, *s, *ext_jid;
125
	struct jabber_buddy *bud;
126
	int requestok = FALSE;
127
	char *name;
128
	size_t size;
129
	struct jabber_transfer *tf;
130
	struct jabber_data *jd = ic->proto_data;
131
	file_transfer_t *ft;
132
	
133
	/* All this means we expect something like this: ( I think )
134
	 * <iq from=... to=... id=...>
135
	 * 	<si id=id xmlns=si profile=ft>
136
	 * 		<file xmlns=ft/>
137
	 * 		<feature xmlns=feature>
138
	 * 			<x xmlns=xdata type=submit>
139
	 * 				<field var=stream-method>
140
	 *
141
	 */
142
	if( !( ini_jid 		= xt_find_attr(   node, "from" ) 			) ||
143
	    !( tgt_jid 		= xt_find_attr(   node, "to" ) 				) ||
144
	    !( iq_id 		= xt_find_attr(   node, "id" ) 				) ||
145
	    !( sid 		= xt_find_attr( sinode, "id" ) 				) ||
146
	    !( strcmp( xt_find_attr( sinode, "profile" ), XMLNS_FILETRANSFER ) == 0	) ||
147
	    !( d 		= xt_find_node( sinode->children, "file" ) 		) ||
148
	    !( strcmp( xt_find_attr( d, "xmlns" ), XMLNS_FILETRANSFER ) == 0 		) ||
149
	    !( name 		= xt_find_attr( d, "name" ) 				) ||
150
	    !( size 		= (size_t) atoll( xt_find_attr( d, "size" ) ) 		) ||
151
	    !( d 		= xt_find_node( sinode->children, "feature" ) 		) ||
152
	    !( strcmp( xt_find_attr( d, "xmlns" ), XMLNS_FEATURE ) == 0 		) ||
153
	    !( d 		= xt_find_node( d->children, "x" ) 			) ||
154
	    !( strcmp( xt_find_attr( d, "xmlns" ), XMLNS_XDATA ) == 0 			) ||
155
	    !( strcmp( xt_find_attr( d, "type" ), "form" ) == 0 			) ||
156
	    !( d 		= xt_find_node( d->children, "field" ) 			) ||
157
	    !( strcmp( xt_find_attr( d, "var" ), "stream-method" ) == 0 		) )
158
	{
159
		imcb_log( ic, "WARNING: Received incomplete Stream Initiation request" );
160
	} else
161
	{
162
		/* Check if we support one of the options */
163
164
		c = d->children;
165
		while( ( c = xt_find_node( c, "option" ) ) )
166
			if( 	( d = xt_find_node( c->children, "value" ) ) &&
167
				( strcmp( d->text, XMLNS_BYTESTREAMS ) == 0 ) )
168
			{
169
				requestok = TRUE;
170
				break;
171
			}
172
173
		if ( !requestok )
174
			imcb_log( ic, "WARNING: Unsupported file transfer request from %s", ini_jid);
175
	}
176
	
177
	if ( requestok )
178
	{
179
		/* Figure out who the transfer should come frome... */
180
181
		if( ( s = strchr( ini_jid, '/' ) ) )
182
		{
183
			if( ( bud = jabber_buddy_by_jid( ic, ini_jid, GET_BUDDY_EXACT ) ) )
184
			{
185
				bud->last_act = time( NULL );
186
				ext_jid = bud->ext_jid ? : bud->bare_jid;
187
			}
188
			else
189
				*s = 0; /* We need to generate a bare JID now. */
190
		}
191
192
		if( !( ft = imcb_file_send_start( ic, ext_jid, name, size ) ) )
193
		{ 
194
			imcb_log( ic, "WARNING: Error handling transfer request from %s", ini_jid);
195
			requestok = FALSE;
196
		}
197
198
		*s = '/';
199
	}
200
201
	if ( !requestok )
202
	{ 
203
		reply = jabber_make_error_packet( node, "item-not-found", "cancel", NULL );
204
		if (!jabber_write_packet( ic, reply ))
205
			imcb_log( ic, "WARNING: Error generating reply to file transfer request" );
206
		xt_free_node( reply );
207
		return XT_HANDLED;
208
	}
209
210
	/* Request is fine. */
211
212
	imcb_log( ic, "File transfer request from %s for %s (%zd kb). ", xt_find_attr( node, "from" ), name, size/1024 );
213
214
	imcb_log( ic, "Accept the file transfer if you'd like the file. If you don't, issue the 'transfers reject' command.");
215
216
	tf = g_new0( struct jabber_transfer, 1 );
217
218
	tf->ini_jid = g_strdup( ini_jid );
219
	tf->tgt_jid = g_strdup( tgt_jid );
220
	tf->iq_id = g_strdup( iq_id );
221
	tf->sid = g_strdup( sid );
222
	tf->ic = ic;
223
	tf->ft = ft;
224
	tf->ft->data = tf;
225
	tf->ft->accept = jabber_si_answer_request;
226
	tf->ft->free = jabber_si_free_transfer;
227
	tf->ft->finished = jabber_si_finished;
228
	tf->ft->canceled = jabber_si_canceled;
229
230
	jd->filetransfers = g_slist_prepend( jd->filetransfers, tf );
231
232
	return XT_HANDLED;
233
}
234
235
/*
236
 * imc called the accept callback which probably means that the user accepted this file transfer.
237
 * We send our response to the initiator.
238
 * In the next step, the initiator will send us a request for the given stream type.
239
 * (currently that can only be a SOCKS5 bytestream)
240
 */
241
void jabber_si_answer_request( file_transfer_t *ft ) {
242
	struct jabber_transfer *tf = ft->data;
243
	struct xt_node *node, *sinode, *reply;
244
245
	/* generate response, start with the SI tag */
246
	sinode = xt_new_node( "si", NULL, NULL );
247
	xt_add_attr( sinode, "xmlns", XMLNS_SI );
248
	xt_add_attr( sinode, "profile", XMLNS_FILETRANSFER );
249
	xt_add_attr( sinode, "id", tf->sid );
250
251
	/* now the file tag */
252
	node = xt_new_node( "file", NULL, NULL );
253
	xt_add_attr( node, "xmlns", XMLNS_FILETRANSFER );
254
255
	xt_add_child( sinode, node );
256
257
	/* and finally the feature tag */
258
	node = xt_new_node( "field", NULL, NULL );
259
	xt_add_attr( node, "var", "stream-method" );
260
	xt_add_attr( node, "type", "list-single" );
261
262
	/* Currently all we can do. One could also implement in-band (IBB) */
263
	xt_add_child( node, xt_new_node( "value", XMLNS_BYTESTREAMS, NULL ) );
264
265
	node = xt_new_node( "x", NULL, node );
266
	xt_add_attr( node, "xmlns", XMLNS_XDATA );
267
	xt_add_attr( node, "type", "submit" );
268
269
	node = xt_new_node( "feature", NULL, node );
270
	xt_add_attr( node, "xmlns", XMLNS_FEATURE );
271
272
	xt_add_child( sinode, node );
273
274
	reply = jabber_make_packet( "iq", "result", tf->ini_jid, sinode );
275
	xt_add_attr( reply, "id", tf->iq_id );
276
	
277
	if( !jabber_write_packet( tf->ic, reply ) )
278
		imcb_log( tf->ic, "WARNING: Error generating reply to file transfer request" );
279
	else
280
		tf->accepted = TRUE;
281
	xt_free_node( reply );
282
}
283
284
static xt_status jabber_si_handle_response(struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
285
{
286
	struct xt_node *c, *d;
287
	char *ini_jid, *tgt_jid, *iq_id;
288
	GSList *tflist;
289
	struct jabber_transfer *tf=NULL;
290
	struct jabber_data *jd = ic->proto_data;
291
292
	if( !( tgt_jid = xt_find_attr( node, "from" ) ) ||
293
	    !( ini_jid = xt_find_attr( node, "to" ) ) )
294
	{
295
		imcb_log( ic, "Invalid SI response from=%s to=%s", tgt_jid, ini_jid );
296
		return XT_HANDLED;
297
	}
298
	
299
	/* All this means we expect something like this: ( I think )
300
	 * <iq from=... to=... id=...>
301
	 * 	<si xmlns=si>
302
	 * 	[	<file xmlns=ft/>    ] <-- not neccessary
303
	 * 		<feature xmlns=feature>
304
	 * 			<x xmlns=xdata type=submit>
305
	 * 				<field var=stream-method>
306
	 * 					<value>
307
	 */
308
	if( !( tgt_jid = xt_find_attr( node, "from" ) ) ||
309
	    !( ini_jid = xt_find_attr( node, "to" ) ) ||
310
	    !( iq_id   = xt_find_attr( node, "id" ) ) ||
311
	    !( c = xt_find_node( node->children, "si" ) ) ||
312
	    !( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_SI ) == 0 ) ||
313
/*	    !( d = xt_find_node( c->children, "file" ) ) ||
314
	    !( strcmp( xt_find_attr( d, "xmlns" ), XMLNS_FILETRANSFER ) == 0 ) || */
315
	    !( d = xt_find_node( c->children, "feature" ) ) ||
316
	    !( strcmp( xt_find_attr( d, "xmlns" ), XMLNS_FEATURE ) == 0 ) ||
317
	    !( d = xt_find_node( d->children, "x" ) ) ||
318
	    !( strcmp( xt_find_attr( d, "xmlns" ), XMLNS_XDATA ) == 0 ) ||
319
	    !( strcmp( xt_find_attr( d, "type" ), "submit" ) == 0 ) ||
320
	    !( d = xt_find_node( d->children, "field" ) ) ||
321
	    !( strcmp( xt_find_attr( d, "var" ), "stream-method" ) == 0 ) ||
322
	    !( d = xt_find_node( d->children, "value" ) ) )
323
	{
324
		imcb_log( ic, "WARNING: Received incomplete Stream Initiation response" );
325
		return XT_HANDLED;
326
	}
327
328
	if( !( strcmp( d->text, XMLNS_BYTESTREAMS ) == 0 ) ) { 
329
		/* since we should only have advertised what we can do and the peer should
330
		 * only have chosen what we offered, this should never happen */
331
		imcb_log( ic, "WARNING: Received invalid Stream Initiation response, method %s", d->text );
332
			
333
		return XT_HANDLED;
334
	}
335
	
336
	/* Let's see if we can find out what this bytestream should be for... */
337
338
	for( tflist = jd->filetransfers ; tflist; tflist = g_slist_next(tflist) )
339
	{
340
		struct jabber_transfer *tft = tflist->data;
341
		if( ( strcmp( tft->iq_id, iq_id ) == 0 ) )
342
		{
343
		    	tf = tft;
344
			break;
345
		}
346
	}
347
348
	if (!tf) 
349
	{
350
		imcb_log( ic, "WARNING: Received bytestream request from %s that doesn't match an SI request", ini_jid );
351
		return XT_HANDLED;
352
	}
353
354
	tf->ini_jid = g_strdup( ini_jid );
355
	tf->tgt_jid = g_strdup( tgt_jid );
356
357
	imcb_log( ic, "File %s: %s accepted the transfer!", tf->ft->file_name, tgt_jid );
358
359
	jabber_bs_send_start( tf );
360
361
	return XT_HANDLED;
362
}
363
364
int jabber_si_send_request(struct im_connection *ic, char *who, struct jabber_transfer *tf )
365
{
366
	struct xt_node *node, *sinode;
367
	struct jabber_buddy *bud;
368
369
	/* who knows how many bits the future holds :) */
370
	char filesizestr[ 1 + ( int ) ( 0.301029995663981198f * sizeof( size_t ) * 8 ) ];
371
372
	const char *methods[] = 
373
	{  	
374
		XMLNS_BYTESTREAMS,
375
		//XMLNS_IBB,
376
		NULL 
377
	};
378
	const char **m;
379
	char *s;
380
381
	/* Maybe we should hash this? */
382
	tf->sid = g_strdup_printf( "BitlBeeJabberSID%d", tf->ft->local_id );
383
	
384
	if( ( s = strchr( who, '=' ) ) && jabber_chat_by_jid( ic, s + 1 ) )
385
		bud = jabber_buddy_by_ext_jid( ic, who, 0 );
386
	else
387
		bud = jabber_buddy_by_jid( ic, who, 0 );
388
389
	/* start with the SI tag */
390
	sinode = xt_new_node( "si", NULL, NULL );
391
	xt_add_attr( sinode, "xmlns", XMLNS_SI );
392
	xt_add_attr( sinode, "profile", XMLNS_FILETRANSFER );
393
	xt_add_attr( sinode, "id", tf->sid );
394
395
/*	if( mimetype ) 
396
		xt_add_attr( node, "mime-type", mimetype ); */
397
398
	/* now the file tag */
399
/*	if( desc )
400
 		node = xt_new_node( "desc", descr, NULL ); */
401
	node = xt_new_node( "range", NULL, NULL );
402
403
	sprintf( filesizestr, "%zd", tf->ft->file_size );
404
	node = xt_new_node( "file", NULL, node );
405
	xt_add_attr( node, "xmlns", XMLNS_FILETRANSFER );
406
	xt_add_attr( node, "name", tf->ft->file_name );
407
	xt_add_attr( node, "size", filesizestr );
408
/*	if (hash)
409
		xt_add_attr( node, "hash", hash );
410
	if (date)
411
		xt_add_attr( node, "date", date ); */
412
413
	xt_add_child( sinode, node );
414
415
	/* and finally the feature tag */
416
	node = xt_new_node( "field", NULL, NULL );
417
	xt_add_attr( node, "var", "stream-method" );
418
	xt_add_attr( node, "type", "list-single" );
419
420
	for ( m = methods ; *m ; m ++ )
421
		xt_add_child( node, xt_new_node( "option", NULL, xt_new_node( "value", (char *)*m, NULL ) ) );
422
423
	node = xt_new_node( "x", NULL, node );
424
	xt_add_attr( node, "xmlns", XMLNS_XDATA );
425
	xt_add_attr( node, "type", "form" );
426
427
	node = xt_new_node( "feature", NULL, node );
428
	xt_add_attr( node, "xmlns", XMLNS_FEATURE );
429
430
	xt_add_child( sinode, node );
431
432
	/* and we are there... */
433
	node = jabber_make_packet( "iq", "set", bud ? bud->full_jid : who, sinode );
434
	jabber_cache_add( ic, node, jabber_si_handle_response );
435
	tf->iq_id = g_strdup( xt_find_attr( node, "id" ) );
436
	
437
	return jabber_write_packet( ic, node );
438
}
(-)bitlbee-1.2/protocols/msn/msn.h (-1 / +1 lines)
Lines 28-34 Link Here
28
#define TYPING_NOTIFICATION_MESSAGE "\r\r\rBEWARE, ME R TYPINK MESSAGE!!!!\r\r\r"
28
#define TYPING_NOTIFICATION_MESSAGE "\r\r\rBEWARE, ME R TYPINK MESSAGE!!!!\r\r\r"
29
#define GROUPCHAT_SWITCHBOARD_MESSAGE "\r\r\rME WANT TALK TO MANY PEOPLE\r\r\r"
29
#define GROUPCHAT_SWITCHBOARD_MESSAGE "\r\r\rME WANT TALK TO MANY PEOPLE\r\r\r"
30
30
31
#ifdef DEBUG
31
#ifdef DEBUG_MSN
32
#define debug( text... ) imcb_log( ic, text );
32
#define debug( text... ) imcb_log( ic, text );
33
#else
33
#else
34
#define debug( text... )
34
#define debug( text... )
(-)bitlbee-1.2/protocols/msn/msn_util.c (-2 / +6 lines)
Lines 89-96 Link Here
89
	char *realname;
89
	char *realname;
90
};
90
};
91
91
92
static void msn_buddy_ask_yes( gpointer w, struct msn_buddy_ask_data *bla )
92
static void msn_buddy_ask_yes( void *data )
93
{
93
{
94
	struct msn_buddy_ask_data *bla = data;
95
	
94
	msn_buddy_list_add( bla->ic, "AL", bla->handle, bla->realname );
96
	msn_buddy_list_add( bla->ic, "AL", bla->handle, bla->realname );
95
	
97
	
96
	if( imcb_find_buddy( bla->ic, bla->handle ) == NULL )
98
	if( imcb_find_buddy( bla->ic, bla->handle ) == NULL )
Lines 101-108 Link Here
101
	g_free( bla );
103
	g_free( bla );
102
}
104
}
103
105
104
static void msn_buddy_ask_no( gpointer w, struct msn_buddy_ask_data *bla )
106
static void msn_buddy_ask_no( void *data )
105
{
107
{
108
	struct msn_buddy_ask_data *bla = data;
109
	
106
	msn_buddy_list_add( bla->ic, "BL", bla->handle, bla->realname );
110
	msn_buddy_list_add( bla->ic, "BL", bla->handle, bla->realname );
107
	
111
	
108
	g_free( bla->handle );
112
	g_free( bla->handle );
(-)bitlbee-1.2/protocols/nogaim.c (-7 / +10 lines)
Lines 342-348 Link Here
342
342
343
/* dialogs.c */
343
/* dialogs.c */
344
344
345
void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont )
345
void imcb_ask( struct im_connection *ic, char *msg, void *data,
346
               query_callback doit, query_callback dont )
346
{
347
{
347
	query_add( ic->irc, ic, msg, doit, dont, data );
348
	query_add( ic->irc, ic, msg, doit, dont, data );
348
}
349
}
Lines 494-511 Link Here
494
	char *handle;
495
	char *handle;
495
};
496
};
496
497
497
void show_got_added_no( gpointer w, struct show_got_added_data *data )
498
void show_got_added_no( void *data )
498
{
499
{
499
	g_free( data->handle );
500
	g_free( ((struct show_got_added_data*)data)->handle );
500
	g_free( data );
501
	g_free( data );
501
}
502
}
502
503
503
void show_got_added_yes( gpointer w, struct show_got_added_data *data )
504
void show_got_added_yes( void *data )
504
{
505
{
505
	data->ic->acc->prpl->add_buddy( data->ic, data->handle, NULL );
506
	struct show_got_added_data *sga = data;
506
	/* imcb_add_buddy( data->ic, NULL, data->handle, data->handle ); */
507
	
507
	
508
	return show_got_added_no( w, data );
508
	sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL );
509
	/* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */
510
	
511
	return show_got_added_no( data );
509
}
512
}
510
513
511
void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname )
514
void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname )
(-)bitlbee-1.2/protocols/nogaim.h (-1 / +6 lines)
Lines 41-47 Link Here
41
#include "bitlbee.h"
41
#include "bitlbee.h"
42
#include "account.h"
42
#include "account.h"
43
#include "proxy.h"
43
#include "proxy.h"
44
#include "query.h"
44
#include "md5.h"
45
#include "md5.h"
46
#include "ft.h"
45
47
46
#define BUF_LEN MSG_LEN
48
#define BUF_LEN MSG_LEN
47
#define BUF_LONG ( BUF_LEN * 2 )
49
#define BUF_LONG ( BUF_LEN * 2 )
Lines 227-232 Link Here
227
	/* Mainly for AOL, since they think "Bung hole" == "Bu ngho le". *sigh*
229
	/* Mainly for AOL, since they think "Bung hole" == "Bu ngho le". *sigh*
228
	 * - Most protocols will just want to set this to g_strcasecmp().*/
230
	 * - Most protocols will just want to set this to g_strcasecmp().*/
229
	int (* handle_cmp) (const char *who1, const char *who2);
231
	int (* handle_cmp) (const char *who1, const char *who2);
232
233
	/* Incoming transfer request */
234
	void (* transfer_request) (struct im_connection *, file_transfer_t *ft, char *handle );
230
};
235
};
231
236
232
/* im_api core stuff. */
237
/* im_api core stuff. */
Lines 260-266 Link Here
260
 * - 'data' can be your custom struct - it will be passed to the callbacks.
265
 * - 'data' can be your custom struct - it will be passed to the callbacks.
261
 * - 'doit' or 'dont' will be called depending of the answer of the user.
266
 * - 'doit' or 'dont' will be called depending of the answer of the user.
262
 */
267
 */
263
G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont );
268
G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont );
264
G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname );
269
G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname );
265
270
266
/* Buddy management */
271
/* Buddy management */
(-)bitlbee-1.2/protocols/oscar/oscar.c (-6 / +12 lines)
Lines 1083-1090 Link Here
1083
	return 1;
1083
	return 1;
1084
}
1084
}
1085
1085
1086
void oscar_accept_chat(gpointer w, struct aim_chat_invitation * inv);
1086
void oscar_accept_chat(void *data);
1087
void oscar_reject_chat(gpointer w, struct aim_chat_invitation * inv);
1087
void oscar_reject_chat(void *data);
1088
	
1088
	
1089
static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) {
1089
static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) {
1090
	struct im_connection *ic = sess->aux_data;
1090
	struct im_connection *ic = sess->aux_data;
Lines 1118-1124 Link Here
1118
	return 1;
1118
	return 1;
1119
}
1119
}
1120
1120
1121
static void gaim_icq_authgrant(gpointer w, struct icq_auth *data) {
1121
static void gaim_icq_authgrant(void *data_) {
1122
	struct icq_auth *data = data_;
1122
	char *uin, message;
1123
	char *uin, message;
1123
	struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
1124
	struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
1124
	
1125
	
Lines 1133-1139 Link Here
1133
	g_free(data);
1134
	g_free(data);
1134
}
1135
}
1135
1136
1136
static void gaim_icq_authdeny(gpointer w, struct icq_auth *data) {
1137
static void gaim_icq_authdeny(void *data_) {
1138
	struct icq_auth *data = data_;
1137
	char *uin, *message;
1139
	char *uin, *message;
1138
	struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
1140
	struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
1139
	
1141
	
Lines 2587-2601 Link Here
2587
	return NULL;
2589
	return NULL;
2588
}
2590
}
2589
2591
2590
void oscar_accept_chat(gpointer w, struct aim_chat_invitation * inv)
2592
void oscar_accept_chat(void *data)
2591
{
2593
{
2594
	struct aim_chat_invitation * inv = data;
2595
	
2592
	oscar_chat_join(inv->ic, inv->name, NULL, NULL);
2596
	oscar_chat_join(inv->ic, inv->name, NULL, NULL);
2593
	g_free(inv->name);
2597
	g_free(inv->name);
2594
	g_free(inv);
2598
	g_free(inv);
2595
}
2599
}
2596
2600
2597
void oscar_reject_chat(gpointer w, struct aim_chat_invitation * inv)
2601
void oscar_reject_chat(void *data)
2598
{
2602
{
2603
	struct aim_chat_invitation * inv = data;
2604
	
2599
	g_free(inv->name);
2605
	g_free(inv->name);
2600
	g_free(inv);
2606
	g_free(inv);
2601
}
2607
}
(-)bitlbee-1.2/protocols/yahoo/yahoo.c (-2 / +6 lines)
Lines 796-811 Link Here
796
	return -1;
796
	return -1;
797
}
797
}
798
798
799
static void byahoo_accept_conf( gpointer w, struct byahoo_conf_invitation *inv )
799
static void byahoo_accept_conf( void *data )
800
{
800
{
801
	struct byahoo_conf_invitation *inv = data;
802
	
801
	yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name );
803
	yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name );
802
	imcb_chat_add_buddy( inv->c, inv->ic->acc->user );
804
	imcb_chat_add_buddy( inv->c, inv->ic->acc->user );
803
	g_free( inv->name );
805
	g_free( inv->name );
804
	g_free( inv );
806
	g_free( inv );
805
}
807
}
806
808
807
static void byahoo_reject_conf( gpointer w, struct byahoo_conf_invitation *inv )
809
static void byahoo_reject_conf( void *data )
808
{
810
{
811
	struct byahoo_conf_invitation *inv = data;
812
	
809
	yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" );
813
	yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" );
810
	imcb_chat_free( inv->c );
814
	imcb_chat_free( inv->c );
811
	g_free( inv->name );
815
	g_free( inv->name );
(-)bitlbee-1.2/query.c (-3 / +4 lines)
Lines 29-35 Link Here
29
static void query_display( irc_t *irc, query_t *q );
29
static void query_display( irc_t *irc, query_t *q );
30
static query_t *query_default( irc_t *irc );
30
static query_t *query_default( irc_t *irc );
31
31
32
query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, void *yes, void *no, void *data )
32
query_t *query_add( irc_t *irc, struct im_connection *ic, char *question,
33
                    query_callback yes, query_callback no, void *data )
33
{
34
{
34
	query_t *q = g_new0( query_t, 1 );
35
	query_t *q = g_new0( query_t, 1 );
35
	
36
	
Lines 143-149 Link Here
143
			imcb_log( q->ic, "Accepted: %s", q->question );
144
			imcb_log( q->ic, "Accepted: %s", q->question );
144
		else
145
		else
145
			irc_usermsg( irc, "Accepted: %s", q->question );
146
			irc_usermsg( irc, "Accepted: %s", q->question );
146
		q->yes( NULL, q->data );
147
		q->yes( q->data );
147
	}
148
	}
148
	else
149
	else
149
	{
150
	{
Lines 151-157 Link Here
151
			imcb_log( q->ic, "Rejected: %s", q->question );
152
			imcb_log( q->ic, "Rejected: %s", q->question );
152
		else
153
		else
153
			irc_usermsg( irc, "Rejected: %s", q->question );
154
			irc_usermsg( irc, "Rejected: %s", q->question );
154
		q->no( NULL, q->data );
155
		q->no( q->data );
155
	}
156
	}
156
	q->data = NULL;
157
	q->data = NULL;
157
	
158
	
(-)bitlbee-1.2/query.h (-3 / +5 lines)
Lines 26-42 Link Here
26
#ifndef _QUERY_H
26
#ifndef _QUERY_H
27
#define _QUERY_H
27
#define _QUERY_H
28
28
29
typedef void (*query_callback) ( void *data );
30
29
typedef struct query
31
typedef struct query
30
{
32
{
31
	struct im_connection *ic;
33
	struct im_connection *ic;
32
	char *question;
34
	char *question;
33
	void (* yes) ( gpointer w, void *data );
35
	query_callback yes, no;
34
	void (* no) ( gpointer w, void *data );
35
	void *data;
36
	void *data;
36
	struct query *next;
37
	struct query *next;
37
} query_t;
38
} query_t;
38
39
39
query_t *query_add( irc_t *irc, struct im_connection *ic, char *question, void *yes, void *no, void *data );
40
query_t *query_add( irc_t *irc, struct im_connection *ic, char *question,
41
                    query_callback yes, query_callback no, void *data );
40
void query_del( irc_t *irc, query_t *q );
42
void query_del( irc_t *irc, query_t *q );
41
void query_del_by_conn( irc_t *irc, struct im_connection *ic );
43
void query_del_by_conn( irc_t *irc, struct im_connection *ic );
42
void query_answer( irc_t *irc, query_t *q, int ans );
44
void query_answer( irc_t *irc, query_t *q, int ans );
(-)bitlbee-1.2/root_commands.c (-9 / +111 lines)
Lines 203-226 Link Here
203
	}
203
	}
204
}
204
}
205
205
206
void cmd_account_del_yes( gpointer w, void *data )
206
struct cmd_account_del_data
207
{
207
{
208
	account_t *a = data;
208
	account_t *a;
209
	irc_t *irc = a->irc;
209
	irc_t *irc;
210
};
211
212
void cmd_account_del_yes( void *data )
213
{
214
	struct cmd_account_del_data *cad = data;
215
	account_t *a;
216
	
217
	for( a = cad->irc->accounts; a && a != cad->a; a = a->next );
210
	
218
	
211
	if( a->ic )
219
	if( a == NULL )
212
	{
220
	{
213
		irc_usermsg( irc, "Account is still logged in, can't delete" );
221
		irc_usermsg( cad->irc, "Account already deleted" );
222
	}
223
	else if( a->ic )
224
	{
225
		irc_usermsg( cad->irc, "Account is still logged in, can't delete" );
214
	}
226
	}
215
	else
227
	else
216
	{
228
	{
217
		account_del( irc, a );
229
		account_del( cad->irc, a );
218
		irc_usermsg( irc, "Account deleted" );
230
		irc_usermsg( cad->irc, "Account deleted" );
219
	}
231
	}
232
	g_free( data );
220
}
233
}
221
234
222
void cmd_account_del_no( gpointer w, void *data )
235
void cmd_account_del_no( void *data )
223
{
236
{
237
	g_free( data );
224
}
238
}
225
239
226
static void cmd_account( irc_t *irc, char **cmd )
240
static void cmd_account( irc_t *irc, char **cmd )
Lines 277-290 Link Here
277
		}
291
		}
278
		else
292
		else
279
		{
293
		{
294
			struct cmd_account_del_data *cad;
280
			char *msg;
295
			char *msg;
281
			
296
			
297
			cad = g_malloc( sizeof( struct cmd_account_del_data ) );
298
			cad->a = a;
299
			cad->irc = irc;
300
			
282
			msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will "
301
			msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will "
283
			                       "also forget all your saved nicknames. If you want "
302
			                       "also forget all your saved nicknames. If you want "
284
			                       "to change your username/password, use the `account "
303
			                       "to change your username/password, use the `account "
285
			                       "set' command. Are you sure you want to delete this "
304
			                       "set' command. Are you sure you want to delete this "
286
			                       "account?", a->prpl->name, a->user );
305
			                       "account?", a->prpl->name, a->user );
287
			query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, a );
306
			query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, cad );
288
			g_free( msg );
307
			g_free( msg );
289
		}
308
		}
290
	}
309
	}
Lines 583-588 Link Here
583
		{
602
		{
584
			g_free( irc->mynick );
603
			g_free( irc->mynick );
585
			irc->mynick = g_strdup( cmd[2] );
604
			irc->mynick = g_strdup( cmd[2] );
605
			
606
			if( strcmp( cmd[0], "set_rename" ) != 0 )
607
				set_setstr( &irc->set, "root_nick", cmd[2] );
586
		}
608
		}
587
		else if( u->send_handler == buddy_send_handler )
609
		else if( u->send_handler == buddy_send_handler )
588
		{
610
		{
Lines 593-598 Link Here
593
	}
615
	}
594
}
616
}
595
617
618
char *set_eval_root_nick( set_t *set, char *new_nick )
619
{
620
	irc_t *irc = set->data;
621
	
622
	if( strcmp( irc->mynick, new_nick ) != 0 )
623
	{
624
		char *cmd[] = { "set_rename", irc->mynick, new_nick, NULL };
625
		
626
		cmd_rename( irc, cmd );
627
	}
628
	
629
	return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : NULL;
630
}
631
596
static void cmd_remove( irc_t *irc, char **cmd )
632
static void cmd_remove( irc_t *irc, char **cmd )
597
{
633
{
598
	user_t *u;
634
	user_t *u;
Lines 1001-1006 Link Here
1001
	}
1037
	}
1002
}
1038
}
1003
1039
1040
static void cmd_transfers( irc_t *irc, char **cmd )
1041
{
1042
	GSList *files = irc->file_transfers;
1043
	enum { LIST, REJECT, CANCEL };
1044
	int subcmd = LIST;
1045
	int fid;
1046
1047
	if( !files )
1048
	{
1049
		irc_usermsg( irc, "No pending transfers" );
1050
		return;
1051
	}
1052
1053
	if( cmd[1] && 
1054
	    ( strcmp( cmd[1], "reject" ) == 0 ) )
1055
	{
1056
		subcmd = REJECT;
1057
	}
1058
	else if( cmd[1] && 
1059
		 ( strcmp( cmd[1], "cancel" ) == 0 ) && 
1060
		 cmd[2] &&
1061
		 ( fid = atoi( cmd[2] ) ) )
1062
	{
1063
		subcmd = CANCEL;
1064
	}
1065
1066
	for( ; files; files = g_slist_next( files ) )
1067
	{
1068
		file_transfer_t *file = files->data;
1069
		
1070
		switch( subcmd ) {
1071
		case LIST:
1072
			if ( file->status == FT_STATUS_LISTENING )
1073
				irc_usermsg( irc, 
1074
					"Pending file(id %d): %s (Listening...)", file->local_id, file->file_name);
1075
			else 
1076
			{
1077
				int kb_per_s = 0;
1078
				time_t diff = time( NULL ) - file->started;
1079
				if ( ( file->started > 0 ) && ( file->bytes_transferred > 0 ) )
1080
					kb_per_s = file->bytes_transferred / 1024 / diff;
1081
					
1082
				irc_usermsg( irc, 
1083
					"Pending file(id %d): %s (%10zd/%zd kb, %d kb/s)", file->local_id, file->file_name, 
1084
					file->bytes_transferred/1024, file->file_size/1024, kb_per_s);
1085
			}
1086
			break;
1087
		case REJECT:
1088
			if( file->status == FT_STATUS_LISTENING )
1089
			{
1090
				irc_usermsg( irc, "Rejecting file transfer for %s", file->file_name );
1091
				imcb_file_canceled( file, "Denied by user" );
1092
			}
1093
			break;
1094
		case CANCEL:
1095
			if( file->local_id == fid )
1096
			{
1097
				irc_usermsg( irc, "Canceling file transfer for %s", file->file_name );
1098
				imcb_file_canceled( file, "Canceled by user" );
1099
			}
1100
			break;
1101
		}
1102
	}
1103
}
1104
1004
const command_t commands[] = {
1105
const command_t commands[] = {
1005
	{ "help",           0, cmd_help,           0 }, 
1106
	{ "help",           0, cmd_help,           0 }, 
1006
	{ "identify",       1, cmd_identify,       0 },
1107
	{ "identify",       1, cmd_identify,       0 },
Lines 1021-1025 Link Here
1021
	{ "nick",           1, cmd_nick,           0 },
1122
	{ "nick",           1, cmd_nick,           0 },
1022
	{ "qlist",          0, cmd_qlist,          0 },
1123
	{ "qlist",          0, cmd_qlist,          0 },
1023
	{ "join_chat",      2, cmd_join_chat,      0 },
1124
	{ "join_chat",      2, cmd_join_chat,      0 },
1125
	{ "transfers",      0, cmd_transfers,      0 },
1024
	{ NULL }
1126
	{ NULL }
1025
};
1127
};
(-)bitlbee-1.2/set.c (-15 lines)
Lines 229-246 Link Here
229
	
229
	
230
	return value;
230
	return value;
231
}
231
}
232
233
char *set_eval_charset( set_t *set, char *value )
234
{
235
	GIConv cd;
236
237
	if ( g_strncasecmp( value, "none", 4 ) == 0 )
238
		return value;
239
240
	cd = g_iconv_open( "UTF-8", value );
241
	if( cd == (GIConv) -1 )
242
		return NULL;
243
244
	g_iconv_close( cd );
245
	return value;
246
}
(-)bitlbee-1.2/set.h (-1 lines)
Lines 96-101 Link Here
96
/* Some not very generic evaluators that really shouldn't be here... */
96
/* Some not very generic evaluators that really shouldn't be here... */
97
char *set_eval_to_char( set_t *set, char *value );
97
char *set_eval_to_char( set_t *set, char *value );
98
char *set_eval_ops( set_t *set, char *value );
98
char *set_eval_ops( set_t *set, char *value );
99
char *set_eval_charset( set_t *set, char *value );
100
99
101
#endif /* __SET_H__ */
100
#endif /* __SET_H__ */
(-)bitlbee-1.2/tests/check_irc.c (-2 / +2 lines)
Lines 36-43 Link Here
36
36
37
	irc = irc_new(g_io_channel_unix_get_fd(ch1));
37
	irc = irc_new(g_io_channel_unix_get_fd(ch1));
38
38
39
	fail_unless(g_io_channel_write_chars(ch2, "NICK bla\r\n"
39
	fail_unless(g_io_channel_write_chars(ch2, "NICK bla\r\r\n"
40
			"USER a a a a\r\n", -1, NULL, NULL) == G_IO_STATUS_NORMAL);
40
			"USER a a a a\n", -1, NULL, NULL) == G_IO_STATUS_NORMAL);
41
	fail_unless(g_io_channel_flush(ch2, NULL) == G_IO_STATUS_NORMAL);
41
	fail_unless(g_io_channel_flush(ch2, NULL) == G_IO_STATUS_NORMAL);
42
42
43
	g_main_iteration(FALSE);
43
	g_main_iteration(FALSE);

Return to bug 217660