Changes in protocols/jabber/jabber.c [0a3c243:75cde5d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r0a3c243 r75cde5d 471 471 } 472 472 473 static gboolean jabber_callback(gpointer data, gint source, b_input_condition condition)473 static void jabber_callback(gpointer data, gint source, GaimInputCondition condition) 474 474 { 475 475 struct gaim_connection *gc = (struct gaim_connection *)data; … … 477 477 478 478 gjab_recv(jd->gjc); 479 480 return TRUE;481 479 } 482 480 … … 489 487 } 490 488 491 static gboolean gjab_connected(gpointer data, gint source, b_input_condition cond)489 static void gjab_connected(gpointer data, gint source, GaimInputCondition cond) 492 490 { 493 491 xmlnode x; … … 499 497 if (!g_slist_find(get_connections(), gc)) { 500 498 closesocket(source); 501 return FALSE;499 return; 502 500 } 503 501 … … 510 508 if (source == -1) { 511 509 STATE_EVT(JCONN_STATE_OFF) 512 return FALSE;510 return; 513 511 } 514 512 … … 532 530 533 531 gc = GJ_GC(gjc); 534 gc->inpa = b_input_add(gjc->fd, GAIM_INPUT_READ, jabber_callback, gc); 535 536 return FALSE; 537 } 538 539 static gboolean gjab_connected_ssl(gpointer data, void *source, b_input_condition cond) 532 gc->inpa = gaim_input_add(gjc->fd, GAIM_INPUT_READ, jabber_callback, gc); 533 } 534 535 static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition cond) 540 536 { 541 537 struct gaim_connection *gc = data; … … 548 544 if (source == NULL) { 549 545 STATE_EVT(JCONN_STATE_OFF) 550 return FALSE;546 return; 551 547 } 552 548 553 549 if (!g_slist_find(get_connections(), gc)) { 554 550 ssl_disconnect(source); 555 return FALSE;551 return; 556 552 } 557 553 558 returngjab_connected(data, gjc->fd, cond);554 gjab_connected(data, gjc->fd, cond); 559 555 } 560 556 561 557 static void gjab_start(gjconn gjc) 562 558 { 563 account_t *acc;559 struct aim_user *user; 564 560 int port = -1, ssl = 0; 565 561 char *server = NULL, *s; … … 568 564 return; 569 565 570 acc = GJ_GC(gjc)->acc;571 if ( acc->server) {566 user = GJ_GC(gjc)->user; 567 if (*user->proto_opt[0]) { 572 568 /* If there's a dot, assume there's a hostname in the beginning */ 573 if (strchr( acc->server, '.')) {574 server = g_strdup( acc->server);569 if (strchr(user->proto_opt[0], '.')) { 570 server = g_strdup(user->proto_opt[0]); 575 571 if ((s = strchr(server, ':'))) 576 572 *s = 0; … … 578 574 579 575 /* After the hostname, there can be a port number */ 580 s = strchr( acc->server, ':');576 s = strchr(user->proto_opt[0], ':'); 581 577 if (s && isdigit(s[1])) 582 578 sscanf(s + 1, "%d", &port); 583 579 584 580 /* And if there's the string ssl, the user wants an SSL-connection */ 585 if (strstr( acc->server, ":ssl") || g_strcasecmp(acc->server, "ssl") == 0)581 if (strstr(user->proto_opt[0], ":ssl") || g_strcasecmp(user->proto_opt[0], "ssl") == 0) 586 582 ssl = 1; 587 583 } … … 616 612 g_free(server); 617 613 618 if (! acc->gc || (gjc->fd < 0)) {614 if (!user->gc || (gjc->fd < 0)) { 619 615 STATE_EVT(JCONN_STATE_OFF) 620 616 return; … … 1516 1512 } 1517 1513 1518 static void jabber_login( account_t *acc)1519 { 1520 struct gaim_connection *gc = new_gaim_conn( acc);1514 static void jabber_login(struct aim_user *user) 1515 { 1516 struct gaim_connection *gc = new_gaim_conn(user); 1521 1517 struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1); 1522 char *loginname = create_valid_jid( acc->user, DEFAULT_SERVER, "BitlBee");1518 char *loginname = create_valid_jid(user->username, DEFAULT_SERVER, "BitlBee"); 1523 1519 1524 1520 jd->hash = g_hash_table_new(g_str_hash, g_str_equal); … … 1527 1523 set_login_progress(gc, 1, _("Connecting")); 1528 1524 1529 if (!(jd->gjc = gjab_new(loginname, acc->pass, gc))) {1525 if (!(jd->gjc = gjab_new(loginname, user->password, gc))) { 1530 1526 g_free(loginname); 1531 1527 hide_login_progress(gc, _("Unable to connect")); … … 1547 1543 } 1548 1544 1549 static gboolean jabber_free(gpointer data , gint fd, b_input_condition cond)1545 static gboolean jabber_free(gpointer data) 1550 1546 { 1551 1547 struct jabber_data *jd = data; … … 1592 1588 } 1593 1589 if (gc->inpa) 1594 b_event_remove(gc->inpa);1590 gaim_input_remove(gc->inpa); 1595 1591 1596 1592 if(jd) { 1597 b_timeout_add(50, jabber_free, jd);1593 g_timeout_add(50, jabber_free, jd); 1598 1594 if(jd->gjc != NULL) 1599 1595 xmlnode_free(jd->gjc->current);
Note: See TracChangeset
for help on using the changeset viewer.