libpurple/protocols/jabber/jabber.c

changeset 41799
d567f89d6a9b
parent 41791
3bf884522663
child 41812
c3cd920261b6
equal deleted inserted replaced
41798:5ae15cfc1bee 41799:d567f89d6a9b
1001 "xmpp-client", js->cancellable, 1001 "xmpp-client", js->cancellable,
1002 srv_resolved_cb, js); 1002 srv_resolved_cb, js);
1003 } 1003 }
1004 } 1004 }
1005 1005
1006 static void 1006 static PurpleConnection *
1007 jabber_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) { 1007 jabber_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account,
1008 PurpleConnection *gc = purple_account_get_connection(account); 1008 const char *password)
1009 {
1010 PurpleConnection *gc = NULL;
1009 JabberStream *js; 1011 JabberStream *js;
1010 PurpleImage *image; 1012 PurpleImage *image;
1013
1014 gc = purple_connection_new(protocol, account, password);
1011 1015
1012 purple_connection_set_flags(gc, PURPLE_CONNECTION_FLAG_HTML | 1016 purple_connection_set_flags(gc, PURPLE_CONNECTION_FLAG_HTML |
1013 PURPLE_CONNECTION_FLAG_NO_IMAGES); 1017 PURPLE_CONNECTION_FLAG_NO_IMAGES);
1014 js = jabber_stream_new(account); 1018 js = jabber_stream_new(account);
1015 if (js == NULL) 1019 if (js == NULL)
1016 return; 1020 return gc;
1017 1021
1018 /* replace old default proxies with the new default: NULL 1022 /* replace old default proxies with the new default: NULL
1019 * TODO: these can eventually be removed */ 1023 * TODO: these can eventually be removed */
1020 if (purple_strequal("proxy.jabber.org", purple_account_get_string(account, "ft_proxies", "")) 1024 if (purple_strequal("proxy.jabber.org", purple_account_get_string(account, "ft_proxies", ""))
1021 || purple_strequal("proxy.eu.jabber.org", purple_account_get_string(account, "ft_proxies", ""))) 1025 || purple_strequal("proxy.eu.jabber.org", purple_account_get_string(account, "ft_proxies", "")))
1035 ); 1039 );
1036 g_object_unref(image); 1040 g_object_unref(image);
1037 } 1041 }
1038 1042
1039 jabber_stream_connect(js); 1043 jabber_stream_connect(js);
1044
1045 return gc;
1040 } 1046 }
1041 1047
1042 1048
1043 static gboolean 1049 static gboolean
1044 conn_close_cb(gpointer data) 1050 conn_close_cb(gpointer data)
1491 { 1497 {
1492 PurpleConnection *gc = purple_account_get_connection(account); 1498 PurpleConnection *gc = purple_account_get_connection(account);
1493 JabberStream *js; 1499 JabberStream *js;
1494 1500
1495 if (purple_connection_get_state(gc) != PURPLE_CONNECTION_CONNECTED) { 1501 if (purple_connection_get_state(gc) != PURPLE_CONNECTION_CONNECTED) {
1502 #warning fix registration and unregistration
1503 #if 0
1496 if (purple_connection_get_state(gc) != PURPLE_CONNECTION_CONNECTING) { 1504 if (purple_connection_get_state(gc) != PURPLE_CONNECTION_CONNECTING) {
1497 jabber_login(PURPLE_PROTOCOL(protocol_server), account); 1505 jabber_login(PURPLE_PROTOCOL(protocol_server), account);
1498 } 1506 }
1507 #endif
1499 1508
1500 js = purple_connection_get_protocol_data(gc); 1509 js = purple_connection_get_protocol_data(gc);
1501 js->unregistration = TRUE; 1510 js->unregistration = TRUE;
1502 js->unregistration_cb = cb; 1511 js->unregistration_cb = cb;
1503 js->unregistration_user_data = user_data; 1512 js->unregistration_user_data = user_data;

mercurial