Mercurial > pidgin
comparison libpurple/protocols/jabber/jabber.c @ 18684:5c1ed6296b56
propagate from branch 'im.pidgin.pidgin' (head b195e262642015df66e36d33e9dd16ecae5df9d5)
to branch 'im.pidgin.soc.2007.xmpp' (head 06f9dbd73b69e26dc9f56873a9ce106146bb1b18)
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Wed, 11 Jul 2007 22:27:44 +0000 |
parents | d53aa2308727 e3df2f61d03d |
children | 91eece1ad9bc |
comparison
equal
deleted
inserted
replaced
17907:8d2ea5072f6f | 18684:5c1ed6296b56 |
---|---|
473 { | 473 { |
474 PurpleConnection *gc = data; | 474 PurpleConnection *gc = data; |
475 JabberStream *js = gc->proto_data; | 475 JabberStream *js = gc->proto_data; |
476 | 476 |
477 if (source < 0) { | 477 if (source < 0) { |
478 purple_connection_error(gc, _("Couldn't connect to host")); | 478 gchar *tmp; |
479 tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"), | |
480 error); | |
481 purple_connection_error(gc, tmp); | |
482 g_free(tmp); | |
479 return; | 483 return; |
480 } | 484 } |
481 | 485 |
482 js->fd = source; | 486 js->fd = source; |
483 | 487 |
1150 gc->proto_data = NULL; | 1154 gc->proto_data = NULL; |
1151 } | 1155 } |
1152 | 1156 |
1153 void jabber_stream_set_state(JabberStream *js, JabberStreamState state) | 1157 void jabber_stream_set_state(JabberStream *js, JabberStreamState state) |
1154 { | 1158 { |
1155 PurpleStoredImage *img; | |
1156 | |
1157 js->state = state; | 1159 js->state = state; |
1158 switch(state) { | 1160 switch(state) { |
1159 case JABBER_STREAM_OFFLINE: | 1161 case JABBER_STREAM_OFFLINE: |
1160 break; | 1162 break; |
1161 case JABBER_STREAM_CONNECTING: | 1163 case JABBER_STREAM_CONNECTING: |
1187 /* The stream will be reinitialized later, in jabber_recv_cb_ssl() */ | 1189 /* The stream will be reinitialized later, in jabber_recv_cb_ssl() */ |
1188 js->reinit = TRUE; | 1190 js->reinit = TRUE; |
1189 | 1191 |
1190 break; | 1192 break; |
1191 case JABBER_STREAM_CONNECTED: | 1193 case JABBER_STREAM_CONNECTED: |
1192 /* lets make sure our buddy icon is up to date | |
1193 * before we go letting people know we're here */ | |
1194 img = purple_buddy_icons_find_account_icon(js->gc->account); | |
1195 jabber_set_buddy_icon(js->gc, img); | |
1196 purple_imgstore_unref(img); | |
1197 | |
1198 /* now we can alert the core that we're ready to send status */ | 1194 /* now we can alert the core that we're ready to send status */ |
1199 purple_connection_set_state(js->gc, PURPLE_CONNECTED); | 1195 purple_connection_set_state(js->gc, PURPLE_CONNECTED); |
1200 jabber_disco_items_server(js); | 1196 jabber_disco_items_server(js); |
1201 break; | 1197 break; |
1202 } | 1198 } |
1272 return NULL; | 1268 return NULL; |
1273 } | 1269 } |
1274 | 1270 |
1275 char *jabber_status_text(PurpleBuddy *b) | 1271 char *jabber_status_text(PurpleBuddy *b) |
1276 { | 1272 { |
1277 JabberBuddy *jb = jabber_buddy_find(b->account->gc->proto_data, b->name, | |
1278 FALSE); | |
1279 char *ret = NULL; | 1273 char *ret = NULL; |
1274 JabberBuddy *jb = NULL; | |
1275 | |
1276 if (b->account->gc && b->account->gc->proto_data) | |
1277 jb = jabber_buddy_find(b->account->gc->proto_data, b->name, FALSE); | |
1280 | 1278 |
1281 if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && (jb->subscription & JABBER_SUB_PENDING || !(jb->subscription & JABBER_SUB_TO))) { | 1279 if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && (jb->subscription & JABBER_SUB_PENDING || !(jb->subscription & JABBER_SUB_TO))) { |
1282 ret = g_strdup(_("Not Authorized")); | 1280 ret = g_strdup(_("Not Authorized")); |
1283 } else if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && jb->error_msg) { | 1281 } else if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && jb->error_msg) { |
1284 ret = g_strdup(jb->error_msg); | 1282 ret = g_strdup(jb->error_msg); |
1606 purple_request_fields_add_group(fields, group); | 1604 purple_request_fields_add_group(fields, group); |
1607 | 1605 |
1608 field = purple_request_field_string_new("password1", _("Password"), | 1606 field = purple_request_field_string_new("password1", _("Password"), |
1609 "", FALSE); | 1607 "", FALSE); |
1610 purple_request_field_string_set_masked(field, TRUE); | 1608 purple_request_field_string_set_masked(field, TRUE); |
1609 purple_request_field_set_required(field, TRUE); | |
1611 purple_request_field_group_add_field(group, field); | 1610 purple_request_field_group_add_field(group, field); |
1612 | 1611 |
1613 field = purple_request_field_string_new("password2", _("Password (again)"), | 1612 field = purple_request_field_string_new("password2", _("Password (again)"), |
1614 "", FALSE); | 1613 "", FALSE); |
1615 purple_request_field_string_set_masked(field, TRUE); | 1614 purple_request_field_string_set_masked(field, TRUE); |
1615 purple_request_field_set_required(field, TRUE); | |
1616 purple_request_field_group_add_field(group, field); | 1616 purple_request_field_group_add_field(group, field); |
1617 | 1617 |
1618 purple_request_fields(js->gc, _("Change XMPP Password"), | 1618 purple_request_fields(js->gc, _("Change XMPP Password"), |
1619 _("Change XMPP Password"), _("Please enter your new password"), | 1619 _("Change XMPP Password"), _("Please enter your new password"), |
1620 fields, _("OK"), G_CALLBACK(jabber_password_change_cb), | 1620 fields, _("OK"), G_CALLBACK(jabber_password_change_cb), |