Changes in / [728a981:96ace1b]
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r728a981 r96ace1b 11 11 encode 12 12 bitlbee.pc 13 .gdb_history -
doc/user-guide/commands.xml
r728a981 r96ace1b 197 197 <syntax>block <nick></syntax> 198 198 <syntax>block <connection> <handle></syntax> 199 <syntax>block <connection></syntax>200 199 201 200 <description> 202 201 <para> 203 202 Puts the specified user on your ignore list. Either specify the user's nick when you have him/her in your contact list or a connection number and a user handle. 204 </para>205 206 <para>207 When called with only a connection specification as an argument, the command displays the current block list for that connection.208 203 </para> 209 204 </description> … … 219 214 Reverse of block. Unignores the specified user or user handle on specified connection. 220 215 </para> 221 222 <para>223 When called with only a connection specification as an argument, the command displays the current allow list for that connection.224 </para>225 216 </description> 226 217 </bitlbee-command> -
help.c
r728a981 r96ace1b 116 116 h = h->next; 117 117 } 118 if( h && h->length > 0)118 if( h ) 119 119 { 120 120 char *s = g_new( char, h->length + 1 ); … … 123 123 { 124 124 g_free( h ); 125 *help =NULL;126 return NULL;125 *help=NULL; 126 return( NULL ); 127 127 } 128 128 mtime = stat->st_mtime; 129 129 130 if( mtime > h->mtime ) 131 return NULL; 132 130 if( mtime > h->mtime ) { 131 return( NULL ); 132 return( g_strdup( "Help file changed during this session. Please restart to get help back." ) ); 133 } 133 134 s[h->length] = 0; 134 135 if( h->fd >= 0 ) … … 141 142 strncpy( s, h->offset.mem_offset, h->length ); 142 143 } 143 return s;144 return( s ); 144 145 } 145 146 146 return NULL;147 return( NULL ); 147 148 } -
ipc.c
r728a981 r96ace1b 84 84 void ipc_master_cmd_restart( irc_t *data, char **cmd ) 85 85 { 86 struct bitlbee_child *child = (void*) data; 87 86 88 if( global.conf->runmode != RUNMODE_FORKDAEMON ) 87 89 { -
irc.c
r728a981 r96ace1b 232 232 irc_connection_list = g_slist_remove( irc_connection_list, irc ); 233 233 234 for (account = irc->accounts; account; account = account->next) {234 for (account = irc->accounts; account; account = account->next) 235 235 if (account->gc) 236 account_offline(account->gc); 237 else if (account->reconnect) 238 g_source_remove(account->reconnect); 239 } 236 signoff(account->gc); 240 237 241 238 g_free(irc->sendbuffer); -
irc.h
r728a981 r96ace1b 33 33 #define IRC_PING_STRING "PinglBee" 34 34 35 #define UMODES " abisw"35 #define UMODES "iasw" 36 36 #define UMODES_PRIV "Ro" 37 37 #define CMODES "nt" -
irc_commands.c
r728a981 r96ace1b 509 509 irc->last_pong = gettime(); 510 510 irc->pinging = 0; 511 }512 513 static void irc_cmd_version( irc_t *irc, char **cmd )514 {515 irc_reply( irc, 351, "bitlbee-%s. %s :%s/%s ", BITLBEE_VERSION, irc->myhost, ARCH, CPU );516 511 } 517 512 … … 573 568 { "motd", 0, irc_cmd_motd, IRC_CMD_LOGGED_IN }, 574 569 { "pong", 0, irc_cmd_pong, IRC_CMD_LOGGED_IN }, 575 { "version", 0, irc_cmd_version, IRC_CMD_LOGGED_IN },576 570 { "completions", 0, irc_cmd_completions, IRC_CMD_LOGGED_IN }, 577 571 { "die", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER }, -
protocols/jabber/jabber.c
r728a981 r96ace1b 1232 1232 } 1233 1233 1234 account_online(GJ_GC(gjc)); 1234 x = jutil_presnew(0, NULL, "Online"); 1235 gjab_send(gjc, x); 1236 xmlnode_free(x); 1235 1237 } 1236 1238 … … 1248 1250 } else { 1249 1251 gjab_reqroster(gjc); 1252 account_online(GJ_GC(gjc)); 1250 1253 1251 1254 ((struct jabber_data *)GJ_GC(gjc)->proto_data)->did_import = TRUE; -
protocols/msn/msn.h
r728a981 r96ace1b 66 66 GSList *msgq; 67 67 GSList *switchboards; 68 int buddycount; 68 69 const struct msn_away_state *away_state; 69 70 int buddycount;71 int groupcount;72 char **grouplist;73 70 }; 74 71 -
protocols/msn/msn_util.c
r728a981 r96ace1b 46 46 int msn_logged_in( struct gaim_connection *gc ) 47 47 { 48 struct msn_data *md = gc->proto_data; 49 char buf[1024]; 50 48 51 account_online( gc ); 52 53 /* account_online() sets an away state if there is any, so only 54 execute this code if we're not away. */ 55 if( md->away_state == msn_away_state_list ) 56 { 57 g_snprintf( buf, sizeof( buf ), "CHG %d %s %d\r\n", ++md->trId, md->away_state->code, 0 ); 58 return( msn_write( gc, buf, strlen( buf ) ) ); 59 } 49 60 50 61 return( 0 ); -
protocols/msn/ns.c
r728a981 r96ace1b 257 257 { 258 258 md->buddycount = atoi( cmd[3] ); 259 md->groupcount = atoi( cmd[4] );260 if( md->groupcount > 0 )261 md->grouplist = g_new0( char *, md->groupcount );262 259 263 260 if( !*cmd[3] || md->buddycount == 0 ) … … 272 269 } 273 270 } 271 else if( strcmp( cmd[0], "GTC" ) == 0 ) 272 { 273 } 274 else if( strcmp( cmd[0], "BLP" ) == 0 ) 275 { 276 } 277 else if( strcmp( cmd[0], "PRP" ) == 0 ) 278 { 279 } 280 else if( strcmp( cmd[0], "LSG" ) == 0 ) 281 { 282 } 274 283 else if( strcmp( cmd[0], "LST" ) == 0 ) 275 284 { … … 288 297 if( list & 1 ) /* FL */ 289 298 { 290 char *group = NULL; 291 int num; 292 293 if( cmd[4] != NULL && sscanf( cmd[4], "%d", &num ) == 1 ) 294 group = md->grouplist[num]; 295 296 add_buddy( gc, group, cmd[1], cmd[2] ); 299 add_buddy( gc, NULL, cmd[1], cmd[2] ); 297 300 } 298 301 if( list & 2 ) /* AL */ … … 324 327 } 325 328 } 326 else if( strcmp( cmd[0], "LSG" ) == 0 ) 327 { 328 int num; 329 330 if( num_parts != 4 ) 331 { 332 hide_login_progress_error( gc, "Syntax error" ); 333 signoff( gc ); 334 return( 0 ); 335 } 336 337 http_decode( cmd[2] ); 338 num = atoi( cmd[1] ); 339 340 if( num < md->groupcount ) 341 md->grouplist[num] = g_strdup( cmd[2] ); 329 else if( strcmp( cmd[0], "BPR" ) == 0 ) 330 { 331 } 332 else if( strcmp( cmd[0], "CHG" ) == 0 ) 333 { 342 334 } 343 335 else if( strcmp( cmd[0], "CHL" ) == 0 ) … … 365 357 return( msn_write( gc, buf, strlen( buf ) ) ); 366 358 } 359 else if( strcmp( cmd[0], "QRY" ) == 0 ) 360 { 361 } 362 else if( strcmp( cmd[0], "QNG" ) == 0 ) 363 { 364 } 367 365 else if( strcmp( cmd[0], "ILN" ) == 0 ) 368 366 { … … 480 478 msn_buddy_ask( gc, cmd[4], cmd[5] ); 481 479 } 480 } 481 else if( strcmp( cmd[0], "REM" ) == 0 ) 482 { 482 483 } 483 484 else if( strcmp( cmd[0], "OUT" ) == 0 ) -
protocols/msn/sb.c
r728a981 r96ace1b 202 202 debug( "Destroying switchboard: %s", sb->who ? sb->who : sb->key ? sb->key : "" ); 203 203 204 if( sb->key ) g_free( sb->key ); 205 if( sb->who ) g_free( sb->who ); 206 204 207 if( sb->msgq ) 205 208 { … … 219 222 serv_got_crap( gc, "Warning: Closing down MSN switchboard connection with " 220 223 "unsent message to %s, you'll have to resend it.", 221 sb->who ? sb->who : "(unknown)" ); 222 } 223 224 if( sb->key ) g_free( sb->key ); 225 if( sb->who ) g_free( sb->who ); 224 m->who ? m->who : "(unknown)" ); 225 } 226 226 227 227 if( sb->chat ) -
protocols/nogaim.c
r728a981 r96ace1b 14 14 * (except for the function names). 15 15 * 16 * Copyright 2002-200 6 Wilmer van der Gaast <wilmer@gaast.net> and others16 * Copyright 2002-2004 Wilmer van der Gaast <lintux@lintux.cx> 17 17 */ 18 18 … … 39 39 #include <iconv.h> 40 40 41 static char *proto_away_alias[ 8][5] =41 static char *proto_away_alias[7][5] = 42 42 { 43 43 { "Away from computer", "Away", "Extended away", NULL }, … … 47 47 { "On the phone", "Phone", "On phone", NULL }, 48 48 { "Out to lunch", "Lunch", "Food", NULL }, 49 { "Invisible", "Hidden" },50 49 { NULL } 51 50 }; … … 306 305 { 307 306 va_list params; 308 char text[1024], buf[1024], *acc_id;307 char text[1024], buf[1024], acc_id[33]; 309 308 char *msg; 310 309 account_t *a; … … 331 330 /* If we found one, add the screenname to the acc_id. */ 332 331 if( a ) 333 acc_id = g_strdup_printf("%s(%s)", gc->prpl->name, gc->username );332 g_snprintf( acc_id, 32, "%s(%s)", gc->prpl->name, gc->username ); 334 333 else 335 acc_id = g_strdup(gc->prpl->name );334 g_snprintf( acc_id, 32, "%s", gc->prpl->name ); 336 335 337 336 irc_usermsg( gc->irc, "%s - %s", acc_id, msg ); 338 339 g_free( acc_id );340 337 } 341 338 … … 355 352 356 353 /* MSN servers sometimes redirect you to a different server and do 357 the whole login sequence again, so these "late"calls to this354 the whole login sequence again, so subsequent calls to this 358 355 function should be handled correctly. (IOW, ignored) */ 359 356 if( gc->flags & OPT_LOGGED_IN ) … … 367 364 gc->flags |= OPT_LOGGED_IN; 368 365 369 /* Also necessary when we're not away, at least for some of the 370 protocols. */ 371 proto_away( gc, u->away ); 372 373 if( strcmp( gc->prpl->name, "ICQ" ) == 0 ) 366 if( u && u->away ) proto_away( gc, u->away ); 367 368 if( !strcmp(gc->prpl->name, "icq") ) 374 369 { 375 370 for( u = gc->irc->users; u; u = u->next ) … … 475 470 /* list.c */ 476 471 472 int bud_list_cache_exists( struct gaim_connection *gc ) 473 { 474 return( 0 ); 475 } 476 477 void do_import( struct gaim_connection *gc, void *null ) 478 { 479 return; 480 } 481 477 482 void add_buddy( struct gaim_connection *gc, char *group, char *handle, char *realname ) 478 483 { … … 526 531 u->gc = gc; 527 532 u->handle = g_strdup( handle ); 528 if( group ) u->group = g_strdup( group );529 533 u->send_handler = buddy_send_handler; 530 534 u->last_typing_notice = 0; … … 548 552 549 553 return( b ); 554 } 555 556 void do_export( struct gaim_connection *gc ) 557 { 558 return; 550 559 } 551 560 … … 873 882 874 883 return( c ); 884 } 885 886 void serv_finish_login( struct gaim_connection *gc ) 887 { 888 return; 875 889 } 876 890 -
protocols/oscar/oscar.c
r728a981 r96ace1b 356 356 if (isdigit(*user->username)) { 357 357 odata->icq = TRUE; 358 /* This is odd but it's necessary for a proper do_import and do_export. 359 We don't do those anymore, but let's stick with it, just in case 360 it accidentally fixes something else too... */ 358 /* this is odd but it's necessary for a proper do_import and do_export */ 361 359 gc->password[8] = 0; 362 360 } else { … … 1150 1148 reason = msg + 6; 1151 1149 1152 dialog_msg = g_strdup_printf("The user %u wants to add you to their buddy list for the following reason: 1150 dialog_msg = g_strdup_printf("The user %u wants to add you to their buddy list for the following reason:\n\n%s", uin, reason ? reason : "No reason given."); 1153 1151 data->gc = gc; 1154 1152 data->uin = uin; … … 1739 1737 odata->rights.maxdenies = (guint)maxdenies; 1740 1738 1739 // serv_finish_login(gc); 1740 1741 if (bud_list_cache_exists(gc)) 1742 do_import(gc, NULL); 1743 1741 1744 aim_clientready(sess, fr->conn); 1742 1745 … … 2093 2096 } /* End of for loop */ 2094 2097 2098 if (tmp) 2099 do_export(gc); 2095 2100 aim_ssi_enable(sess, fr->conn); 2096 2101 -
protocols/ssl_openssl.c
r728a981 r96ace1b 5 5 \********************************************************************/ 6 6 7 /* SSL module - Open SSL version*/7 /* SSL module - OpenTLS version */ 8 8 9 9 /* … … 41 41 struct scd 42 42 { 43 ssl_input_function func;43 SslInputFunction func; 44 44 gpointer data; 45 45 int fd; 46 46 gboolean established; 47 47 48 int inpa;49 int lasterr; /* Necessary for SSL_get_error */50 48 SSL *ssl; 51 49 SSL_CTX *ssl_ctx; … … 56 54 57 55 58 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )56 void *ssl_connect( char *host, int port, SslInputFunction func, gpointer data ) 59 57 { 60 58 struct scd *conn = g_new0( struct scd, 1 ); … … 95 93 } 96 94 97 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond );98 99 95 static void ssl_connected( gpointer data, gint source, GaimInputCondition cond ) 100 96 { … … 102 98 103 99 if( source == -1 ) 104 return ssl_handshake( data, -1, cond );100 goto ssl_connected_failure; 105 101 106 /* Make it non-blocking at least during the handshake... */107 sock_make_nonblocking( conn->fd );108 102 SSL_set_fd( conn->ssl, conn->fd ); 109 103 110 return ssl_handshake( data, source, cond ); 111 } 112 113 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond ) 114 { 115 struct scd *conn = data; 116 int st; 117 118 if( conn->inpa != -1 ) 119 { 120 gaim_input_remove( conn->inpa ); 121 conn->inpa = -1; 122 } 123 124 if( ( st = SSL_connect( conn->ssl ) ) < 0 ) 125 { 126 conn->lasterr = SSL_get_error( conn->ssl, st ); 127 if( conn->lasterr != SSL_ERROR_WANT_READ && conn->lasterr != SSL_ERROR_WANT_WRITE ) 128 goto ssl_connected_failure; 129 130 conn->inpa = gaim_input_add( conn->fd, ssl_getdirection( conn ), ssl_handshake, data ); 131 return; 132 } 104 if( SSL_connect( conn->ssl ) < 0 ) 105 goto ssl_connected_failure; 133 106 134 107 conn->established = TRUE; 135 sock_make_blocking( conn->fd ); /* For now... */136 108 conn->func( conn->data, conn, cond ); 137 109 return; … … 155 127 int ssl_read( void *conn, char *buf, int len ) 156 128 { 157 int st; 129 if( !((struct scd*)conn)->established ) 130 return( 0 ); 158 131 159 if( !((struct scd*)conn)->established ) 160 { 161 ssl_errno = SSL_NOHANDSHAKE; 162 return -1; 163 } 164 165 st = SSL_read( ((struct scd*)conn)->ssl, buf, len ); 166 167 ssl_errno = SSL_OK; 168 if( st <= 0 ) 169 { 170 ((struct scd*)conn)->lasterr = SSL_get_error( ((struct scd*)conn)->ssl, st ); 171 if( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_READ || ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ) 172 ssl_errno = SSL_AGAIN; 173 } 174 175 return st; 132 return( SSL_read( ((struct scd*)conn)->ssl, buf, len ) ); 176 133 } 177 134 178 135 int ssl_write( void *conn, const char *buf, int len ) 179 136 { 180 int st; 137 if( !((struct scd*)conn)->established ) 138 return( 0 ); 181 139 182 if( !((struct scd*)conn)->established ) 183 { 184 ssl_errno = SSL_NOHANDSHAKE; 185 return -1; 186 } 187 188 st = SSL_write( ((struct scd*)conn)->ssl, buf, len ); 189 190 ssl_errno = SSL_OK; 191 if( st <= 0 ) 192 { 193 ((struct scd*)conn)->lasterr = SSL_get_error( ((struct scd*)conn)->ssl, st ); 194 if( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_READ || ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ) 195 ssl_errno = SSL_AGAIN; 196 } 197 198 return st; 140 return( SSL_write( ((struct scd*)conn)->ssl, buf, len ) ); 199 141 } 200 142 … … 202 144 { 203 145 struct scd *conn = conn_; 204 205 if( conn->inpa != -1 )206 gaim_input_remove( conn->inpa );207 146 208 147 if( conn->established ) … … 220 159 return( ((struct scd*)conn)->fd ); 221 160 } 222 223 GaimInputCondition ssl_getdirection( void *conn )224 {225 return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? GAIM_INPUT_WRITE : GAIM_INPUT_READ );226 } -
query.c
r728a981 r96ace1b 39 39 q->no = no; 40 40 q->data = data; 41 42 if( strchr( irc->umode, 'b' ) != NULL )43 {44 char *s;45 46 /* At least for the machine-parseable version, get rid of47 newlines to make "parsing" easier. */48 for( s = q->question; *s; s ++ )49 if( *s == '\r' || *s == '\n' )50 *s = ' ';51 }52 41 53 42 if( irc->queries ) … … 138 127 disp = 1; 139 128 } 129 //Using irc_usermsg instead of serv_got_crap because \x02A is a char too, so a SPACE is needed. 140 130 if( ans ) 141 131 { -
root_commands.c
r728a981 r96ace1b 484 484 account_t *a; 485 485 486 if( !cmd[2] && ( a = account_get( irc, cmd[1] ) ) && a->gc ) 487 { 488 char *format; 489 GSList *l; 490 491 if( strchr( irc->umode, 'b' ) != NULL ) 492 format = "%s\t%s"; 493 else 494 format = "%-32.32 %-16.16s"; 495 496 irc_usermsg( irc, format, "Handle", "Nickname" ); 497 for( l = a->gc->deny; l; l = l->next ) 498 { 499 user_t *u = user_findhandle( a->gc, l->data ); 500 irc_usermsg( irc, format, l->data, u ? u->nick : "(none)" ); 501 } 502 irc_usermsg( irc, "End of list." ); 503 504 return; 505 } 506 else if( !cmd[2] ) 486 if( !cmd[2] ) 507 487 { 508 488 user_t *u = user_find( irc, cmd[1] ); … … 543 523 account_t *a; 544 524 545 if( !cmd[2] && ( a = account_get( irc, cmd[1] ) ) && a->gc ) 546 { 547 char *format; 548 GSList *l; 549 550 if( strchr( irc->umode, 'b' ) != NULL ) 551 format = "%s\t%s"; 552 else 553 format = "%-32.32 %-16.16s"; 554 555 irc_usermsg( irc, format, "Handle", "Nickname" ); 556 for( l = a->gc->deny; l; l = l->next ) 557 { 558 user_t *u = user_findhandle( a->gc, l->data ); 559 irc_usermsg( irc, format, l->data, u ? u->nick : "(none)" ); 560 } 561 irc_usermsg( irc, "End of list." ); 562 563 return; 564 } 565 else if( !cmd[2] ) 525 if( !cmd[2] ) 566 526 { 567 527 user_t *u = user_find( irc, cmd[1] ); … … 675 635 int online = 0, away = 0, offline = 0; 676 636 user_t *u; 677 char s[256]; 678 char *format; 637 char s[64]; 679 638 int n_online = 0, n_away = 0, n_offline = 0; 680 639 … … 690 649 online = away = 1; 691 650 692 if( strchr( irc->umode, 'b' ) != NULL ) 693 format = "%s\t%s\t%s"; 694 else 695 format = "%-16.16s %-40.40s %s"; 696 697 irc_usermsg( irc, format, "Nick", "User/Host/Network", "Status" ); 698 699 for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away ) 700 { 701 if( online == 1 ) 702 { 703 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 704 irc_usermsg( irc, format, u->nick, s, "Online" ); 705 } 706 651 irc_usermsg( irc, "%-16.16s %-40.40s %s", "Nick", "User/Host/Network", "Status" ); 652 653 if( online == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away ) 654 { 655 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 656 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Online" ); 707 657 n_online ++; 708 658 } 709 659 710 for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away ) 711 { 712 if( away == 1 ) 713 { 714 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 715 irc_usermsg( irc, format, u->nick, s, u->away ); 716 } 660 if( away == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away ) 661 { 662 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 663 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, u->away ); 717 664 n_away ++; 718 665 } 719 666 720 for( u = irc->users; u; u = u->next ) if( u->gc && !u->online ) 721 { 722 if( offline == 1 ) 723 { 724 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 725 irc_usermsg( irc, format, u->nick, s, "Offline" ); 726 } 667 if( offline == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && !u->online ) 668 { 669 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 670 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Offline" ); 727 671 n_offline ++; 728 672 } -
user.h
r728a981 r96ace1b 37 37 38 38 char *handle; 39 char *group;40 39 struct gaim_connection *gc; 41 40
Note: See TracChangeset
for help on using the changeset viewer.