comparison libpurple/protocols/silc/buddy.c @ 16445:a5176db228b7

Update SILC to match resent request API changes
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 26 Apr 2007 13:10:57 +0000
parents 32c366eeeb99
children 5e47b3427b28
comparison
equal deleted inserted replaced
16444:eb36a10796d7 16445:a5176db228b7
287 SilcClientEntry client_entry, 287 SilcClientEntry client_entry,
288 const char *hostname, SilcUInt16 port) 288 const char *hostname, SilcUInt16 port)
289 { 289 {
290 char tmp[128], tmp2[128]; 290 char tmp[128], tmp2[128];
291 SilcPurpleKeyAgrAsk a; 291 SilcPurpleKeyAgrAsk a;
292 PurpleConnection *gc = client->application;
292 293
293 g_snprintf(tmp, sizeof(tmp), 294 g_snprintf(tmp, sizeof(tmp),
294 _("Key agreement request received from %s. Would you like to " 295 _("Key agreement request received from %s. Would you like to "
295 "perform the key agreement?"), client_entry->nickname); 296 "perform the key agreement?"), client_entry->nickname);
296 if (hostname) 297 if (hostname)
307 if (hostname) 308 if (hostname)
308 a->hostname = strdup(hostname); 309 a->hostname = strdup(hostname);
309 a->port = port; 310 a->port = port;
310 311
311 purple_request_action(client->application, _("Key Agreement Request"), tmp, 312 purple_request_action(client->application, _("Key Agreement Request"), tmp,
312 hostname ? tmp2 : NULL, 1, a, 2, 313 hostname ? tmp2 : NULL, 1, gc->account, client_entry->nickname,
313 _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb), 314 NULL, a, 2, _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb),
314 _("No"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb)); 315 _("No"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb));
315 } 316 }
316 317
317 static void 318 static void
318 silcpurple_buddy_keyagr(PurpleBlistNode *node, gpointer data) 319 silcpurple_buddy_keyagr(PurpleBlistNode *node, gpointer data)
430 } 431 }
431 432
432 static void 433 static void
433 silcpurple_buddy_privkey(PurpleConnection *gc, const char *name) 434 silcpurple_buddy_privkey(PurpleConnection *gc, const char *name)
434 { 435 {
435 SilcPurple sg = gc->proto_data; 436 SilcPurple sg = gc->proto_data;
436 char *nickname; 437 char *nickname;
437 SilcPurplePrivkey p; 438 SilcPurplePrivkey p;
438 SilcClientEntry *clients; 439 SilcClientEntry *clients;
439 SilcUInt32 clients_count; 440 SilcUInt32 clients_count;
440 441
459 if (!p) 460 if (!p)
460 return; 461 return;
461 p->client = sg->client; 462 p->client = sg->client;
462 p->conn = sg->conn; 463 p->conn = sg->conn;
463 p->client_id = *clients[0]->id; 464 p->client_id = *clients[0]->id;
464 purple_request_input(gc, _("IM With Password"), NULL, 465 purple_request_input(gc, _("IM With Password"), NULL,
465 _("Set IM Password"), NULL, FALSE, TRUE, NULL, 466 _("Set IM Password"), NULL, FALSE, TRUE, NULL,
466 _("OK"), G_CALLBACK(silcpurple_buddy_privkey_cb), 467 _("OK"), G_CALLBACK(silcpurple_buddy_privkey_cb),
467 _("Cancel"), G_CALLBACK(silcpurple_buddy_privkey_cb), 468 _("Cancel"), G_CALLBACK(silcpurple_buddy_privkey_cb),
468 p); 469 gc->account, NULL, NULL, p);
469 470
470 silc_free(clients); 471 silc_free(clients);
471 silc_free(nickname); 472 silc_free(nickname);
472 } 473 }
473 474
1061 } 1062 }
1062 1063
1063 /* Open file selector to select the public key. */ 1064 /* Open file selector to select the public key. */
1064 purple_request_file(r->client->application, _("Open..."), NULL, FALSE, 1065 purple_request_file(r->client->application, _("Open..."), NULL, FALSE,
1065 G_CALLBACK(silcpurple_add_buddy_ask_import), 1066 G_CALLBACK(silcpurple_add_buddy_ask_import),
1066 G_CALLBACK(silcpurple_add_buddy_ask_pk_cancel), r); 1067 G_CALLBACK(silcpurple_add_buddy_ask_pk_cancel),
1068 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r);
1069
1067 } 1070 }
1068 1071
1069 static void 1072 static void
1070 silcpurple_add_buddy_ask_pk(SilcPurpleBuddyRes r) 1073 silcpurple_add_buddy_ask_pk(SilcPurpleBuddyRes r)
1071 { 1074 {
1072 char tmp[512]; 1075 char tmp[512];
1073 g_snprintf(tmp, sizeof(tmp), _("The %s buddy is not present in the network"), 1076 g_snprintf(tmp, sizeof(tmp), _("The %s buddy is not present in the network"),
1074 r->b->name); 1077 r->b->name);
1075 purple_request_action(r->client->application, _("Add Buddy"), tmp, 1078 purple_request_action(r->client->application, _("Add Buddy"), tmp,
1076 _("To add the buddy you must import his/her public key. " 1079 _("To add the buddy you must import his/her public key. "
1077 "Press Import to import a public key."), 0, r, 2, 1080 "Press Import to import a public key."), 0,
1081 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r, 2,
1078 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb), 1082 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb),
1079 _("_Import..."), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb)); 1083 _("_Import..."), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb));
1080 } 1084 }
1081 1085
1082 static void 1086 static void
1178 "the correct user from the list to add to the buddy list.") 1182 "the correct user from the list to add to the buddy list.")
1179 : _("More than one user was found with the same name. Select " 1183 : _("More than one user was found with the same name. Select "
1180 "the correct user from the list to add to the buddy list."), 1184 "the correct user from the list to add to the buddy list."),
1181 fields, 1185 fields,
1182 _("OK"), G_CALLBACK(silcpurple_add_buddy_select_cb), 1186 _("OK"), G_CALLBACK(silcpurple_add_buddy_select_cb),
1183 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_select_cancel), r); 1187 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_select_cancel),
1188 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r);
1184 } 1189 }
1185 1190
1186 static void 1191 static void
1187 silcpurple_add_buddy_resolved(SilcClient client, 1192 silcpurple_add_buddy_resolved(SilcClient client,
1188 SilcClientConnection conn, 1193 SilcClientConnection conn,