Changeset 81186cab for protocols


Ignore:
Timestamp:
2010-04-13T11:38:41Z (11 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
21c87a7
Parents:
573dab0
Message:

/away and set away/status stuff back.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/bee.c

    r573dab0 r81186cab  
     1  /********************************************************************\
     2  * BitlBee -- An IRC to other IM-networks gateway                     *
     3  *                                                                    *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
     5  \********************************************************************/
     6
     7/* Some IM-core stuff                                                   */
     8
     9/*
     10  This program is free software; you can redistribute it and/or modify
     11  it under the terms of the GNU General Public License as published by
     12  the Free Software Foundation; either version 2 of the License, or
     13  (at your option) any later version.
     14
     15  This program is distributed in the hope that it will be useful,
     16  but WITHOUT ANY WARRANTY; without even the implied warranty of
     17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18  GNU General Public License for more details.
     19
     20  You should have received a copy of the GNU General Public License with
     21  the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
     22  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
     23  Suite 330, Boston, MA  02111-1307  USA
     24*/
     25
     26#define BITLBEE_CORE
    127#include "bitlbee.h"
     28
     29static char *set_eval_away_status( set_t *set, char *value );
    230
    331bee_t *bee_new()
     
    634        set_t *s;
    735       
    8         s = set_add( &b->set, "away", NULL, NULL/*set_eval_away_status*/, b );
     36        s = set_add( &b->set, "away", NULL, set_eval_away_status, b );
    937        s->flags |= SET_NULL_OK;
    1038        s = set_add( &b->set, "auto_connect", "true", set_eval_bool, b );
     
    1543        s->flags |= SET_NULL_OK;
    1644        s = set_add( &b->set, "save_on_quit", "true", set_eval_bool, b );
    17         s = set_add( &b->set, "status", NULL, NULL/*set_eval_away_status*/, b );
     45        s = set_add( &b->set, "status", NULL, set_eval_away_status, b );
    1846        s->flags |= SET_NULL_OK;
    1947        s = set_add( &b->set, "strip_html", "true", NULL, b );
     
    4674        g_free( b );
    4775}
     76
     77static char *set_eval_away_status( set_t *set, char *value )
     78{
     79        bee_t *bee = set->data;
     80        account_t *a;
     81       
     82        g_free( set->value );
     83        set->value = g_strdup( value );
     84       
     85        for( a = bee->accounts; a; a = a->next )
     86        {
     87                struct im_connection *ic = a->ic;
     88               
     89                if( ic && ic->flags & OPT_LOGGED_IN )
     90                        imc_away_send_update( ic );
     91        }
     92       
     93        return value;
     94}
Note: See TracChangeset for help on using the changeset viewer.