Changeset 7f4016b
- Timestamp:
- 2008-02-11T15:14:57Z (17 years ago)
- Branches:
- master
- Children:
- 3b8e8109
- Parents:
- 8c2b1c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r8c2b1c3 r7f4016b 641 641 } 642 642 643 const char *user_mode_prefix( irc_t *irc, user_t *u ) 644 { 645 static char op[] = "@"; 646 static char halfop[] = "%"; 647 static char voice[] = "+"; 648 static char none[] = ""; 649 650 int or = set_getbool(&irc->set, "op_root"); 651 int ou = set_getbool(&irc->set, "op_user"); 652 char *ob = set_getstr(&irc->set, "op_buddies"); 653 char *hb = set_getstr(&irc->set, "halfop_buddies"); 654 char *vb = set_getstr(&irc->set, "voice_buddies"); 655 656 if( (!strcmp(u->nick, irc->mynick) && or) || 657 (!strcmp(u->nick, irc->nick) && ou) || 658 (!u->away && !strcmp(ob, "notaway")) || 659 (u->encrypted && !strcmp(ob, "encrypted")) || 660 (u->encrypted>1 && !strcmp(ob, "trusted")) 661 ) 662 return op; 663 else if( (!u->away && !strcmp(hb, "notaway")) || 664 (u->encrypted && !strcmp(hb, "encrypted")) || 665 (u->encrypted>1 && !strcmp(hb, "trusted")) 666 ) 667 return halfop; 668 else if( (!u->away && !strcmp(vb, "notaway")) || 669 (u->encrypted && !strcmp(vb, "encrypted")) || 670 (u->encrypted>1 && !strcmp(vb, "trusted")) 671 ) 672 return voice; 673 else 674 return none; 675 } 676 643 677 void irc_names( irc_t *irc, char *channel ) 644 678 { … … 646 680 char namelist[385] = ""; 647 681 struct groupchat *c = NULL; 648 char *oo = set_getstr(&irc->set, "op_buddies");649 char *vo = set_getstr(&irc->set, "voice_buddies");650 682 651 683 /* RFCs say there is no error reply allowed on NAMES, so when the … … 662 694 } 663 695 664 if( u->ic && !u->away && !strcmp(vo, "notaway") ) 665 strcat( namelist, "+" ); 666 else if( ( strcmp( u->nick, irc->mynick ) == 0 && set_getbool(&irc->set, "op_root") ) || 667 ( strcmp( u->nick, irc->nick ) == 0 && set_getbool(&irc->set, "op_user") ) || 668 ( !u->away && !strcmp(oo, "notaway") ) || 669 ( u->encrypted>1 && !strcmp(oo, "trusted") ) || 670 ( u->encrypted && !strcmp(oo, "encrypted") ) ) 671 strcat( namelist, "@" ); 672 696 strcat( namelist, user_mode_prefix(irc, u) ); 673 697 strcat( namelist, u->nick ); 674 698 strcat( namelist, " " );
Note: See TracChangeset
for help on using the changeset viewer.