Changes in protocols/nogaim.c [52e6e17:31e5846]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
r52e6e17 r31e5846 603 603 604 604 /* LISPy... */ 605 if( ( u->online ) && /* Don't touch offline people */ 606 ( ( ( u->online != oo ) && !u->away ) || /* Do joining people */ 607 ( ( u->online == oo ) && ( oa == !u->away ) ) ) ) /* Do people changing state */ 605 if( ( set_getbool( &ic->irc->set, "away_devoice" ) ) && /* Don't do a thing when user doesn't want it */ 606 ( u->online ) && /* Don't touch offline people */ 607 ( ( ( u->online != oo ) && !u->away ) || /* Voice joining people */ 608 ( ( u->online == oo ) && ( oa == !u->away ) ) ) ) /* (De)voice people changing state */ 608 609 { 609 610 char *from; … … 618 619 ic->irc->myhost ); 619 620 } 620 if(!strcmp(set_getstr(&ic->irc->set, "voice_buddies"), "notaway")) { 621 irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, 622 u->away?'-':'+', u->nick ); 623 } 624 if(!strcmp(set_getstr(&ic->irc->set, "halfop_buddies"), "notaway")) { 625 irc_write( ic->irc, ":%s MODE %s %ch %s", from, ic->irc->channel, 626 u->away?'-':'+', u->nick ); 627 } 628 if(!strcmp(set_getstr(&ic->irc->set, "op_buddies"), "notaway")) { 629 irc_write( ic->irc, ":%s MODE %s %co %s", from, ic->irc->channel, 630 u->away?'-':'+', u->nick ); 631 } 621 irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, 622 u->away?'-':'+', u->nick ); 632 623 g_free( from ); 633 624 } … … 639 630 char *wrapped; 640 631 user_t *u; 641 642 /* pass the message through OTR */ 643 msg = otr_handle_message(ic, handle, msg); 644 if(!msg) { 645 /* this was an internal OTR protocol message */ 646 return; 647 } 648 632 649 633 u = user_findhandle( ic, handle ); 634 650 635 if( !u ) 651 636 { … … 657 642 imcb_log( ic, "Ignoring message from unknown handle %s", handle ); 658 643 659 g_free(msg);660 644 return; 661 645 } … … 690 674 irc_msgfrom( irc, u->nick, wrapped ); 691 675 g_free( wrapped ); 692 g_free( msg );693 676 } 694 677 … … 931 914 932 915 916 /* Misc. BitlBee stuff which shouldn't really be here */ 917 918 char *set_eval_away_devoice( set_t *set, char *value ) 919 { 920 irc_t *irc = set->data; 921 int st; 922 923 if( ( g_strcasecmp( value, "true" ) == 0 ) || ( g_strcasecmp( value, "yes" ) == 0 ) || ( g_strcasecmp( value, "on" ) == 0 ) ) 924 st = 1; 925 else if( ( g_strcasecmp( value, "false" ) == 0 ) || ( g_strcasecmp( value, "no" ) == 0 ) || ( g_strcasecmp( value, "off" ) == 0 ) ) 926 st = 0; 927 else if( sscanf( value, "%d", &st ) != 1 ) 928 return( NULL ); 929 930 st = st != 0; 931 932 /* Horror.... */ 933 934 if( st != set_getbool( &irc->set, "away_devoice" ) ) 935 { 936 char list[80] = ""; 937 user_t *u = irc->users; 938 int i = 0, count = 0; 939 char pm; 940 char v[80]; 941 942 if( st ) 943 pm = '+'; 944 else 945 pm = '-'; 946 947 while( u ) 948 { 949 if( u->ic && u->online && !u->away ) 950 { 951 if( ( strlen( list ) + strlen( u->nick ) ) >= 79 ) 952 { 953 for( i = 0; i < count; v[i++] = 'v' ); v[i] = 0; 954 irc_write( irc, ":%s MODE %s %c%s%s", 955 irc->myhost, 956 irc->channel, pm, v, list ); 957 958 *list = 0; 959 count = 0; 960 } 961 962 sprintf( list + strlen( list ), " %s", u->nick ); 963 count ++; 964 } 965 u = u->next; 966 } 967 968 /* $v = 'v' x $i */ 969 for( i = 0; i < count; v[i++] = 'v' ); v[i] = 0; 970 irc_write( irc, ":%s MODE %s %c%s%s", irc->myhost, 971 irc->channel, pm, v, list ); 972 } 973 974 return( set_eval_bool( set, value ) ); 975 } 976 977 978 979 933 980 /* The plan is to not allow straight calls to prpl functions anymore, but do 934 981 them all from some wrappers. We'll start to define some down here: */ … … 944 991 msg = buf; 945 992 } 946 947 /* if compiled without otr support, this just calls the prpl buddy_msg */ 948 st = otr_send_message(ic, handle, msg, flags); 949 950 g_free(buf); 993 994 st = ic->acc->prpl->buddy_msg( ic, handle, msg, flags ); 995 g_free( buf ); 996 951 997 return st; 952 998 }
Note: See TracChangeset
for help on using the changeset viewer.