| 1400 purple_debug(purple_level, "gg", "%s", msg); |
1400 purple_debug(purple_level, "gg", "%s", msg); |
| 1401 g_free(msg); |
1401 g_free(msg); |
| 1402 } |
1402 } |
| 1403 |
1403 |
| 1404 static void |
1404 static void |
| 1405 ggp_protocol_base_init(GGPProtocolClass *klass) |
1405 ggp_protocol_init(PurpleProtocol *protocol) |
| 1406 { |
1406 { |
| 1407 PurpleProtocolClass *proto_class = PURPLE_PROTOCOL_CLASS(klass); |
|
| 1408 PurpleAccountOption *option; |
1407 PurpleAccountOption *option; |
| 1409 GList *encryption_options = NULL; |
1408 GList *encryption_options = NULL; |
| 1410 |
1409 |
| 1411 proto_class->id = "gg"; |
1410 protocol->id = "gg"; |
| 1412 proto_class->name = "Gadu-Gadu"; |
1411 protocol->name = "Gadu-Gadu"; |
| 1413 proto_class->options = OPT_PROTO_REGISTER_NOSCREENNAME | |
1412 protocol->options = OPT_PROTO_REGISTER_NOSCREENNAME | |
| 1414 OPT_PROTO_IM_IMAGE; |
1413 OPT_PROTO_IM_IMAGE; |
| 1415 proto_class->icon_spec = purple_buddy_icon_spec_new("png", |
1414 protocol->icon_spec = purple_buddy_icon_spec_new("png", |
| 1416 1, 1, 200, 200, 0, |
1415 1, 1, 200, 200, 0, |
| 1417 PURPLE_ICON_SCALE_DISPLAY | |
1416 PURPLE_ICON_SCALE_DISPLAY | |
| 1418 PURPLE_ICON_SCALE_SEND); |
1417 PURPLE_ICON_SCALE_SEND); |
| 1419 |
1418 |
| 1420 purple_prefs_add_none("/protocols/gg"); |
|
| 1421 |
|
| 1422 option = purple_account_option_string_new(_("GG server"), |
1419 option = purple_account_option_string_new(_("GG server"), |
| 1423 "gg_server", ""); |
1420 "gg_server", ""); |
| 1424 proto_class->protocol_options = g_list_append(proto_class->protocol_options, |
1421 protocol->protocol_options = g_list_append(protocol->protocol_options, |
| 1425 option); |
1422 option); |
| 1426 ggp_server_option = option; |
1423 ggp_server_option = option; |
| 1427 |
1424 |
| 1428 #define ADD_VALUE(list, desc, v) { \ |
1425 #define ADD_VALUE(list, desc, v) { \ |
| 1429 PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \ |
1426 PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \ |
| 1437 ADD_VALUE(encryption_options, _("Require encryption"), "require_tls"); |
1434 ADD_VALUE(encryption_options, _("Require encryption"), "require_tls"); |
| 1438 ADD_VALUE(encryption_options, _("Don't use encryption"), "none"); |
1435 ADD_VALUE(encryption_options, _("Don't use encryption"), "none"); |
| 1439 |
1436 |
| 1440 option = purple_account_option_list_new(_("Connection security"), |
1437 option = purple_account_option_list_new(_("Connection security"), |
| 1441 "encryption", encryption_options); |
1438 "encryption", encryption_options); |
| 1442 proto_class->protocol_options = g_list_append(proto_class->protocol_options, |
1439 protocol->protocol_options = g_list_append(protocol->protocol_options, |
| 1443 option); |
1440 option); |
| 1444 |
1441 |
| 1445 option = purple_account_option_bool_new(_("Show links from strangers"), |
1442 option = purple_account_option_bool_new(_("Show links from strangers"), |
| 1446 "show_links_from_strangers", 1); |
1443 "show_links_from_strangers", 1); |
| 1447 proto_class->protocol_options = g_list_append(proto_class->protocol_options, |
1444 protocol->protocol_options = g_list_append(protocol->protocol_options, |
| 1448 option); |
1445 option); |
| |
1446 } |
| |
1447 |
| |
1448 static void |
| |
1449 ggp_protocol_class_init(PurpleProtocolClass *klass) |
| |
1450 { |
| 1449 } |
1451 } |
| 1450 |
1452 |
| 1451 static void |
1453 static void |
| 1452 ggp_protocol_interface_init(PurpleProtocolInterface *iface) |
1454 ggp_protocol_interface_init(PurpleProtocolInterface *iface) |
| 1453 { |
1455 { |
| 1514 { |
1516 { |
| 1515 my_protocol = purple_protocols_add(GGP_TYPE_PROTOCOL, error); |
1517 my_protocol = purple_protocols_add(GGP_TYPE_PROTOCOL, error); |
| 1516 if (!my_protocol) |
1518 if (!my_protocol) |
| 1517 return FALSE; |
1519 return FALSE; |
| 1518 |
1520 |
| |
1521 purple_prefs_add_none("/protocols/gg"); |
| |
1522 |
| 1519 gg_debug_handler = purple_gg_debug_handler; |
1523 gg_debug_handler = purple_gg_debug_handler; |
| 1520 |
1524 |
| 1521 purple_debug_info("gg", "Loading Gadu-Gadu protocol plugin with " |
1525 purple_debug_info("gg", "Loading Gadu-Gadu protocol plugin with " |
| 1522 "libgadu %s...\n", gg_libgadu_version()); |
1526 "libgadu %s...\n", gg_libgadu_version()); |
| 1523 |
1527 |