comparison src/protocols/yahoo/yahoo.c @ 5205:fefad67de2c7

[gaim-migrate @ 5573] I had a damn good commit message, but it was eaten. Let's try it again. Announcing, Gaim Plugin API version 2.0, or GPAPIV2.0 for short. There are lots'a cool thingies here. Okay now, this isn't as cool as the previous message, but: 1) There's now a single entry function for all plugin types. It returns a detailed information structure on the plugin. This removes a lot of the ugliness from old plugins. Oh yeah, libicq wasn't converted to this, so if you use it, well, you shouldn't have used it anyway, but now you can't! bwahahaha. Use AIM/ICQ. 2) There are now 3 types of plugins: Standard, Loader, and Protocol plugins. Standard plugins are, well, standard, compiled plugins. Loader plugins load other plugins. For example, the perl support is now a loader plugin. It loads perl scripts. In the future, we'll have Ruby and Python loader plugins. Protocol plugins are, well, protocol plugins... yeah... 3) Plugins have unique IDs, so they can be referred to or automatically updated from a plugin database in the future. Neat, huh? 4) Plugins will have dependency support in the future, and can be hidden, so if you have, say, a logging core plugin, it won't have to show up, but then you load the GTK+ logging plugin and it'll auto-load the core plugin. Core/UI split plugins! 5) There will eventually be custom plugin signals and RPC of some sort, for the core/ui split plugins. So, okay, back up .gaimrc. I'd like to thank my parents for their support, javabsp for helping convert a bunch of protocol plugins, and Etan for helping convert a bunch of standard plugins. Have fun. If you have any problems, please let me know, but you probably won't have anything major happen. You will have to convert your plugins, though, and I'm not guaranteeing that all perl scripts will still work. I'll end up changing the perl script API eventually, so I know they won't down the road. Don't worry, though. It'll be mass cool. faceprint wants me to just commit the damn code already. So, here we go!!! .. .. I need a massage. From a young, cute girl. Are there any young, cute girls in the audience? IM me plz k thx. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 25 Apr 2003 06:47:33 +0000
parents 381da05cb5ed
children 00bd3019749e
comparison
equal deleted inserted replaced
5204:44de70702205 5205:fefad67de2c7
1379 yahoo_packet_hash(pkt, 65, group); 1379 yahoo_packet_hash(pkt, 65, group);
1380 yahoo_send_packet(yd, pkt); 1380 yahoo_send_packet(yd, pkt);
1381 yahoo_packet_free(pkt); 1381 yahoo_packet_free(pkt);
1382 } 1382 }
1383 1383
1384 static struct prpl *my_protocol = NULL; 1384 static GaimPlugin *my_protocol = NULL;
1385 1385
1386 G_MODULE_EXPORT void yahoo_init(struct prpl *ret) { 1386 #if 0
1387 G_MODULE_EXPORT void yahoo_init(GaimPlugin *ret) {
1387 struct proto_user_opt *puo; 1388 struct proto_user_opt *puo;
1388 ret->protocol = PROTO_YAHOO; 1389 ret->protocol = PROTO_YAHOO;
1389 ret->options = OPT_PROTO_MAIL_CHECK; 1390 ret->options = OPT_PROTO_MAIL_CHECK;
1390 ret->name = g_strdup("Yahoo"); 1391 ret->name = g_strdup("Yahoo");
1391 ret->login = yahoo_login; 1392 ret->login = yahoo_login;
1427 yahoo_init(prpl); 1428 yahoo_init(prpl);
1428 prpl->plug->desc.api_version = PLUGIN_API_VERSION; 1429 prpl->plug->desc.api_version = PLUGIN_API_VERSION;
1429 } 1430 }
1430 1431
1431 #endif 1432 #endif
1433 #endif
1434
1435 static GaimPluginProtocolInfo prpl_info =
1436 {
1437 GAIM_PROTO_YAHOO,
1438 OPT_PROTO_MAIL_CHECK,
1439 NULL,
1440 NULL,
1441 yahoo_list_icon,
1442 yahoo_list_emblems,
1443 yahoo_status_text,
1444 yahoo_tooltip_text,
1445 yahoo_away_states,
1446 yahoo_actions,
1447 yahoo_buddy_menu,
1448 NULL,
1449 yahoo_login,
1450 yahoo_close,
1451 yahoo_send_im,
1452 NULL,
1453 yahoo_send_typing,
1454 NULL,
1455 yahoo_set_away,
1456 NULL,
1457 NULL,
1458 NULL,
1459 NULL,
1460 yahoo_set_idle,
1461 NULL,
1462 yahoo_add_buddy,
1463 NULL,
1464 yahoo_remove_buddy,
1465 NULL,
1466 NULL,
1467 NULL,
1468 NULL,
1469 NULL,
1470 NULL,
1471 NULL,
1472 NULL,
1473 NULL,
1474 NULL,
1475 NULL,
1476 NULL,
1477 yahoo_keepalive,
1478 NULL,
1479 NULL,
1480 NULL,
1481 NULL,
1482 NULL,
1483 NULL,
1484 NULL,
1485 NULL,
1486 NULL
1487 };
1488
1489 static GaimPluginInfo info =
1490 {
1491 2, /**< api_version */
1492 GAIM_PLUGIN_PROTOCOL, /**< type */
1493 NULL, /**< ui_requirement */
1494 0, /**< flags */
1495 NULL, /**< dependencies */
1496 GAIM_PRIORITY_DEFAULT, /**< priority */
1497
1498 "prpl-yahoo", /**< id */
1499 "Yahoo", /**< name */
1500 VERSION, /**< version */
1501 /** summary */
1502 N_("Yahoo Protocol Plugin"),
1503 /** description */
1504 N_("Yahoo Protocol Plugin"),
1505 NULL, /**< author */
1506 WEBSITE, /**< homepage */
1507
1508 NULL, /**< load */
1509 NULL, /**< unload */
1510 NULL, /**< destroy */
1511
1512 NULL, /**< ui_info */
1513 &prpl_info /**< extra_info */
1514 };
1515
1516 static void
1517 __init_plugin(GaimPlugin *plugin)
1518 {
1519 struct proto_user_opt *puo;
1520
1521 puo = g_new0(struct proto_user_opt, 1);
1522 puo->label = g_strdup("Pager Host:");
1523 puo->def = g_strdup(YAHOO_PAGER_HOST);
1524 puo->pos = USEROPT_PAGERHOST;
1525 prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
1526
1527 puo = g_new0(struct proto_user_opt, 1);
1528 puo->label = g_strdup("Pager Port:");
1529 puo->def = g_strdup("5050");
1530 puo->pos = USEROPT_PAGERPORT;
1531 prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
1532
1533 my_protocol = plugin;
1534 }
1535
1536 GAIM_INIT_PLUGIN(yahoo, __init_plugin, info);