Changeset 52cae01


Ignore:
Timestamp:
2010-03-07T23:08:40Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
bab1c86
Parents:
279607e
Message:

Set the ACC_FLAG_*_MESSAGE flags correctly depending on the prpl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r279607e r52cae01  
    44*  libpurple module - Main file                                             *
    55*                                                                           *
    6 *  Copyright 2009 Wilmer van der Gaast <wilmer@gaast.net>                   *
     6*  Copyright 2010 Wilmer van der Gaast <wilmer@gaast.net>                   *
    77*                                                                           *
    88*  This program is free software; you can redistribute it and/or modify     *
     
    5757        PurplePlugin *prpl = purple_plugins_find_with_id( (char*) acc->prpl->data );
    5858        PurplePluginProtocolInfo *pi = prpl->info->extra_info;
    59         GList *i;
    60        
     59        PurpleAccount *pa;
     60        GList *i, *st;
     61       
     62        /* Convert all protocol_options into per-account setting variables. */
    6163        for( i = pi->protocol_options; i; i = i->next )
    6264        {
     
    100102                }
    101103        }
     104       
     105        /* Go through all away states to figure out if away/status messages
     106           are possible. */
     107        pa = purple_account_new( acc->user, (char*) acc->prpl->data );
     108        for( st = purple_account_get_status_types( pa ); st; st = st->next )
     109        {
     110                PurpleStatusPrimitive prim = purple_status_type_get_primitive( st->data );
     111               
     112                if( prim == PURPLE_STATUS_AVAILABLE )
     113                {
     114                        if( purple_status_type_get_attr( st->data, "message" ) )
     115                                acc->flags |= ACC_FLAG_STATUS_MESSAGE;
     116                }
     117                else if( prim != PURPLE_STATUS_OFFLINE )
     118                {
     119                        if( purple_status_type_get_attr( st->data, "message" ) )
     120                                acc->flags |= ACC_FLAG_AWAY_MESSAGE;
     121                }
     122        }
     123        purple_accounts_remove( pa );
    102124}
    103125
     
    224246        }
    225247       
    226         if( message )
     248        if( message && purple_status_type_get_attr( st, "message" ) )
    227249        {
    228250                args = g_list_append( args, "message" );
Note: See TracChangeset for help on using the changeset viewer.