Changeset 94d5da9c for irc_im.c


Ignore:
Timestamp:
2010-07-18T22:12:19Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6d8cc05
Parents:
4f22a68c
Message:

One of the last few things I wanted to get done in this branch: combining
show_offline and away_devoice and possibly other ideas into one setting
called show_users. Documentation will come soon. :-P

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r4f22a68c r94d5da9c  
    143143        struct irc_control_channel *icc;
    144144        GSList *l;
    145         gboolean show = FALSE;
     145        gboolean match = FALSE;
    146146       
    147147        if( ic == NULL )
     
    170170        icc = ic->data;
    171171       
    172         if( !( iu->bu->flags & BEE_USER_ONLINE ) )
    173                 show = FALSE;
    174         else if( icc->type == IRC_CC_TYPE_DEFAULT )
    175                 show = TRUE;
     172        if( icc->type == IRC_CC_TYPE_DEFAULT )
     173                match = TRUE;
    176174        else if( icc->type == IRC_CC_TYPE_GROUP )
    177                 show = iu->bu->group == icc->group;
     175                match = iu->bu->group == icc->group;
    178176        else if( icc->type == IRC_CC_TYPE_ACCOUNT )
    179                 show = iu->bu->ic->acc == icc->account;
     177                match = iu->bu->ic->acc == icc->account;
    180178        else if( icc->type == IRC_CC_TYPE_PROTOCOL )
    181                 show = iu->bu->ic->acc->prpl == icc->protocol;
    182        
    183         if( !show )
     179                match = iu->bu->ic->acc->prpl == icc->protocol;
     180       
     181        if( !match )
    184182        {
    185183                irc_channel_del_user( ic, iu, IRC_CDU_PART, NULL );
     
    187185        else
    188186        {
    189                 irc_channel_add_user( ic, iu );
    190                
    191                 if( set_getbool( &irc->b->set, "away_devoice" ) )
    192                         irc_channel_user_set_mode( ic, iu, ( iu->bu->flags & BEE_USER_AWAY ) ?
    193                                                    0 : IRC_CHANNEL_USER_VOICE );
     187                int mode = 0;
     188               
     189                if( !( iu->bu->flags & BEE_USER_ONLINE ) )
     190                        mode = icc->modes[0];
     191                else if( iu->bu->flags & BEE_USER_AWAY )
     192                        mode = icc->modes[1];
    194193                else
    195                         irc_channel_user_set_mode( ic, iu, 0 );
     194                        mode = icc->modes[2];
     195               
     196                if( !mode )
     197                        irc_channel_del_user( ic, iu, IRC_CDU_PART, NULL );
     198                else
     199                {
     200                        irc_channel_add_user( ic, iu );
     201                        irc_channel_user_set_mode( ic, iu, mode );
     202                }
    196203        }
    197204}
Note: See TracChangeset for help on using the changeset viewer.