Changes in protocols/nogaim.c [31e5846:52e6e17]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
r31e5846 r52e6e17 603 603 604 604 /* LISPy... */ 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 */ 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 */ 609 608 { 610 609 char *from; … … 619 618 ic->irc->myhost ); 620 619 } 621 irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel, 622 u->away?'-':'+', u->nick ); 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 } 623 632 g_free( from ); 624 633 } … … 630 639 char *wrapped; 631 640 user_t *u; 632 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 633 649 u = user_findhandle( ic, handle ); 634 635 650 if( !u ) 636 651 { … … 642 657 imcb_log( ic, "Ignoring message from unknown handle %s", handle ); 643 658 659 g_free(msg); 644 660 return; 645 661 } … … 674 690 irc_msgfrom( irc, u->nick, wrapped ); 675 691 g_free( wrapped ); 692 g_free( msg ); 676 693 } 677 694 … … 914 931 915 932 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 else945 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 980 933 /* The plan is to not allow straight calls to prpl functions anymore, but do 981 934 them all from some wrappers. We'll start to define some down here: */ … … 991 944 msg = buf; 992 945 } 993 994 st = ic->acc->prpl->buddy_msg( ic, handle, msg, flags ); 995 g_free( buf ); 996 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); 997 951 return st; 998 952 }
Note: See TracChangeset
for help on using the changeset viewer.