Changeset 7b23afd for commands.c
- Timestamp:
- 2005-11-07T16:16:18Z (19 years ago)
- Branches:
- master
- Children:
- f7f3ada
- Parents:
- fe51bcf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
rfe51bcf r7b23afd 185 185 if( g_strcasecmp( cmd[1], "add" ) == 0 ) 186 186 { 187 int prot;187 struct prpl *prpl; 188 188 189 189 if( cmd[2] == NULL || cmd[3] == NULL || cmd[4] == NULL ) … … 193 193 } 194 194 195 for( prot = 0; prot < PROTO_MAX; prot ++ ) 196 if( proto_name[prot] && *proto_name[prot] && g_strcasecmp( proto_name[prot], cmd[2] ) == 0 ) 197 break; 198 199 if( ( prot == PROTO_MAX ) || ( proto_prpl[prot] == NULL ) ) 195 prpl = find_protocol(cmd[2]); 196 197 if( prpl == NULL ) 200 198 { 201 199 irc_usermsg( irc, "Unknown protocol" ); … … 203 201 } 204 202 205 if( prot == PROTO_OSCAR && cmd[5] == NULL ) 206 { 207 irc_usermsg( irc, "Not enough parameters" ); 208 return( 0 ); 209 } 210 211 a = account_add( irc, prot, cmd[3], cmd[4] ); 203 a = account_add( irc, prpl, cmd[3], cmd[4] ); 212 204 213 205 if( cmd[5] ) … … 253 245 con = ""; 254 246 255 if( a->protocol == PROTO_OSCAR || a->protocol == PROTO_ICQ || a->protocol == PROTO_TOC ) 256 irc_usermsg( irc, "%2d. OSCAR, %s on %s%s", i, a->user, a->server, con ); 257 else 258 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 ); 259 248 260 249 i ++; … … 373 362 else 374 363 { 375 nick_set( irc, cmd[2], a->gc->pr otocol, cmd[3] );364 nick_set( irc, cmd[2], a->gc->prpl, cmd[3] ); 376 365 } 377 366 } … … 454 443 else if( u->send_handler == buddy_send_handler ) 455 444 { 456 nick_set( irc, u->handle, u->gc->pr otocol, cmd[2] );445 nick_set( irc, u->handle, u->gc->prpl, cmd[2] ); 457 446 } 458 447 … … 665 654 if( online == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away ) 666 655 { 667 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 ); 668 657 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Online" ); 669 658 n_online ++; … … 672 661 if( away == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away ) 673 662 { 674 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 ); 675 664 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, u->away ); 676 665 n_away ++; … … 679 668 if( offline == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && !u->online ) 680 669 { 681 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 ); 682 671 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Offline" ); 683 672 n_offline ++; … … 785 774 for( n = gc->irc->nicks; n; n = n->next ) 786 775 { 787 if( n->proto == gc->pr otocol && !user_findhandle( gc, n->handle ) )776 if( n->proto == gc->prpl && !user_findhandle( gc, n->handle ) ) 788 777 { 789 778 gc->prpl->add_buddy( gc, n->handle );
Note: See TracChangeset
for help on using the changeset viewer.