From 7b23afdeead5b873b3e1cfc5ab29ecbf35b8c0ac Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 7 Nov 2005 17:16:18 +0100 Subject: Migrate my pluginable branch to use Wilmers' branch as parent --- account.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'account.c') diff --git a/account.c b/account.c index d5bd24c4..c1e25a06 100644 --- a/account.c +++ b/account.c @@ -27,7 +27,7 @@ #include "bitlbee.h" #include "account.h" -account_t *account_add( irc_t *irc, int protocol, char *user, char *pass ) +account_t *account_add( irc_t *irc, struct prpl *prpl, char *user, char *pass ) { account_t *a; @@ -41,7 +41,7 @@ account_t *account_add( irc_t *irc, int protocol, char *user, char *pass ) irc->accounts = a = g_new0 ( account_t, 1 ); } - a->protocol = protocol; + a->prpl = prpl; a->user = g_strdup( user ); a->pass = g_strdup( pass ); a->irc = irc; @@ -65,7 +65,7 @@ account_t *account_get( irc_t *irc, char *id ) for( a = irc->accounts; a; a = a->next ) { - if( g_strcasecmp( id, proto_name[a->protocol] ) == 0 ) + if( g_strcasecmp( id, a->prpl->name ) == 0 ) { if( !ret ) ret = a; @@ -123,9 +123,9 @@ void account_on( irc_t *irc, account_t *a ) return; } - if( proto_prpl[a->protocol]->login == NULL ) + if (a->prpl == NULL ) { - irc_usermsg( irc, "Support for protocol %s is not included in this BitlBee", proto_name[a->protocol] ); + irc_usermsg( irc, "Support for protocol %s is not included in this BitlBee", a->prpl->name ); return; } @@ -133,7 +133,7 @@ void account_on( irc_t *irc, account_t *a ) u = g_new0 ( struct aim_user, 1 ); u->irc = irc; - u->protocol = a->protocol; + u->prpl = a->prpl; strncpy( u->username, a->user, sizeof( u->username ) - 1 ); strncpy( u->password, a->pass, sizeof( u->password ) - 1 ); if( a->server) strncpy( u->proto_opt[0], a->server, sizeof( u->proto_opt[0] ) - 1 ); @@ -141,7 +141,7 @@ void account_on( irc_t *irc, account_t *a ) a->gc = (struct gaim_connection *) u; /* Bit hackish :-/ */ a->reconnect = 0; - proto_prpl[a->protocol]->login( u ); + a->prpl->login( u ); } void account_off( irc_t *irc, account_t *a ) -- cgit v1.2.3 From 547f9373fe4cda601e53759500d189dd580a0d78 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 14 Dec 2005 12:15:04 +0100 Subject: Remove statement that couldn't be executed anyway --- account.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'account.c') diff --git a/account.c b/account.c index c1e25a06..ed6b98c0 100644 --- a/account.c +++ b/account.c @@ -123,12 +123,6 @@ void account_on( irc_t *irc, account_t *a ) return; } - if (a->prpl == NULL ) - { - irc_usermsg( irc, "Support for protocol %s is not included in this BitlBee", a->prpl->name ); - return; - } - cancel_auto_reconnect( a ); u = g_new0 ( struct aim_user, 1 ); -- cgit v1.2.3