Changeset 7b8238d


Ignore:
Timestamp:
2015-01-28T17:06:40Z (9 years ago)
Author:
jgeboski <jgeboski@…>
Branches:
master
Children:
7821ee8
Parents:
1fa5109
git-author:
jgeboski <jgeboski@…> (17-12-14 17:57:17)
git-committer:
jgeboski <jgeboski@…> (28-01-15 17:06:40)
Message:

irc-channel: implemented a special mode for show_users

This allows for users to be declared as being special, which does not
have any specific meaning. The meaning of being special is different
from protocol-to-protocol, which many protocols do not even implement.
This functionality is mainly geared towards a special user state which
only some protocols may actually need to define. For example, with the
third-party Steam plugin, this can be used for denoting a user which is
actively playing a game.

By default, this mode will not actually be used by any plugin. However,
it does default to the half-operator user mode.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r1fa5109 r7b8238d  
    953953       
    954954        if( strcmp( set->key, "away_devoice" ) == 0 && !bool2int( value ) )
    955                 val = "online,away";
     955                val = "online,special%,away";
    956956        else if( strcmp( set->key, "show_offline" ) == 0 && bool2int( value ) )
    957                 val = "online@,away+,offline";
     957                val = "online@,special%,away+,offline";
    958958        else
    959                 val = "online+,away";
     959                val = "online+,special%,away";
    960960       
    961961        for( l = irc->channels; l; l = l->next )
  • irc.h

    r1fa5109 r7b8238d  
    224224        struct account *account;
    225225        struct prpl *protocol;
    226         char modes[4];
     226        char modes[5];
    227227};
    228228
  • irc_channel.c

    r1fa5109 r7b8238d  
    642642       
    643643        /* When changing the default, also change it below. */
    644         set_add( &ic->set, "show_users", "online+,away", set_eval_show_users, ic );
     644        set_add( &ic->set, "show_users", "online+,special%,away", set_eval_show_users, ic );
    645645       
    646646        ic->data = icc = g_new0( struct irc_control_channel, 1 );
     
    648648       
    649649        /* Have to run the evaluator to initialize icc->modes. */
    650         set_setstr( &ic->set, "show_users", "online+,away" );
     650        set_setstr( &ic->set, "show_users", "online+,special%,away" );
    651651       
    652652        /* For scripts that care. */
     
    744744        struct irc_control_channel *icc = ic->data;
    745745        char **parts = g_strsplit( value, ",", 0 ), **part;
    746         char modes[4];
    747        
    748         memset( modes, 0, 4 );
     746        char modes[5];
     747       
     748        memset( modes, 0, 5 );
    749749        for( part = parts; *part; part ++ )
    750750        {
     
    766766                else if( strncmp( *part, "away", 4 ) == 0 )
    767767                        modes[1] = modechar;
     768                else if( strncmp( *part, "special", 7 ) == 0 )
     769                        modes[2] = modechar;
    768770                else if( strncmp( *part, "online", 6 ) == 0 )
    769                         modes[2] = modechar;
     771                        modes[3] = modechar;
    770772                else
    771773                        goto fail;
    772774        }
    773         memcpy( icc->modes, modes, 4 );
     775        memcpy( icc->modes, modes, 5 );
    774776        bee_irc_channel_update( ic->irc, ic, NULL );
    775777       
  • irc_im.c

    r1fa5109 r7b8238d  
    190190                else if( iu->bu->flags & BEE_USER_AWAY )
    191191                        mode = icc->modes[1];
     192                else if( iu->bu->flags & BEE_USER_SPECIAL )
     193                        mode = icc->modes[2];
    192194                else
    193                         mode = icc->modes[2];
     195                        mode = icc->modes[3];
    194196               
    195197                if( !mode )
  • protocols/bee.h

    r1fa5109 r7b8238d  
    6363        BEE_USER_MOBILE = 8,    /* Compatibility with old OPT_MOBILE flag */
    6464        BEE_USER_LOCAL = 256,   /* Locally-added contacts (not in real contact list) */
     65        BEE_USER_SPECIAL = 512, /* Denotes a user as being special */
    6566} bee_user_flags_t;
    6667
Note: See TracChangeset for help on using the changeset viewer.