Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • account.c

    r547f937 rb7d3cc34  
    2828#include "account.h"
    2929
    30 account_t *account_add( irc_t *irc, struct prpl *prpl, char *user, char *pass )
     30account_t *account_add( irc_t *irc, int protocol, char *user, char *pass )
    3131{
    3232        account_t *a;
     
    4242        }
    4343       
    44         a->prpl = prpl;
     44        a->protocol = protocol;
    4545        a->user = g_strdup( user );
    4646        a->pass = g_strdup( pass );
     
    6666        for( a = irc->accounts; a; a = a->next )
    6767        {
    68                 if( g_strcasecmp( id, a->prpl->name ) == 0 )
     68                if( g_strcasecmp( id, proto_name[a->protocol] ) == 0 )
    6969                {
    7070                        if( !ret )
     
    124124        }
    125125       
     126        if( proto_prpl[a->protocol]->login == NULL )
     127        {
     128                irc_usermsg( irc, "Support for protocol %s is not included in this BitlBee", proto_name[a->protocol] );
     129                return;
     130        }
     131       
    126132        cancel_auto_reconnect( a );
    127133       
    128134        u = g_new0 ( struct aim_user, 1 );
    129135        u->irc = irc;
    130         u->prpl = a->prpl;
     136        u->protocol = a->protocol;
    131137        strncpy( u->username, a->user, sizeof( u->username ) - 1 );
    132138        strncpy( u->password, a->pass, sizeof( u->password ) - 1 );
     
    136142        a->reconnect = 0;
    137143       
    138         a->prpl->login( u );
     144        proto_prpl[a->protocol]->login( u );
    139145}
    140146
Note: See TracChangeset for help on using the changeset viewer.