Changes in / [fef6116:5100caa]
Legend:
- Unmodified
- Added
- Removed
-
account.c
rfef6116 r5100caa 72 72 73 73 /* Double-check: We refuse to edit on-line accounts. */ 74 if( set->flags & ACC_SET_OFFLINE_ONLY &&acc->gc )74 if( acc->gc ) 75 75 return NULL; 76 76 -
irc.c
rfef6116 r5100caa 649 649 void irc_names( irc_t *irc, char *channel ) 650 650 { 651 user_t *u; 652 char namelist[385] = ""; 651 user_t *u = irc->users; 652 char *s; 653 int control = ( g_strcasecmp( channel, irc->channel ) == 0 ); 653 654 struct conversation *c = NULL; 655 656 if( !control ) 657 c = conv_findchannel( channel ); 654 658 655 659 /* RFCs say there is no error reply allowed on NAMES, so when the 656 660 channel is invalid, just give an empty reply. */ 657 661 658 if( g_strcasecmp( channel, irc->channel ) == 0)659 { 660 for( u = irc->users; u; u = u->next )if( u->online )661 { 662 if( strlen( namelist ) + strlen( u->nick ) > sizeof( namelist ) - 4)662 if( control || c ) while( u ) 663 { 664 if( u->online ) 665 { 666 if( u->gc && control ) 663 667 { 664 irc_reply( irc, 353, "= %s :%s", channel, namelist ); 665 *namelist = 0; 668 if( set_getint( &irc->set, "away_devoice" ) && !u->away ) 669 s = "+"; 670 else 671 s = ""; 672 673 irc_reply( irc, 353, "= %s :%s%s", channel, s, u->nick ); 666 674 } 667 668 if( u->gc && !u->away && set_getbool( &irc->set, "away_devoice" ) ) 669 strcat( namelist, "+" ); 670 671 strcat( namelist, u->nick ); 672 strcat( namelist, " " ); 673 } 674 } 675 else if( ( c = conv_findchannel( channel ) ) ) 675 else if( !u->gc ) 676 { 677 if( strcmp( u->nick, irc->mynick ) == 0 && ( strcmp( set_getstr( &irc->set, "ops" ), "root" ) == 0 || strcmp( set_getstr( &irc->set, "ops" ), "both" ) == 0 ) ) 678 s = "@"; 679 else if( strcmp( u->nick, irc->nick ) == 0 && ( strcmp( set_getstr( &irc->set, "ops" ), "user" ) == 0 || strcmp( set_getstr( &irc->set, "ops" ), "both" ) == 0 ) ) 680 s = "@"; 681 else 682 s = ""; 683 684 irc_reply( irc, 353, "= %s :%s%s", channel, s, u->nick ); 685 } 686 } 687 688 u = u->next; 689 } 690 691 /* For non-controlchannel channels (group conversations) only root and 692 you are listed now. Time to show the channel people: */ 693 if( !control && c ) 676 694 { 677 695 GList *l; 678 char *ops = set_getstr( &irc->set, "ops" ); 679 680 /* root and the user aren't in the channel userlist but should 681 show up in /NAMES, so list them first: */ 682 sprintf( namelist, "%s%s %s%s ", strcmp( ops, "root" ) == 0 || strcmp( ops, "both" ) ? "@" : "", irc->mynick, 683 strcmp( ops, "user" ) == 0 || strcmp( ops, "both" ) ? "@" : "", irc->nick ); 684 685 for( l = c->in_room; l; l = l->next ) if( ( u = user_findhandle( c->gc, l->data ) ) ) 686 { 687 if( strlen( namelist ) + strlen( u->nick ) > sizeof( namelist ) - 4 ) 688 { 689 irc_reply( irc, 353, "= %s :%s", channel, namelist ); 690 *namelist = 0; 691 } 692 693 strcat( namelist, u->nick ); 694 strcat( namelist, " " ); 695 } 696 } 697 698 if( *namelist ) 699 irc_reply( irc, 353, "= %s :%s", channel, namelist ); 696 697 for( l = c->in_room; l; l = l->next ) 698 if( ( u = user_findhandle( c->gc, l->data ) ) ) 699 irc_reply( irc, 353, "= %s :%s%s", channel, "", u->nick ); 700 } 700 701 701 702 irc_reply( irc, 366, "%s :End of /NAMES list", channel ); -
set.h
rfef6116 r5100caa 45 45 G_MODULE_EXPORT char *set_getstr( set_t **head, char *key ); 46 46 G_MODULE_EXPORT int set_getint( set_t **head, char *key ); 47 G_MODULE_EXPORT int set_getbool( set_t **head, char *key );48 47 int set_setstr( set_t **head, char *key, char *value ); 49 48 int set_setint( set_t **head, char *key, int value );
Note: See TracChangeset
for help on using the changeset viewer.