Changeset 0a3c243
- Timestamp:
- 2006-06-30T23:18:56Z (18 years ago)
- Branches:
- master
- Children:
- 5100caa
- Parents:
- 5c9512f
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
account.c
r5c9512f r0a3c243 143 143 void account_on( irc_t *irc, account_t *a ) 144 144 { 145 struct aim_user *u;146 147 145 if( a->gc ) 148 146 { … … 153 151 cancel_auto_reconnect( a ); 154 152 155 u = g_new0 ( struct aim_user, 1 );156 u->irc = irc;157 u->prpl = a->prpl;158 strncpy( u->username, a->user, sizeof( u->username ) - 1 );159 strncpy( u->password, a->pass, sizeof( u->password ) - 1 );160 if( a->server) strncpy( u->proto_opt[0], a->server, sizeof( u->proto_opt[0] ) - 1 );161 162 a->gc = (struct gaim_connection *) u; /* Bit hackish :-/ */163 153 a->reconnect = 0; 164 165 a->prpl->login( u ); 154 a->prpl->login( a ); 166 155 } 167 156 -
irc.c
r5c9512f r0a3c243 925 925 { 926 926 char *nick, *s; 927 char reason[ 64];927 char reason[128]; 928 928 929 929 if( u->gc && u->gc->flags & OPT_LOGGING_OUT ) 930 930 { 931 if( u->gc-> user->proto_opt[0][0])931 if( u->gc->acc->server ) 932 932 g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost, 933 u->gc-> user->proto_opt[0]);933 u->gc->acc->server ); 934 934 else if( ( s = strchr( u->gc->username, '@' ) ) ) 935 935 g_snprintf( reason, sizeof( reason ), "%s %s", irc->myhost, … … 937 937 else 938 938 g_snprintf( reason, sizeof( reason ), "%s %s.%s", irc->myhost, 939 u->gc-> prpl->name, irc->myhost );939 u->gc->acc->prpl->name, irc->myhost ); 940 940 941 941 /* proto_opt might contain garbage after the : */ … … 1013 1013 else if( g_strncasecmp( s + 1, "TYPING", 6 ) == 0 ) 1014 1014 { 1015 if( u && u->gc && u->gc-> prpl->send_typing && strlen( s ) >= 10 )1015 if( u && u->gc && u->gc->acc->prpl->send_typing && strlen( s ) >= 10 ) 1016 1016 { 1017 1017 time_t current_typing_notice = time( NULL ); … … 1019 1019 if( current_typing_notice - u->last_typing_notice >= 5 ) 1020 1020 { 1021 u->gc-> prpl->send_typing( u->gc, u->handle, s[8] == '1' );1021 u->gc->acc->prpl->send_typing( u->gc, u->handle, s[8] == '1' ); 1022 1022 u->last_typing_notice = current_typing_notice; 1023 1023 } … … 1052 1052 } 1053 1053 } 1054 else if( c && c->gc && c->gc-> prpl )1054 else if( c && c->gc && c->gc->acc && c->gc->acc->prpl ) 1055 1055 { 1056 1056 return( bim_chat_msg( c->gc, c->id, s ) ); -
irc_commands.c
r5c9512f r0a3c243 150 150 irc_part( irc, u, c->channel ); 151 151 152 if( c->gc && c->gc->prpl)152 if( c->gc ) 153 153 { 154 154 c->joined = 0; 155 c->gc-> prpl->chat_leave( c->gc, c->id );155 c->gc->acc->prpl->chat_leave( c->gc, c->id ); 156 156 } 157 157 } … … 173 173 user_t *u = user_find( irc, cmd[1] + 1 ); 174 174 175 if( u && u->gc && u->gc-> prpl && u->gc->prpl->chat_open )175 if( u && u->gc && u->gc->acc->prpl->chat_open ) 176 176 { 177 177 irc_reply( irc, 403, "%s :Initializing groupchat in a different channel", cmd[1] ); 178 178 179 if( !u->gc-> prpl->chat_open( u->gc, u->handle ) )179 if( !u->gc->acc->prpl->chat_open( u->gc, u->handle ) ) 180 180 { 181 181 irc_usermsg( irc, "Could not open a groupchat with %s.", u->nick ); … … 205 205 206 206 if( u && c && ( u->gc == c->gc ) ) 207 if( c->gc && c->gc-> prpl && c->gc->prpl->chat_invite )208 { 209 c->gc-> prpl->chat_invite( c->gc, c->id, "", u->handle );207 if( c->gc && c->gc->acc->prpl->chat_invite ) 208 { 209 c->gc->acc->prpl->chat_invite( c->gc, c->id, "", u->handle ); 210 210 irc_reply( irc, 341, "%s %s", nick, channel ); 211 211 return; … … 477 477 478 478 if( u->gc ) 479 irc_reply( irc, 312, "%s %s.%s :%s network", u->nick, u->gc-> user->username,480 *u->gc-> user->proto_opt[0] ? u->gc->user->proto_opt[0] : "", u->gc->prpl->name );479 irc_reply( irc, 312, "%s %s.%s :%s network", u->nick, u->gc->acc->user, 480 *u->gc->acc->server ? u->gc->acc->server : "", u->gc->acc->prpl->name ); 481 481 else 482 482 irc_reply( irc, 312, "%s %s :%s", u->nick, irc->myhost, IRCD_INFO ); -
protocols/jabber/jabber.c
r5c9512f r0a3c243 561 561 static void gjab_start(gjconn gjc) 562 562 { 563 struct aim_user *user;563 account_t *acc; 564 564 int port = -1, ssl = 0; 565 565 char *server = NULL, *s; … … 568 568 return; 569 569 570 user = GJ_GC(gjc)->user;571 if ( *user->proto_opt[0]) {570 acc = GJ_GC(gjc)->acc; 571 if (acc->server) { 572 572 /* If there's a dot, assume there's a hostname in the beginning */ 573 if (strchr( user->proto_opt[0], '.')) {574 server = g_strdup( user->proto_opt[0]);573 if (strchr(acc->server, '.')) { 574 server = g_strdup(acc->server); 575 575 if ((s = strchr(server, ':'))) 576 576 *s = 0; … … 578 578 579 579 /* After the hostname, there can be a port number */ 580 s = strchr( user->proto_opt[0], ':');580 s = strchr(acc->server, ':'); 581 581 if (s && isdigit(s[1])) 582 582 sscanf(s + 1, "%d", &port); 583 583 584 584 /* And if there's the string ssl, the user wants an SSL-connection */ 585 if (strstr( user->proto_opt[0], ":ssl") || g_strcasecmp(user->proto_opt[0], "ssl") == 0)585 if (strstr(acc->server, ":ssl") || g_strcasecmp(acc->server, "ssl") == 0) 586 586 ssl = 1; 587 587 } … … 616 616 g_free(server); 617 617 618 if (! user->gc || (gjc->fd < 0)) {618 if (!acc->gc || (gjc->fd < 0)) { 619 619 STATE_EVT(JCONN_STATE_OFF) 620 620 return; … … 1516 1516 } 1517 1517 1518 static void jabber_login( struct aim_user *user)1519 { 1520 struct gaim_connection *gc = new_gaim_conn( user);1518 static void jabber_login(account_t *acc) 1519 { 1520 struct gaim_connection *gc = new_gaim_conn(acc); 1521 1521 struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1); 1522 char *loginname = create_valid_jid( user->username, DEFAULT_SERVER, "BitlBee");1522 char *loginname = create_valid_jid(acc->user, DEFAULT_SERVER, "BitlBee"); 1523 1523 1524 1524 jd->hash = g_hash_table_new(g_str_hash, g_str_equal); … … 1527 1527 set_login_progress(gc, 1, _("Connecting")); 1528 1528 1529 if (!(jd->gjc = gjab_new(loginname, user->password, gc))) {1529 if (!(jd->gjc = gjab_new(loginname, acc->pass, gc))) { 1530 1530 g_free(loginname); 1531 1531 hide_login_progress(gc, _("Unable to connect")); -
protocols/msn/msn.c
r5c9512f r0a3c243 27 27 #include "msn.h" 28 28 29 static void msn_login( struct aim_user *acct)30 { 31 struct gaim_connection *gc = new_gaim_conn( acc t);29 static void msn_login( account_t *acc ) 30 { 31 struct gaim_connection *gc = new_gaim_conn( acc ); 32 32 struct msn_data *md = g_new0( struct msn_data, 1 ); 33 33 … … 37 37 md->fd = -1; 38 38 39 if( strchr( acc t->username, '@' ) == NULL )39 if( strchr( acc->user, '@' ) == NULL ) 40 40 { 41 41 hide_login_progress( gc, "Invalid account name" ); -
protocols/nogaim.c
r5c9512f r0a3c243 145 145 /* multi.c */ 146 146 147 struct gaim_connection *new_gaim_conn( struct aim_user *user)147 struct gaim_connection *new_gaim_conn( account_t *acc ) 148 148 { 149 149 struct gaim_connection *gc; 150 account_t *a;151 150 152 151 gc = g_new0( struct gaim_connection, 1 ); 153 152 154 gc->prpl = user->prpl;155 g_snprintf( gc->username, sizeof( gc->username ), "%s", user->username);156 g_snprintf( gc->password, sizeof( gc->password ), "%s", user->password);157 /* [MD] BUGFIX: don't set gc->irc to the global IRC, but use the one from the struct aim_user.158 * This fixes daemon mode breakage where IRC doesn't point to the currently active connection.159 */160 gc->irc = user->irc;153 /* Maybe we should get rid of this memory waste later. ;-) */ 154 g_snprintf( gc->username, sizeof( gc->username ), "%s", acc->user ); 155 g_snprintf( gc->password, sizeof( gc->password ), "%s", acc->pass ); 156 157 gc->irc = acc->irc; 158 gc->acc = acc; 159 acc->gc = gc; 161 160 162 161 connections = g_slist_append( connections, gc ); 163 164 user->gc = gc;165 gc->user = user;166 167 // Find the account_t so we can set its gc pointer168 for( a = gc->irc->accounts; a; a = a->next )169 if( ( struct aim_user * ) a->gc == user )170 {171 a->gc = gc;172 break;173 }174 162 175 163 return( gc ); … … 189 177 190 178 connections = g_slist_remove( connections, gc ); 191 g_free( gc->user );192 179 g_free( gc ); 193 180 } … … 226 213 /* Try to find a different connection on the same protocol. */ 227 214 for( a = gc->irc->accounts; a; a = a->next ) 228 if( a->prpl == gc-> prpl && a->gc != gc )215 if( a->prpl == gc->acc->prpl && a->gc != gc ) 229 216 break; 230 217 231 218 /* If we found one, include the screenname in the message. */ 232 219 if( a ) 233 irc_usermsg( gc->irc, "%s(%s) - %s", gc-> prpl->name, gc->username, text );220 irc_usermsg( gc->irc, "%s(%s) - %s", gc->acc->prpl->name, gc->username, text ); 234 221 else 235 irc_usermsg( gc->irc, "%s - %s", gc-> prpl->name, text );222 irc_usermsg( gc->irc, "%s - %s", gc->acc->prpl->name, text ); 236 223 237 224 g_free( text ); … … 242 229 struct gaim_connection *gc = d; 243 230 244 if( gc-> prpl && gc->prpl->keepalive )245 gc-> prpl->keepalive( gc );231 if( gc->acc->prpl->keepalive ) 232 gc->acc->prpl->keepalive( gc ); 246 233 247 234 return TRUE; … … 299 286 300 287 gc->keepalive = 0; 301 gc-> prpl->close( gc );288 gc->acc->prpl->close( gc ); 302 289 b_event_remove( gc->inpa ); 303 290 … … 379 366 380 367 memset( nick, 0, MAX_NICK_LENGTH + 1 ); 381 strcpy( nick, nick_get( gc->irc, handle, gc-> prpl, realname ) );368 strcpy( nick, nick_get( gc->irc, handle, gc->acc->prpl, realname ) ); 382 369 383 370 u = user_add( gc->irc, nick ); … … 391 378 u->user = g_strndup( handle, s - handle ); 392 379 } 393 else if( gc->user->proto_opt[0] && *gc->user->proto_opt[0])380 else if( *gc->acc->server ) 394 381 { 395 382 char *colon; 396 383 397 if( ( colon = strchr( gc-> user->proto_opt[0], ':' ) ) )398 u->host = g_strndup( gc-> user->proto_opt[0],399 colon - gc-> user->proto_opt[0]);384 if( ( colon = strchr( gc->acc->server, ':' ) ) ) 385 u->host = g_strndup( gc->acc->server, 386 colon - gc->acc->server ); 400 387 else 401 u->host = g_strdup( gc-> user->proto_opt[0]);388 u->host = g_strdup( gc->acc->server ); 402 389 403 390 u->user = g_strdup( handle ); … … 410 397 else 411 398 { 412 u->host = g_strdup( gc-> user->prpl->name );399 u->host = g_strdup( gc->acc->prpl->name ); 413 400 u->user = g_strdup( handle ); 414 401 } … … 480 467 void show_got_added_yes( gpointer w, struct show_got_added_data *data ) 481 468 { 482 data->gc-> prpl->add_buddy( data->gc, data->handle );469 data->gc->acc->prpl->add_buddy( data->gc, data->handle ); 483 470 add_buddy( data->gc, NULL, data->handle, data->handle ); 484 471 … … 559 546 } 560 547 561 if( ( type & UC_UNAVAILABLE ) && ( !strcmp(gc->prpl->name, "oscar") || !strcmp(gc->prpl->name, "icq")) )548 if( ( type & UC_UNAVAILABLE ) && ( strcmp( gc->acc->prpl->name, "oscar" ) == 0 || strcmp( gc->acc->prpl->name, "icq" ) == 0 ) ) 562 549 { 563 550 u->away = g_strdup( "Away" ); 564 551 } 565 else if( ( type & UC_UNAVAILABLE ) && ( !strcmp(gc->prpl->name, "jabber")) )552 else if( ( type & UC_UNAVAILABLE ) && ( strcmp( gc->acc->prpl->name, "jabber" ) == 0 ) ) 566 553 { 567 554 if( type & UC_DND ) … … 572 559 u->away = g_strdup( "Away" ); 573 560 } 574 else if( ( type & UC_UNAVAILABLE ) && gc-> prpl->get_status_string )575 { 576 u->away = g_strdup( gc-> prpl->get_status_string( gc, type ) );561 else if( ( type & UC_UNAVAILABLE ) && gc->acc->prpl->get_status_string ) 562 { 563 u->away = g_strdup( gc->acc->prpl->get_status_string( gc, type ) ); 577 564 } 578 565 else … … 733 720 734 721 /* Gaim sends own messages through this too. IRC doesn't want this, so kill them */ 735 if( g_strcasecmp( who, gc->user ->username ) == 0 )722 if( g_strcasecmp( who, gc->username ) == 0 ) 736 723 return; 737 724 … … 791 778 792 779 /* It might be yourself! */ 793 if( b->gc-> prpl->cmp_buddynames( handle, b->gc->user->username ) == 0 )780 if( b->gc->acc->prpl->cmp_buddynames( handle, b->gc->username ) == 0 ) 794 781 { 795 782 u = user_find( b->gc->irc, b->gc->irc->nick ); … … 825 812 826 813 /* It might be yourself! */ 827 if( g_strcasecmp( handle, b->gc->user ->username ) == 0 )814 if( g_strcasecmp( handle, b->gc->username ) == 0 ) 828 815 { 829 816 u = user_find( b->gc->irc, b->gc->irc->nick ); … … 959 946 } 960 947 961 st = gc-> prpl->send_im( gc, handle, msg, strlen( msg ), flags );948 st = gc->acc->prpl->send_im( gc, handle, msg, strlen( msg ), flags ); 962 949 g_free( buf ); 963 950 … … 976 963 } 977 964 978 st = gc-> prpl->chat_send( gc, id, msg );965 st = gc->acc->prpl->chat_send( gc, id, msg ); 979 966 g_free( buf ); 980 967 … … 990 977 991 978 if( !away ) away = ""; 992 ms = m = gc-> prpl->away_states( gc );979 ms = m = gc->acc->prpl->away_states( gc ); 993 980 994 981 while( m ) … … 1011 998 if( m ) 1012 999 { 1013 gc-> prpl->set_away( gc, m->data, *away ? away : NULL );1000 gc->acc->prpl->set_away( gc, m->data, *away ? away : NULL ); 1014 1001 } 1015 1002 else … … 1018 1005 if( s ) 1019 1006 { 1020 gc-> prpl->set_away( gc, s, away );1007 gc->acc->prpl->set_away( gc, s, away ); 1021 1008 if( set_getint( &gc->irc->set, "debug" ) ) 1022 1009 serv_got_crap( gc, "Setting away state to %s", s ); 1023 1010 } 1024 1011 else 1025 gc-> prpl->set_away( gc, GAIM_AWAY_CUSTOM, away );1012 gc->acc->prpl->set_away( gc, GAIM_AWAY_CUSTOM, away ); 1026 1013 } 1027 1014 … … 1075 1062 void bim_add_allow( struct gaim_connection *gc, char *handle ) 1076 1063 { 1077 if( g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc-> prpl->cmp_buddynames ) == NULL )1064 if( g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) == NULL ) 1078 1065 { 1079 1066 gc->permit = g_slist_prepend( gc->permit, g_strdup( handle ) ); 1080 1067 } 1081 1068 1082 gc-> prpl->add_permit( gc, handle );1069 gc->acc->prpl->add_permit( gc, handle ); 1083 1070 } 1084 1071 … … 1087 1074 GSList *l; 1088 1075 1089 if( ( l = g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc-> prpl->cmp_buddynames ) ) )1076 if( ( l = g_slist_find_custom( gc->permit, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) ) ) 1090 1077 { 1091 1078 g_free( l->data ); … … 1093 1080 } 1094 1081 1095 gc-> prpl->rem_permit( gc, handle );1082 gc->acc->prpl->rem_permit( gc, handle ); 1096 1083 } 1097 1084 1098 1085 void bim_add_block( struct gaim_connection *gc, char *handle ) 1099 1086 { 1100 if( g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc-> prpl->cmp_buddynames ) == NULL )1087 if( g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) == NULL ) 1101 1088 { 1102 1089 gc->deny = g_slist_prepend( gc->deny, g_strdup( handle ) ); 1103 1090 } 1104 1091 1105 gc-> prpl->add_deny( gc, handle );1092 gc->acc->prpl->add_deny( gc, handle ); 1106 1093 } 1107 1094 … … 1110 1097 GSList *l; 1111 1098 1112 if( ( l = g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc-> prpl->cmp_buddynames ) ) )1099 if( ( l = g_slist_find_custom( gc->deny, handle, (GCompareFunc) gc->acc->prpl->cmp_buddynames ) ) ) 1113 1100 { 1114 1101 g_free( l->data ); … … 1116 1103 } 1117 1104 1118 gc-> prpl->rem_deny( gc, handle );1119 } 1105 gc->acc->prpl->rem_deny( gc, handle ); 1106 } -
protocols/nogaim.h
r5c9512f r0a3c243 39 39 40 40 #include "bitlbee.h" 41 #include "account.h" 41 42 #include "proxy.h" 42 43 #include "md5.h" … … 63 64 struct gaim_connection 64 65 { 65 struct prpl *prpl;66 account_t *acc; 66 67 guint32 flags; 67 68 … … 78 79 GSList *deny; 79 80 int permdeny; 80 81 struct aim_user *user;82 81 83 82 char username[64]; … … 126 125 }; 127 126 128 struct aim_user {129 char username[64];130 char alias[SELF_ALIAS_LEN];131 char password[32];132 char user_info[2048];133 int options;134 struct prpl *prpl;135 /* prpls can use this to save information about the user,136 * like which server to connect to, etc */137 char proto_opt[7][256];138 139 struct gaim_connection *gc;140 irc_t *irc;141 };142 143 127 struct prpl { 144 128 int options; 145 129 const char *name; 146 130 147 void (* login) ( struct aim_user*);131 void (* login) (account_t *); 148 132 void (* keepalive) (struct gaim_connection *); 149 133 void (* close) (struct gaim_connection *); … … 212 196 213 197 /* multi.c */ 214 G_MODULE_EXPORT struct gaim_connection *new_gaim_conn( struct aim_user *user);198 G_MODULE_EXPORT struct gaim_connection *new_gaim_conn( account_t *acc ); 215 199 G_MODULE_EXPORT void destroy_gaim_conn( struct gaim_connection *gc ); 216 200 G_MODULE_EXPORT void set_login_progress( struct gaim_connection *gc, int step, char *msg ); -
protocols/oscar/oscar.c
r5c9512f r0a3c243 356 356 } 357 357 358 static void oscar_login( struct aim_user *user) {358 static void oscar_login(account_t *acc) { 359 359 aim_session_t *sess; 360 360 aim_conn_t *conn; 361 361 char buf[256]; 362 struct gaim_connection *gc = new_gaim_conn( user);362 struct gaim_connection *gc = new_gaim_conn(acc); 363 363 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1); 364 364 365 if (isdigit( *user->username)) {365 if (isdigit(acc->user[0])) { 366 366 odata->icq = TRUE; 367 367 /* This is odd but it's necessary for a proper do_import and do_export. 368 368 We don't do those anymore, but let's stick with it, just in case 369 it accidentally fixes something else too... */369 it accidentally fixes something else too... </bitlbee> */ 370 370 gc->password[8] = 0; 371 371 } else { … … 390 390 } 391 391 392 if (g_strcasecmp( user->proto_opt[USEROPT_AUTH], "login.icq.com") != 0 &&393 g_strcasecmp( user->proto_opt[USEROPT_AUTH], "login.oscar.aol.com") != 0) {394 serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.", user->proto_opt[USEROPT_AUTH]);392 if (g_strcasecmp(acc->server, "login.icq.com") != 0 && 393 g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) { 394 serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server); 395 395 } 396 396 … … 402 402 403 403 conn->status |= AIM_CONN_STATUS_INPROGRESS; 404 conn->fd = proxy_connect(user->proto_opt[USEROPT_AUTH][0] ? 405 user->proto_opt[USEROPT_AUTH] : AIM_DEFAULT_LOGIN_SERVER, 406 user->proto_opt[USEROPT_AUTHPORT][0] ? 407 atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT, 408 oscar_login_connect, gc); 404 conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, gc); 409 405 if (conn->fd < 0) { 410 406 hide_login_progress(gc, _("Couldn't connect to host")); … … 485 481 struct aim_authresp_info *info; 486 482 int i; char *host; int port; 487 struct aim_user *user;488 483 aim_conn_t *bosconn; 489 484 490 485 struct gaim_connection *gc = sess->aux_data; 491 486 struct oscar_data *od = gc->proto_data; 492 user = gc->user; 493 port = user->proto_opt[USEROPT_AUTHPORT][0] ? 494 atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT, 487 port = AIM_LOGIN_PORT; 495 488 496 489 va_start(ap, fr); … … 871 864 struct aim_redirect_data *redir; 872 865 struct gaim_connection *gc = sess->aux_data; 873 struct aim_user *user = gc->user;874 866 aim_conn_t *tstconn; 875 867 int i; … … 877 869 int port; 878 870 879 port = user->proto_opt[USEROPT_AUTHPORT][0] ?880 atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT,881 882 871 va_start(ap, fr); 883 872 redir = va_arg(ap, struct aim_redirect_data *); 884 873 va_end(ap); 885 874 875 port = AIM_LOGIN_PORT; 886 876 for (i = 0; i < (int)strlen(redir->ip); i++) { 887 877 if (redir->ip[i] == ':') { … … 1723 1713 odata->rights.maxsiglen = odata->rights.maxawaymsglen = (guint)maxsiglen; 1724 1714 1715 /* FIXME: It seems we're not really using this, and it broke now that 1716 struct aim_user is dead. 1725 1717 aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps); 1726 1718 */ 1719 1727 1720 return 1; 1728 1721 } -
protocols/yahoo/yahoo.c
r5c9512f r0a3c243 121 121 } 122 122 123 static void byahoo_login( struct aim_user *user)124 { 125 struct gaim_connection *gc = new_gaim_conn( user);123 static void byahoo_login( account_t *acc ) 124 { 125 struct gaim_connection *gc = new_gaim_conn( acc ); 126 126 struct byahoo_data *yd = gc->proto_data = g_new0( struct byahoo_data, 1 ); 127 127 … … 130 130 131 131 set_login_progress( gc, 1, "Connecting" ); 132 yd->y2_id = yahoo_init( user->username, user->password);132 yd->y2_id = yahoo_init( acc->user, acc->pass ); 133 133 yahoo_login( yd->y2_id, yd->current_status ); 134 134 } … … 425 425 yd = gc->proto_data; 426 426 427 if( !strcmp(gc->prpl->name, "yahoo")&& yd->y2_id == id )427 if( strcmp( gc->acc->prpl->name, "yahoo" ) == 0 && yd->y2_id == id ) 428 428 return( gc ); 429 429 } -
root_commands.c
r5c9512f r0a3c243 400 400 else 401 401 { 402 nick_set( irc, cmd[2], a->gc-> prpl, cmd[3] );402 nick_set( irc, cmd[2], a->gc->acc->prpl, cmd[3] ); 403 403 } 404 404 } … … 407 407 add them to your *real* (server-side) contact list. */ 408 408 if( add_for_real ) 409 a->gc-> prpl->add_buddy( a->gc, cmd[2] );409 a->gc->acc->prpl->add_buddy( a->gc, cmd[2] ); 410 410 411 411 add_buddy( a->gc, NULL, cmd[2], cmd[2] ); … … 441 441 } 442 442 443 if( !gc-> prpl->get_info )443 if( !gc->acc->prpl->get_info ) 444 444 { 445 445 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); … … 447 447 else 448 448 { 449 gc-> prpl->get_info( gc, cmd[2] );449 gc->acc->prpl->get_info( gc, cmd[2] ); 450 450 } 451 451 } … … 482 482 else if( u->send_handler == buddy_send_handler ) 483 483 { 484 nick_set( irc, u->handle, u->gc-> prpl, cmd[2] );484 nick_set( irc, u->handle, u->gc->acc->prpl, cmd[2] ); 485 485 } 486 486 … … 501 501 s = g_strdup( u->handle ); 502 502 503 u->gc-> prpl->remove_buddy( u->gc, u->handle, NULL );503 u->gc->acc->prpl->remove_buddy( u->gc, u->handle, NULL ); 504 504 user_del( irc, cmd[1] ); 505 505 nick_del( irc, cmd[1] ); … … 558 558 } 559 559 560 if( !gc-> prpl->add_deny || !gc->prpl->rem_permit )560 if( !gc->acc->prpl->add_deny || !gc->acc->prpl->rem_permit ) 561 561 { 562 562 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); … … 617 617 } 618 618 619 if( !gc-> prpl->rem_deny || !gc->prpl->add_permit )619 if( !gc->acc->prpl->rem_deny || !gc->acc->prpl->add_permit ) 620 620 { 621 621 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); … … 733 733 if( online == 1 ) 734 734 { 735 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc-> user->prpl->name );735 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->acc->prpl->name ); 736 736 irc_usermsg( irc, format, u->nick, s, "Online" ); 737 737 } … … 744 744 if( away == 1 ) 745 745 { 746 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc-> user->prpl->name );746 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->acc->prpl->name ); 747 747 irc_usermsg( irc, format, u->nick, s, u->away ); 748 748 } … … 754 754 if( offline == 1 ) 755 755 { 756 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc-> user->prpl->name );756 g_snprintf( s, sizeof( s ) - 1, "%s@%s (%s)", u->user, u->host, u->gc->acc->prpl->name ); 757 757 irc_usermsg( irc, format, u->nick, s, "Offline" ); 758 758 } … … 779 779 irc_usermsg( irc, "Your name is `%s'" , a->gc->displayname ? a->gc->displayname : "NULL" ); 780 780 } 781 else if ( !a-> gc->prpl->set_info )781 else if ( !a->prpl->set_info ) 782 782 { 783 783 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); … … 787 787 irc_usermsg( irc, "Setting your name to `%s'", cmd[2] ); 788 788 789 a-> gc->prpl->set_info( a->gc, cmd[2] );789 a->prpl->set_info( a->gc, cmd[2] ); 790 790 } 791 791 } … … 806 806 for( num = 0; q; q = q->next, num ++ ) 807 807 if( q->gc ) /* Not necessary yet, but it might come later */ 808 irc_usermsg( irc, "%d, %s(%s): %s", num, q->gc-> prpl->name, q->gc->username, q->question );808 irc_usermsg( irc, "%d, %s(%s): %s", num, q->gc->acc->prpl->name, q->gc->username, q->question ); 809 809 else 810 810 irc_usermsg( irc, "%d, BitlBee: %s", num, q->question ); … … 834 834 user_t *u; 835 835 836 /* FIXME: Hmmm, this is actually pretty dangerous code... REMOVEME? :-) */ 836 837 for( u = irc->users; u; u = u->next ) 837 838 if( u->gc == gc ) 838 839 { 839 u->gc-> prpl->remove_buddy( u->gc, u->handle, NULL );840 u->gc->acc->prpl->remove_buddy( u->gc, u->handle, NULL ); 840 841 user_del( irc, u->nick ); 841 842 } … … 852 853 for( n = gc->irc->nicks; n; n = n->next ) 853 854 { 854 if( n->proto == gc-> prpl && !user_findhandle( gc, n->handle ) )855 { 856 gc-> prpl->add_buddy( gc, n->handle );855 if( n->proto == gc->acc->prpl && !user_findhandle( gc, n->handle ) ) 856 { 857 gc->acc->prpl->add_buddy( gc, n->handle ); 857 858 add_buddy( gc, NULL, n->handle, NULL ); 858 859 } -
user.c
r5c9512f r0a3c243 147 147 while( u ) 148 148 { 149 if( u->gc == gc && u->handle && gc-> prpl->cmp_buddynames ( u->handle, handle ) == 0 )149 if( u->gc == gc && u->handle && gc->acc->prpl->cmp_buddynames ( u->handle, handle ) == 0 ) 150 150 break; 151 151 u = u->next;
Note: See TracChangeset
for help on using the changeset viewer.