Changes in commands.c [576d6d7:7b23afd]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r576d6d7 r7b23afd 52 52 { "import_buddies", 1, cmd_import_buddies }, 53 53 { "qlist", 0, cmd_qlist }, 54 { "dump", 0, cmd_dump }, 54 55 { NULL } 55 56 }; … … 184 185 if( g_strcasecmp( cmd[1], "add" ) == 0 ) 185 186 { 186 int prot;187 struct prpl *prpl; 187 188 188 189 if( cmd[2] == NULL || cmd[3] == NULL || cmd[4] == NULL ) … … 192 193 } 193 194 194 for( prot = 0; prot < PROTO_MAX; prot ++ ) 195 if( proto_name[prot] && *proto_name[prot] && g_strcasecmp( proto_name[prot], cmd[2] ) == 0 ) 196 break; 197 198 if( ( prot == PROTO_MAX ) || ( proto_prpl[prot] == NULL ) ) 195 prpl = find_protocol(cmd[2]); 196 197 if( prpl == NULL ) 199 198 { 200 199 irc_usermsg( irc, "Unknown protocol" ); … … 202 201 } 203 202 204 if( prot == PROTO_OSCAR && cmd[5] == NULL ) 205 { 206 irc_usermsg( irc, "Not enough parameters" ); 207 return( 0 ); 208 } 209 210 a = account_add( irc, prot, cmd[3], cmd[4] ); 203 a = account_add( irc, prpl, cmd[3], cmd[4] ); 211 204 212 205 if( cmd[5] ) … … 252 245 con = ""; 253 246 254 if( a->protocol == PROTO_OSCAR || a->protocol == PROTO_ICQ || a->protocol == PROTO_TOC ) 255 irc_usermsg( irc, "%2d. OSCAR, %s on %s%s", i, a->user, a->server, con ); 256 else 257 irc_usermsg( irc, "%2d. %s, %s%s", i, proto_name[a->protocol], a->user, con ); 247 irc_usermsg( irc, "%2d. %s, %s%s", i, a->prpl->name, a->user, con ); 258 248 259 249 i ++; … … 372 362 else 373 363 { 374 nick_set( irc, cmd[2], a->gc->pr otocol, cmd[3] );364 nick_set( irc, cmd[2], a->gc->prpl, cmd[3] ); 375 365 } 376 366 } … … 453 443 else if( u->send_handler == buddy_send_handler ) 454 444 { 455 nick_set( irc, u->handle, u->gc->pr otocol, cmd[2] );445 nick_set( irc, u->handle, u->gc->prpl, cmd[2] ); 456 446 } 457 447 … … 664 654 if( online == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away ) 665 655 { 666 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol]);656 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 667 657 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Online" ); 668 658 n_online ++; … … 671 661 if( away == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away ) 672 662 { 673 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol]);663 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 674 664 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, u->away ); 675 665 n_away ++; … … 678 668 if( offline == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && !u->online ) 679 669 { 680 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol]);670 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 681 671 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Offline" ); 682 672 n_offline ++; … … 784 774 for( n = gc->irc->nicks; n; n = n->next ) 785 775 { 786 if( n->proto == gc->pr otocol && !user_findhandle( gc, n->handle ) )776 if( n->proto == gc->prpl && !user_findhandle( gc, n->handle ) ) 787 777 { 788 778 gc->prpl->add_buddy( gc, n->handle ); … … 795 785 return( 0 ); 796 786 } 787 788 int cmd_dump( irc_t *irc, char **cmd ) { 789 write_io_activity(); 790 irc_usermsg(irc, "Wrote GIO activity log to disk."); 791 792 return( 0 ); 793 }
Note: See TracChangeset
for help on using the changeset viewer.