Changeset c32f492 for account.c


Ignore:
Timestamp:
2010-03-07T18:41:45Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b52e478, fb020ac
Parents:
1c2eaa3 (diff), 0e99548 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging in improved away/status message code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • account.c

    r1c2eaa3 rc32f492  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2004 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    6969                prpl->init( a );
    7070       
    71         return( a );
     71        s = set_add( &a->set, "away", NULL, set_eval_account, a );
     72        s->flags |= SET_NULL_OK;
     73       
     74        if( a->flags & ACC_FLAG_STATUS_MESSAGE )
     75        {
     76                s = set_add( &a->set, "status", NULL, set_eval_account, a );
     77                s->flags |= SET_NULL_OK;
     78        }
     79       
     80        return a;
    7281}
    7382
     
    121130               
    122131                acc->auto_connect = bool2int( value );
     132                return value;
     133        }
     134        else if( strcmp( set->key, "away" ) == 0 ||
     135                 strcmp( set->key, "status" ) == 0 )
     136        {
     137                if( acc->ic && acc->ic->flags & OPT_LOGGED_IN )
     138                {
     139                        /* If we're currently on-line, set the var now already
     140                           (bit of a hack) and send an update. */
     141                        g_free( set->value );
     142                        set->value = g_strdup( value );
     143                       
     144                        imc_away_send_update( acc->ic );
     145                }
     146               
    123147                return value;
    124148        }
     
    267291        p->max = 86400;
    268292       
    269         /* Format: /[0-9]+([*+][0-9]+(<[0-9+]))/ */
     293        /* Format: /[0-9]+([*+][0-9]+(<[0-9+])?)?/ */
    270294        while( *value && isdigit( *value ) )
    271295                p->start = p->start * 10 + *value++ - '0';
Note: See TracChangeset for help on using the changeset viewer.