src/protocols/yahoo/yahoo.c

changeset 6513
191231aceb3f
parent 6465
bd201d637ff4
child 6514
3de8c6a985ab
equal deleted inserted replaced
6512:ce27e6f305c8 6513:191231aceb3f
31 #include "request.h" 31 #include "request.h"
32 #include "server.h" 32 #include "server.h"
33 #include "util.h" 33 #include "util.h"
34 #include "html.h" 34 #include "html.h"
35 35
36 #include "yahoo.h"
36 #include "md5.h" 37 #include "md5.h"
37 38
38 /* XXX */ 39 /* XXX */
39 #include "gtkinternal.h" 40 #include "gtkinternal.h"
40 #include "ui.h" 41 #include "ui.h"
562 from = pair->value; 563 from = pair->value;
563 if (pair->key == 15) 564 if (pair->key == 15)
564 tm = strtol(pair->value, NULL, 10); 565 tm = strtol(pair->value, NULL, 10);
565 if (pair->key == 14) { 566 if (pair->key == 14) {
566 char *m; 567 char *m;
567 int i, j;
568 568
569 msg = pair->value; 569 msg = pair->value;
570 570
571 strip_linefeed(msg); 571 strip_linefeed(msg);
572 m = msg; 572 m = yahoo_codes_to_html(msg);
573 for (i = 0, j = 0; m[i]; i++) { 573 serv_got_im(gc, from, m, 0, tm, -1);
574 if (m[i] == 033) { 574 g_free(m);
575 while (m[i] && (m[i] != 'm'))
576 i++;
577 if (!m[i])
578 i--;
579 continue;
580 }
581 msg[j++] = m[i];
582 }
583 msg[j] = 0;
584 serv_got_im(gc, from, msg, 0, tm, -1);
585 575
586 tm = time(NULL); 576 tm = time(NULL);
587 } 577 }
588 l = l->next; 578 l = l->next;
589 } 579 }
1391 yahoo_packet_hash(pkt, 65, group); 1381 yahoo_packet_hash(pkt, 65, group);
1392 yahoo_send_packet(yd, pkt); 1382 yahoo_send_packet(yd, pkt);
1393 yahoo_packet_free(pkt); 1383 yahoo_packet_free(pkt);
1394 } 1384 }
1395 1385
1386 static gboolean yahoo_unload_plugin(GaimPlugin *plugin)
1387 {
1388 yahoo_dest_colorht();
1389 return TRUE;
1390 }
1391
1396 static GaimPlugin *my_protocol = NULL; 1392 static GaimPlugin *my_protocol = NULL;
1397 1393
1398 static GaimPluginProtocolInfo prpl_info = 1394 static GaimPluginProtocolInfo prpl_info =
1399 { 1395 {
1400 GAIM_PROTO_YAHOO, 1396 GAIM_PROTO_YAHOO,
1467 N_("Yahoo Protocol Plugin"), 1463 N_("Yahoo Protocol Plugin"),
1468 NULL, /**< author */ 1464 NULL, /**< author */
1469 GAIM_WEBSITE, /**< homepage */ 1465 GAIM_WEBSITE, /**< homepage */
1470 1466
1471 NULL, /**< load */ 1467 NULL, /**< load */
1472 NULL, /**< unload */ 1468 yahoo_unload_plugin, /**< unload */
1473 NULL, /**< destroy */ 1469 NULL, /**< destroy */
1474 1470
1475 NULL, /**< ui_info */ 1471 NULL, /**< ui_info */
1476 &prpl_info /**< extra_info */ 1472 &prpl_info /**< extra_info */
1477 }; 1473 };
1490 YAHOO_PAGER_PORT); 1486 YAHOO_PAGER_PORT);
1491 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, 1487 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
1492 option); 1488 option);
1493 1489
1494 my_protocol = plugin; 1490 my_protocol = plugin;
1491
1492 yahoo_init_colorht();
1495 } 1493 }
1496 1494
1497 GAIM_INIT_PLUGIN(yahoo, init_plugin, info); 1495 GAIM_INIT_PLUGIN(yahoo, init_plugin, info);

mercurial