Changeset cd741d8 for protocols


Ignore:
Timestamp:
2009-11-23T23:23:37Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
45a19e5
Parents:
4e04194
Message:

Fixed compatibility with non-libpurple version: oscar is now recognized
as a protocol name, and removed prpl- hack from nogaim.c.

Location:
protocols
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r4e04194 rcd741d8  
    111111                if( g_strcasecmp( proto->name, name ) == 0 )
    112112                        return proto;
    113 
    114 #ifdef WITH_PURPLE
    115                 /* I know, hardcoding is evil, but that doesn't make it
    116                    impossible. :-) */
    117                 if( g_strncasecmp( proto->name, "prpl-", 5 ) == 0 &&
    118                     g_strcasecmp( proto->name + 5, name ) == 0 )
    119                         return proto;
    120 #endif
    121113        }
    122114       
  • protocols/nogaim.h

    r4e04194 rcd741d8  
    133133         * - The user sees this name ie. when imcb_log() is used. */
    134134        const char *name;
     135        void *data;
    135136
    136137        /* Added this one to be able to add per-account settings, don't think
  • protocols/purple/purple.c

    r4e04194 rcd741d8  
    149149        purple_connections = g_slist_prepend( purple_connections, ic );
    150150       
    151         ic->proto_data = pa = purple_account_new( acc->user, acc->prpl->name );
     151        ic->proto_data = pa = purple_account_new( acc->user, (char*) acc->prpl->data );
    152152        purple_account_set_password( pa, acc->pass );
    153153        purple_sync_settings( acc, pa );
     
    451451void purple_initmodule()
    452452{
     453        struct prpl funcs;
    453454        GList *prots;
    454455       
     
    478479        purple_prefs_load();
    479480       
     481        memset( &funcs, 0, sizeof( funcs ) );
     482        funcs.login = purple_login;
     483        funcs.init = purple_init;
     484        funcs.logout = purple_logout;
     485        funcs.buddy_msg = purple_buddy_msg;
     486        funcs.away_states = purple_away_states;
     487        funcs.set_away = purple_set_away;
     488        funcs.add_buddy = purple_add_buddy;
     489        funcs.remove_buddy = purple_remove_buddy;
     490        funcs.keepalive = purple_keepalive;
     491        funcs.send_typing = purple_send_typing;
     492        funcs.handle_cmp = g_strcasecmp;
     493       
    480494        for( prots = purple_plugins_get_protocols(); prots; prots = prots->next )
    481495        {
    482                 struct prpl *ret = g_new0( struct prpl, 1 );
    483496                PurplePlugin *prot = prots->data;
    484                
    485                 ret->name = prot->info->id;
    486                 ret->login = purple_login;
    487                 ret->init = purple_init;
    488                 ret->logout = purple_logout;
    489                 ret->buddy_msg = purple_buddy_msg;
    490                 ret->away_states = purple_away_states;
    491                 ret->set_away = purple_set_away;
    492                 ret->add_buddy = purple_add_buddy;
    493                 ret->remove_buddy = purple_remove_buddy;
    494                 ret->keepalive = purple_keepalive;
    495                 ret->send_typing = purple_send_typing;
    496                 ret->handle_cmp = g_strcasecmp;
    497                
     497                struct prpl *ret;
     498               
     499                ret = g_memdup( &funcs, sizeof( funcs ) );
     500                ret->name = ret->data = prot->info->id;
     501                if( strncmp( ret->name, "prpl-", 5 ) == 0 )
     502                        ret->name += 5;
    498503                register_protocol( ret );
    499         }
    500 }
     504               
     505                if( g_strcasecmp( prot->info->id, "prpl-aim" ) == 0 )
     506                {
     507                        ret = g_memdup( &funcs, sizeof( funcs ) );
     508                        ret->name = "oscar";
     509                        ret->data = prot->info->id;
     510                        register_protocol( ret );
     511                }
     512        }
     513}
Note: See TracChangeset for help on using the changeset viewer.