Changeset 7b8238d for irc_channel.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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       
Note: See TracChangeset for help on using the changeset viewer.