| 1195 char *who; |
1195 char *who; |
| 1196 YahooFederation fed; |
1196 YahooFederation fed; |
| 1197 }; |
1197 }; |
| 1198 |
1198 |
| 1199 static void |
1199 static void |
| 1200 yahoo_buddy_add_authorize_cb(gpointer data) |
1200 yahoo_buddy_add_authorize_cb(const char *message, gpointer data) |
| 1201 { |
1201 { |
| 1202 struct yahoo_add_request *add_req = data; |
1202 struct yahoo_add_request *add_req = data; |
| 1203 struct yahoo_packet *pkt; |
1203 struct yahoo_packet *pkt; |
| 1204 YahooData *yd = purple_connection_get_protocol_data(add_req->gc); |
1204 YahooData *yd = purple_connection_get_protocol_data(add_req->gc); |
| 1205 const char *who = add_req->who; |
1205 const char *who = add_req->who; |
| 1228 g_free(add_req->who); |
1228 g_free(add_req->who); |
| 1229 g_free(add_req); |
1229 g_free(add_req); |
| 1230 } |
1230 } |
| 1231 |
1231 |
| 1232 static void |
1232 static void |
| 1233 yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) |
1233 yahoo_buddy_add_deny_cb(const char *msg, struct yahoo_add_request *add_req) |
| 1234 { |
1234 { |
| 1235 YahooData *yd = purple_connection_get_protocol_data(add_req->gc); |
1235 YahooData *yd = purple_connection_get_protocol_data(add_req->gc); |
| 1236 struct yahoo_packet *pkt; |
1236 struct yahoo_packet *pkt; |
| 1237 char *encoded_msg = NULL; |
1237 char *encoded_msg = NULL; |
| 1238 const char *who = add_req->who; |
1238 const char *who = add_req->who; |
| 1270 g_free(encoded_msg); |
1270 g_free(encoded_msg); |
| 1271 |
1271 |
| 1272 g_free(add_req->id); |
1272 g_free(add_req->id); |
| 1273 g_free(add_req->who); |
1273 g_free(add_req->who); |
| 1274 g_free(add_req); |
1274 g_free(add_req); |
| 1275 } |
|
| 1276 |
|
| 1277 static void |
|
| 1278 yahoo_buddy_add_deny_noreason_cb(struct yahoo_add_request *add_req, const char*msg) |
|
| 1279 { |
|
| 1280 yahoo_buddy_add_deny_cb(add_req, NULL); |
|
| 1281 } |
|
| 1282 |
|
| 1283 static void |
|
| 1284 yahoo_buddy_add_deny_reason_cb(gpointer data) { |
|
| 1285 struct yahoo_add_request *add_req = data; |
|
| 1286 purple_request_input(add_req->gc, NULL, _("Authorization denied message:"), |
|
| 1287 NULL, _("No reason given."), TRUE, FALSE, NULL, |
|
| 1288 _("OK"), G_CALLBACK(yahoo_buddy_add_deny_cb), |
|
| 1289 _("Cancel"), G_CALLBACK(yahoo_buddy_add_deny_noreason_cb), |
|
| 1290 purple_connection_get_account(add_req->gc), add_req->who, NULL, |
|
| 1291 add_req); |
|
| 1292 } |
1275 } |
| 1293 |
1276 |
| 1294 static void yahoo_buddy_denied_our_add(PurpleConnection *gc, const char *who, const char *reason) |
1277 static void yahoo_buddy_denied_our_add(PurpleConnection *gc, const char *who, const char *reason) |
| 1295 { |
1278 { |
| 1296 char *notify_msg; |
1279 char *notify_msg; |
| 1451 */ |
1434 */ |
| 1452 purple_account_request_authorization(account, add_req->who, add_req->id, |
1435 purple_account_request_authorization(account, add_req->who, add_req->id, |
| 1453 alias, dec_msg, |
1436 alias, dec_msg, |
| 1454 purple_find_buddy(account, add_req->who) != NULL, |
1437 purple_find_buddy(account, add_req->who) != NULL, |
| 1455 yahoo_buddy_add_authorize_cb, |
1438 yahoo_buddy_add_authorize_cb, |
| 1456 yahoo_buddy_add_deny_reason_cb, |
1439 yahoo_buddy_add_deny_cb, |
| 1457 add_req); |
1440 add_req); |
| 1458 g_free(alias); |
1441 g_free(alias); |
| 1459 g_free(dec_msg); |
1442 g_free(dec_msg); |
| 1460 } else { |
1443 } else { |
| 1461 g_free(add_req->id); |
1444 g_free(add_req->id); |
| 1516 */ |
1499 */ |
| 1517 purple_account_request_authorization(account, add_req->who, add_req->id, |
1500 purple_account_request_authorization(account, add_req->who, add_req->id, |
| 1518 NULL, dec_msg, |
1501 NULL, dec_msg, |
| 1519 purple_find_buddy(account,add_req->who) != NULL, |
1502 purple_find_buddy(account,add_req->who) != NULL, |
| 1520 yahoo_buddy_add_authorize_cb, |
1503 yahoo_buddy_add_authorize_cb, |
| 1521 yahoo_buddy_add_deny_reason_cb, add_req); |
1504 yahoo_buddy_add_deny_cb, add_req); |
| 1522 g_free(dec_msg); |
1505 g_free(dec_msg); |
| 1523 } else { |
1506 } else { |
| 1524 g_free(add_req->id); |
1507 g_free(add_req->id); |
| 1525 g_free(add_req->who); |
1508 g_free(add_req->who); |
| 1526 g_free(add_req); |
1509 g_free(add_req); |