comparison src/protocols/yahoo/yahoo.c @ 3572:bdd0bebd2d04

[gaim-migrate @ 3670] Phase II. No longer do you have to worry about protocol plugins. When Gaim probes plugins on load, it will detect protocol plugins and add them to the list of available protocols. When you try to log an account on with one of them, Gaim will automatically load the plugin--when no more accounts need the protocol--Gaim will automatically unload it. Protocol plugins are no longer available in the plugins ui, and no protocols are compiled statically by default. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 30 Sep 2002 01:05:18 +0000
parents 82180bb28f1f
children bb966d68f9e3
comparison
equal deleted inserted replaced
3571:a88c62c5b7da 3572:bdd0bebd2d04
171 guint32 status; 171 guint32 status;
172 guint32 id; 172 guint32 id;
173 GSList *hash; 173 GSList *hash;
174 }; 174 };
175 175
176 static char *yahoo_name() {
177 return "Yahoo";
178 }
179
180 #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4) 176 #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4)
181 177
182 static struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id) 178 static struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id)
183 { 179 {
184 struct yahoo_packet *pkt = g_new0(struct yahoo_packet, 1); 180 struct yahoo_packet *pkt = g_new0(struct yahoo_packet, 1);
1122 pbm->callback = yahoo_game; 1118 pbm->callback = yahoo_game;
1123 pbm->gc = gc; 1119 pbm->gc = gc;
1124 m = g_list_append(m, pbm); 1120 m = g_list_append(m, pbm);
1125 } 1121 }
1126 } 1122 }
1127
1128 return m;
1129 }
1130
1131 static GList *yahoo_user_opts()
1132 {
1133 GList *m = NULL;
1134 struct proto_user_opt *puo;
1135
1136 puo = g_new0(struct proto_user_opt, 1);
1137 puo->label = "Pager Host:";
1138 puo->def = YAHOO_PAGER_HOST;
1139 puo->pos = USEROPT_PAGERHOST;
1140 m = g_list_append(m, puo);
1141
1142 puo = g_new0(struct proto_user_opt, 1);
1143 puo->label = "Pager Port:";
1144 puo->def = "5050";
1145 puo->pos = USEROPT_PAGERPORT;
1146 m = g_list_append(m, puo);
1147 1123
1148 return m; 1124 return m;
1149 } 1125 }
1150 1126
1151 static void yahoo_act_id(gpointer data, char *entry) 1127 static void yahoo_act_id(gpointer data, char *entry)
1433 } 1409 }
1434 1410
1435 static struct prpl *my_protocol = NULL; 1411 static struct prpl *my_protocol = NULL;
1436 1412
1437 void yahoo_init(struct prpl *ret) { 1413 void yahoo_init(struct prpl *ret) {
1414 struct proto_user_opt *puo;
1438 ret->protocol = PROTO_YAHOO; 1415 ret->protocol = PROTO_YAHOO;
1439 ret->options = OPT_PROTO_MAIL_CHECK; 1416 ret->options = OPT_PROTO_MAIL_CHECK;
1440 ret->name = yahoo_name; 1417 ret->name = g_strdup("Yahoo");
1441 ret->user_opts = yahoo_user_opts;
1442 ret->login = yahoo_login; 1418 ret->login = yahoo_login;
1443 ret->close = yahoo_close; 1419 ret->close = yahoo_close;
1444 ret->buddy_menu = yahoo_buddy_menu; 1420 ret->buddy_menu = yahoo_buddy_menu;
1445 ret->list_icon = yahoo_list_icon; 1421 ret->list_icon = yahoo_list_icon;
1446 ret->actions = yahoo_actions; 1422 ret->actions = yahoo_actions;
1453 ret->add_buddy = yahoo_add_buddy; 1429 ret->add_buddy = yahoo_add_buddy;
1454 ret->remove_buddy = yahoo_remove_buddy; 1430 ret->remove_buddy = yahoo_remove_buddy;
1455 ret->send_typing = yahoo_send_typing; 1431 ret->send_typing = yahoo_send_typing;
1456 ret->smiley_list = yahoo_smiley_list; 1432 ret->smiley_list = yahoo_smiley_list;
1457 1433
1434 puo = g_new0(struct proto_user_opt, 1);
1435 puo->label = g_strdup("Pager Host:");
1436 puo->def = g_strdup(YAHOO_PAGER_HOST);
1437 puo->pos = USEROPT_PAGERHOST;
1438 ret->user_opts = g_list_append(ret->user_opts, puo);
1439
1440 puo = g_new0(struct proto_user_opt, 1);
1441 puo->label = g_strdup("Pager Port:");
1442 puo->def = g_strdup("5050");
1443 puo->pos = USEROPT_PAGERPORT;
1444 ret->user_opts = g_list_append(ret->user_opts, puo);
1445
1458 my_protocol = ret; 1446 my_protocol = ret;
1459 } 1447 }
1460 1448
1461 #ifndef STATIC 1449 #ifndef STATIC
1462 1450
1463 char *gaim_plugin_init(GModule *handle) 1451 void *gaim_prpl_init(struct prpl *prpl)
1464 { 1452 {
1465 load_protocol(yahoo_init, sizeof(struct prpl)); 1453 yahoo_init(prpl);
1466 return NULL; 1454 prpl->plug->desc.api_version = PLUGIN_API_VERSION;
1467 }
1468
1469 void gaim_plugin_remove()
1470 {
1471 struct prpl *p = find_prpl(PROTO_YAHOO);
1472 if (p == my_protocol)
1473 unload_protocol(p);
1474 }
1475
1476 char *name()
1477 {
1478 return "Yahoo";
1479 }
1480
1481 char *description()
1482 {
1483 return PRPL_DESC("Yahoo");
1484 } 1455 }
1485 1456
1486 #endif 1457 #endif