Changeset 58adb7e for protocols/nogaim.c


Ignore:
Timestamp:
2010-03-07T00:22:33Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
68198e9
Parents:
34fbbf9
Message:

Added global and per-account settings "away" and "status" so the user can
set these things individually.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r34fbbf9 r58adb7e  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2006 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    268268        ic->flags |= OPT_LOGGED_IN;
    269269       
    270         /* Also necessary when we're not away, at least for some of the
    271            protocols. */
    272         imc_set_away( ic, u->away );
     270        /* Necessary to send initial presence status, even if we're not away. */
     271        imc_away_send_update( ic );
    273272       
    274273        /* Apparently we're connected successfully, so reset the
     
    10721071static char *imc_away_state_find( GList *gcm, char *away, char **message );
    10731072
    1074 int imc_set_away( struct im_connection *ic, char *away )
    1075 {
    1076         char *s = NULL, *msg = away;
    1077        
     1073int imc_away_send_update( struct im_connection *ic )
     1074{
     1075        char *away, *msg;
     1076       
     1077        away = set_getstr( &ic->acc->set, "away" ) ?
     1078             : set_getstr( &ic->irc->set, "away" );
    10781079        if( away && *away )
    10791080        {
    10801081                GList *m = ic->acc->prpl->away_states( ic );
    1081                 s = imc_away_state_find( m, away, &msg ) ? : m->data;
    1082         }
    1083        
    1084         if( set_getbool( &ic->irc->set, "debug" ) )
    1085                 imcb_log( ic, "Setting away state to %s", s );
    1086        
    1087         ic->acc->prpl->set_away( ic, s, ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? msg : NULL );
     1082                msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL;
     1083                away = imc_away_state_find( m, away, &msg ) ? : m->data;
     1084        }
     1085        else if( ic->acc->flags & ACC_FLAG_STATUS_MESSAGE )
     1086        {
     1087                away = NULL;
     1088                msg = set_getstr( &ic->acc->set, "status" ) ?
     1089                    : set_getstr( &ic->irc->set, "status" );
     1090        }
     1091       
     1092        ic->acc->prpl->set_away( ic, away, msg );
    10881093       
    10891094        return 1;
Note: See TracChangeset for help on using the changeset viewer.