libpurple/protocols/jabber/jabber.c

branch
soc.2013.gobjectification.plugins
changeset 36782
64936dae41a3
parent 36732
39a42632a4c8
parent 34955
854143116575
child 36848
7fafdda14844
equal deleted inserted replaced
36781:8fb558514134 36782:64936dae41a3
1155 g_return_if_fail(to != NULL); 1155 g_return_if_fail(to != NULL);
1156 buf = g_strdup_printf(_("Registration to %s successful"), 1156 buf = g_strdup_printf(_("Registration to %s successful"),
1157 to); 1157 to);
1158 } 1158 }
1159 purple_notify_info(NULL, _("Registration Successful"), 1159 purple_notify_info(NULL, _("Registration Successful"),
1160 _("Registration Successful"), buf); 1160 _("Registration Successful"), buf,
1161 purple_request_cpar_from_connection(js->gc));
1161 g_free(buf); 1162 g_free(buf);
1162 } else { 1163 } else {
1163 char *msg = jabber_parse_error(js, packet, NULL); 1164 char *msg = jabber_parse_error(js, packet, NULL);
1164 1165
1165 if(!msg) 1166 if(!msg)
1166 msg = g_strdup(_("Unknown Error")); 1167 msg = g_strdup(_("Unknown Error"));
1167 1168
1168 purple_notify_error(NULL, _("Registration Failed"), 1169 purple_notify_error(NULL, _("Registration Failed"),
1169 _("Registration Failed"), msg); 1170 _("Registration Failed"), msg,
1171 purple_request_cpar_from_connection(js->gc));
1170 g_free(msg); 1172 g_free(msg);
1171 purple_account_register_completed(account, FALSE); 1173 purple_account_register_completed(account, FALSE);
1172 } 1174 }
1173 g_free(to); 1175 g_free(to);
1174 if(js->registration) 1176 if(js->registration)
1189 1191
1190 if (type == JABBER_IQ_RESULT) { 1192 if (type == JABBER_IQ_RESULT) {
1191 buf = g_strdup_printf(_("Registration from %s successfully removed"), 1193 buf = g_strdup_printf(_("Registration from %s successfully removed"),
1192 to); 1194 to);
1193 purple_notify_info(NULL, _("Unregistration Successful"), 1195 purple_notify_info(NULL, _("Unregistration Successful"),
1194 _("Unregistration Successful"), buf); 1196 _("Unregistration Successful"), buf,
1197 purple_request_cpar_from_connection(js->gc));
1195 g_free(buf); 1198 g_free(buf);
1196 } else { 1199 } else {
1197 char *msg = jabber_parse_error(js, packet, NULL); 1200 char *msg = jabber_parse_error(js, packet, NULL);
1198 1201
1199 if(!msg) 1202 if(!msg)
1200 msg = g_strdup(_("Unknown Error")); 1203 msg = g_strdup(_("Unknown Error"));
1201 1204
1202 purple_notify_error(NULL, _("Unregistration Failed"), 1205 purple_notify_error(NULL, _("Unregistration Failed"),
1203 _("Unregistration Failed"), msg); 1206 _("Unregistration Failed"), msg,
1207 purple_request_cpar_from_connection(js->gc));
1204 g_free(msg); 1208 g_free(msg);
1205 } 1209 }
1206 g_free(to); 1210 g_free(to);
1207 } 1211 }
1208 1212
1358 if(purple_xmlnode_get_child(query, "registered")) { 1362 if(purple_xmlnode_get_child(query, "registered")) {
1359 registered = TRUE; 1363 registered = TRUE;
1360 1364
1361 if(js->registration) { 1365 if(js->registration) {
1362 purple_notify_error(NULL, _("Already Registered"), 1366 purple_notify_error(NULL, _("Already Registered"),
1363 _("Already Registered"), NULL); 1367 _("Already Registered"), NULL,
1368 purple_request_cpar_from_connection(js->gc));
1364 purple_account_register_completed(account, FALSE); 1369 purple_account_register_completed(account, FALSE);
1365 jabber_connection_schedule_close(js); 1370 jabber_connection_schedule_close(js);
1366 return; 1371 return;
1367 } 1372 }
1368 } 1373 }
1523 1528
1524 if (type == JABBER_IQ_ERROR) { 1529 if (type == JABBER_IQ_ERROR) {
1525 char *msg = jabber_parse_error(js, packet, NULL); 1530 char *msg = jabber_parse_error(js, packet, NULL);
1526 1531
1527 purple_notify_error(js->gc, _("Error unregistering account"), 1532 purple_notify_error(js->gc, _("Error unregistering account"),
1528 _("Error unregistering account"), msg); 1533 _("Error unregistering account"), msg,
1534 purple_request_cpar_from_connection(js->gc));
1529 g_free(msg); 1535 g_free(msg);
1530 if(js->unregistration_cb) 1536 if(js->unregistration_cb)
1531 js->unregistration_cb(account, FALSE, js->unregistration_user_data); 1537 js->unregistration_cb(account, FALSE, js->unregistration_user_data);
1532 } else { 1538 } else {
1533 purple_notify_info(js->gc, _("Account successfully unregistered"), 1539 purple_notify_info(js->gc, _("Account successfully "
1534 _("Account successfully unregistered"), NULL); 1540 "unregistered"), _("Account successfully unregistered"),
1541 NULL, purple_request_cpar_from_connection(js->gc));
1535 if(js->unregistration_cb) 1542 if(js->unregistration_cb)
1536 js->unregistration_cb(account, TRUE, js->unregistration_user_data); 1543 js->unregistration_cb(account, TRUE, js->unregistration_user_data);
1537 } 1544 }
1538 } 1545 }
1539 1546
1912 } 1919 }
1913 1920
1914 if (!(js->server_caps & JABBER_CAP_BLOCKING)) 1921 if (!(js->server_caps & JABBER_CAP_BLOCKING))
1915 { 1922 {
1916 purple_notify_error(NULL, _("Server doesn't support blocking"), 1923 purple_notify_error(NULL, _("Server doesn't support blocking"),
1917 _("Server doesn't support blocking"), NULL); 1924 _("Server doesn't support blocking"), NULL,
1925 purple_request_cpar_from_connection(gc));
1918 return; 1926 return;
1919 } 1927 }
1920 1928
1921 iq = jabber_iq_new(js, JABBER_IQ_SET); 1929 iq = jabber_iq_new(js, JABBER_IQ_SET);
1922 1930
2471 jabber_password_change_result_cb(JabberStream *js, const char *from, 2479 jabber_password_change_result_cb(JabberStream *js, const char *from,
2472 JabberIqType type, const char *id, 2480 JabberIqType type, const char *id,
2473 PurpleXmlNode *packet, gpointer data) 2481 PurpleXmlNode *packet, gpointer data)
2474 { 2482 {
2475 if (type == JABBER_IQ_RESULT) { 2483 if (type == JABBER_IQ_RESULT) {
2476 purple_notify_info(js->gc, _("Password Changed"), _("Password Changed"), 2484 purple_notify_info(js->gc, _("Password Changed"), _("Password "
2477 _("Your password has been changed.")); 2485 "Changed"), _("Your password has been changed."),
2486 purple_request_cpar_from_connection(js->gc));
2478 2487
2479 purple_account_set_password(purple_connection_get_account(js->gc), (const char *)data, NULL, NULL); 2488 purple_account_set_password(purple_connection_get_account(js->gc), (const char *)data, NULL, NULL);
2480 } else { 2489 } else {
2481 char *msg = jabber_parse_error(js, packet, NULL); 2490 char *msg = jabber_parse_error(js, packet, NULL);
2482 2491
2483 purple_notify_error(js->gc, _("Error changing password"), 2492 purple_notify_error(js->gc, _("Error changing password"),
2484 _("Error changing password"), msg); 2493 _("Error changing password"), msg,
2494 purple_request_cpar_from_connection(js->gc));
2485 g_free(msg); 2495 g_free(msg);
2486 } 2496 }
2487 2497
2488 g_free(data); 2498 g_free(data);
2489 } 2499 }
2497 2507
2498 p1 = purple_request_fields_get_string(fields, "password1"); 2508 p1 = purple_request_fields_get_string(fields, "password1");
2499 p2 = purple_request_fields_get_string(fields, "password2"); 2509 p2 = purple_request_fields_get_string(fields, "password2");
2500 2510
2501 if(strcmp(p1, p2)) { 2511 if(strcmp(p1, p2)) {
2502 purple_notify_error(js->gc, NULL, _("New passwords do not match."), NULL); 2512 purple_notify_error(js->gc, NULL,
2513 _("New passwords do not match."), NULL,
2514 purple_request_cpar_from_connection(js->gc));
2503 return; 2515 return;
2504 } 2516 }
2505 2517
2506 iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:register"); 2518 iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:register");
2507 2519
3309 } else { 3321 } else {
3310 msg = g_strdup_printf(_("Unable to initiate media with %s: not subscribed to user presence"), who); 3322 msg = g_strdup_printf(_("Unable to initiate media with %s: not subscribed to user presence"), who);
3311 } 3323 }
3312 3324
3313 purple_notify_error(account, _("Media Initiation Failed"), 3325 purple_notify_error(account, _("Media Initiation Failed"),
3314 _("Media Initiation Failed"), msg); 3326 _("Media Initiation Failed"), msg,
3327 purple_request_cpar_from_connection(gc));
3315 g_free(msg); 3328 g_free(msg);
3316 g_free(resource); 3329 g_free(resource);
3317 return FALSE; 3330 return FALSE;
3318 } else if(jbr != NULL) { 3331 } else if(jbr != NULL) {
3319 /* they've specified a resource, no need to ask or 3332 /* they've specified a resource, no need to ask or

mercurial