Changeset fef6116
- Timestamp:
- 2006-07-01T19:17:42Z (18 years ago)
- Branches:
- master
- Children:
- 96863f6
- Parents:
- 5100caa (diff), 3f9440d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
account.c
r5100caa rfef6116 72 72 73 73 /* Double-check: We refuse to edit on-line accounts. */ 74 if( acc->gc )74 if( set->flags & ACC_SET_OFFLINE_ONLY && acc->gc ) 75 75 return NULL; 76 76 -
irc.c
r5100caa rfef6116 649 649 void irc_names( irc_t *irc, char *channel ) 650 650 { 651 user_t *u = irc->users; 652 char *s; 653 int control = ( g_strcasecmp( channel, irc->channel ) == 0 ); 651 user_t *u; 652 char namelist[385] = ""; 654 653 struct conversation *c = NULL; 655 656 if( !control )657 c = conv_findchannel( channel );658 654 659 655 /* RFCs say there is no error reply allowed on NAMES, so when the 660 656 channel is invalid, just give an empty reply. */ 661 657 662 if( control || c ) while( u)663 { 664 if( u->online )665 { 666 if( u->gc && control)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 ) 667 663 { 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 ); 664 irc_reply( irc, 353, "= %s :%s", channel, namelist ); 665 *namelist = 0; 674 666 } 675 else if( !u->gc ) 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 ) ) ) 676 { 677 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 ) 676 688 { 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 ); 689 irc_reply( irc, 353, "= %s :%s", channel, namelist ); 690 *namelist = 0; 685 691 } 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 ) 694 { 695 GList *l; 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 } 692 693 strcat( namelist, u->nick ); 694 strcat( namelist, " " ); 695 } 696 } 697 698 if( *namelist ) 699 irc_reply( irc, 353, "= %s :%s", channel, namelist ); 701 700 702 701 irc_reply( irc, 366, "%s :End of /NAMES list", channel ); -
set.h
r5100caa rfef6116 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 ); 47 48 int set_setstr( set_t **head, char *key, char *value ); 48 49 int set_setint( set_t **head, char *key, int value );
Note: See TracChangeset
for help on using the changeset viewer.