comparison src/protocols/msn/msn.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 9431b31f8f62
children 15a0e82a0936
comparison
equal deleted inserted replaced
3571:a88c62c5b7da 3572:bdd0bebd2d04
151 (tmp)++; \ 151 (tmp)++; \
152 *(tmp)++ = 0; \ 152 *(tmp)++ = 0; \
153 while (*(tmp) && isspace(*(tmp))) \ 153 while (*(tmp) && isspace(*(tmp))) \
154 (tmp)++; 154 (tmp)++;
155 155
156 static char *msn_name()
157 {
158 return "MSN";
159 }
160 156
161 static char *msn_normalize(const char *s) 157 static char *msn_normalize(const char *s)
162 { 158 {
163 static char buf[BUF_LEN]; 159 static char buf[BUF_LEN];
164 160
2400 2396
2401 static void msn_buddy_free(struct buddy *b) 2397 static void msn_buddy_free(struct buddy *b)
2402 { 2398 {
2403 if (b->proto_data) 2399 if (b->proto_data)
2404 g_free(b->proto_data); 2400 g_free(b->proto_data);
2405 }
2406
2407 static GList *msn_user_opts()
2408 {
2409 GList *m = NULL;
2410 struct proto_user_opt *puo;
2411
2412 puo = g_new0(struct proto_user_opt, 1);
2413 puo->label = "Server:";
2414 puo->def = MSN_SERVER;
2415 puo->pos = USEROPT_MSNSERVER;
2416 m = g_list_append(m, puo);
2417
2418 puo = g_new0(struct proto_user_opt, 1);
2419 puo->label = "Port:";
2420 puo->def = "1863";
2421 puo->pos = USEROPT_MSNPORT;
2422 m = g_list_append(m, puo);
2423
2424 return m;
2425 } 2401 }
2426 2402
2427 GSList *msn_smiley_list() 2403 GSList *msn_smiley_list()
2428 { 2404 {
2429 GSList *smilies = NULL; 2405 GSList *smilies = NULL;
2528 2504
2529 static struct prpl *my_protocol = NULL; 2505 static struct prpl *my_protocol = NULL;
2530 2506
2531 void msn_init(struct prpl *ret) 2507 void msn_init(struct prpl *ret)
2532 { 2508 {
2509 struct proto_user_opt *puo;
2533 ret->protocol = PROTO_MSN; 2510 ret->protocol = PROTO_MSN;
2534 ret->options = OPT_PROTO_MAIL_CHECK; 2511 ret->options = OPT_PROTO_MAIL_CHECK;
2535 ret->name = msn_name; 2512 ret->name = g_strdup("MSN");
2536 ret->list_icon = msn_list_icon; 2513 ret->list_icon = msn_list_icon;
2537 ret->buddy_menu = msn_buddy_menu; 2514 ret->buddy_menu = msn_buddy_menu;
2538 ret->login = msn_login; 2515 ret->login = msn_login;
2539 ret->close = msn_close; 2516 ret->close = msn_close;
2540 ret->send_im = msn_send_im; 2517 ret->send_im = msn_send_im;
2557 ret->rem_permit = msn_rem_permit; 2534 ret->rem_permit = msn_rem_permit;
2558 ret->add_deny = msn_add_deny; 2535 ret->add_deny = msn_add_deny;
2559 ret->rem_deny = msn_rem_deny; 2536 ret->rem_deny = msn_rem_deny;
2560 ret->buddy_free = msn_buddy_free; 2537 ret->buddy_free = msn_buddy_free;
2561 ret->smiley_list = msn_smiley_list; 2538 ret->smiley_list = msn_smiley_list;
2562 ret->user_opts = msn_user_opts; 2539
2540 puo = g_new0(struct proto_user_opt, 1);
2541 puo->label = g_strdup("Server:");
2542 puo->def = g_strdup(MSN_SERVER);
2543 puo->pos = USEROPT_MSNSERVER;
2544 ret->user_opts = g_list_append(ret->user_opts, puo);
2545
2546 puo = g_new0(struct proto_user_opt, 1);
2547 puo->label = g_strdup("Port:");
2548 puo->def = g_strdup("1863");
2549 puo->pos = USEROPT_MSNPORT;
2550 ret->user_opts = g_list_append(ret->user_opts, puo);
2563 2551
2564 my_protocol = ret; 2552 my_protocol = ret;
2565 } 2553 }
2566 2554
2567 #ifndef STATIC 2555 #ifndef STATIC
2568 2556
2569 char *gaim_plugin_init(GModule *handle) 2557 void *gaim_prpl_init(struct prpl *prpl)
2570 { 2558 {
2571 load_protocol(msn_init, sizeof(struct prpl)); 2559 msn_init(prpl);
2572 return NULL; 2560 prpl->plug->desc.api_version = PLUGIN_API_VERSION;
2573 } 2561 }
2574 2562
2575 void gaim_plugin_remove() 2563 void gaim_plugin_remove()
2576 { 2564 {
2577 struct prpl *p = find_prpl(PROTO_MSN); 2565 struct prpl *p = find_prpl(PROTO_MSN);