comparison libpurple/protocols/yahoo/yahoo.c @ 25497:67ad619bd97f

propagate from branch 'im.pidgin.pidgin' (head 3d1e6b8637ff9133c8f17e9aeaeea1284c898d86) to branch 'im.pidgin.pidgin.yaz' (head cf1ed778db33093adccaec9aa0399ac72a0b712f)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 04 Jun 2007 07:22:38 +0000
parents df788cd53596 b81b1732fb64
children ff69c2a9ccf2
comparison
equal deleted inserted replaced
17708:794abbe3e14e 25497:67ad619bd97f
3408 3408
3409 return; 3409 return;
3410 } 3410 }
3411 3411
3412 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, YAHOO_STATUS_AVAILABLE, 0); 3412 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, YAHOO_STATUS_AVAILABLE, 0);
3413 if(!pkt) { // yaz
3414 purple_debug_info("yahoo", "yahoo_set_idle: pkt == NULL\n");
3415 return;
3416 }
3413 yahoo_packet_hash_int(pkt, 10, yd->current_status); 3417 yahoo_packet_hash_int(pkt, 10, yd->current_status);
3414 3418
3415 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 3419 if (yd->current_status == YAHOO_STATUS_CUSTOM) {
3416 yahoo_packet_hash_str(pkt, 19, conv_msg); 3420 yahoo_packet_hash_str(pkt, 19, conv_msg);
3417 } else { 3421 } else {
3451 status = purple_presence_get_active_status(purple_account_get_presence(purple_connection_get_account(gc))); 3455 status = purple_presence_get_active_status(purple_account_get_presence(purple_connection_get_account(gc)));
3452 yd->current_status = get_yahoo_status_from_purple_status(status); 3456 yd->current_status = get_yahoo_status_from_purple_status(status);
3453 } 3457 }
3454 3458
3455 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, YAHOO_STATUS_AVAILABLE, 0); 3459 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, YAHOO_STATUS_AVAILABLE, 0);
3460 if(!pkt) {
3461 purple_debug_info("yahoo", "yahoo_set_idle: pkt == NULL\n");
3462 return;
3463 }
3456 3464
3457 yahoo_packet_hash_int(pkt, 10, yd->current_status); 3465 yahoo_packet_hash_int(pkt, 10, yd->current_status);
3458 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 3466 if (yd->current_status == YAHOO_STATUS_CUSTOM) {
3459 const char *tmp; 3467 const char *tmp;
3460 if (status == NULL) 3468 if (status == NULL)
3461 status = purple_presence_get_active_status(purple_account_get_presence(purple_connection_get_account(gc))); 3469 status = purple_presence_get_active_status(purple_account_get_presence(purple_connection_get_account(gc)));
3462 tmp = purple_status_get_attr_string(status, "message"); 3470 tmp = purple_status_get_attr_string(status, "message");
3463 if (tmp != NULL) { 3471 if (tmp != NULL) {
3464 msg = yahoo_string_encode(gc, tmp, NULL); 3472 msg = yahoo_string_encode(gc, tmp, NULL);
3465 msg2 = purple_markup_strip_html(msg); 3473 msg2 = purple_markup_strip_html(msg);
3466 yahoo_packet_hash_str(pkt, 19, msg2); 3474 yahoo_packet_hash_str(pkt, 19, msg2); // yaz: pkt may be NULL.
3467 } else { 3475 } else {
3468 /* get_yahoo_status_from_purple_status() returns YAHOO_STATUS_CUSTOM for 3476 /* get_yahoo_status_from_purple_status() returns YAHOO_STATUS_CUSTOM for
3469 * the generic away state (YAHOO_STATUS_TYPE_AWAY) with no message */ 3477 * the generic away state (YAHOO_STATUS_TYPE_AWAY) with no message */
3470 yahoo_packet_hash_str(pkt, 19, _("Away")); 3478 yahoo_packet_hash_str(pkt, 19, _("Away"));
3471 } 3479 }
4110 4118
4111 option = purple_account_option_string_new(_("Encoding"), "local_charset", "ISO-8859-1"); 4119 option = purple_account_option_string_new(_("Encoding"), "local_charset", "ISO-8859-1");
4112 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 4120 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
4113 4121
4114 4122
4115 #if 0 4123 #if 1
4116 option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL); 4124 option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
4117 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 4125 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
4118 4126
4119 option = purple_account_option_string_new(_("Yahoo Chat server"), "ycht-server", YAHOO_YCHT_HOST); 4127 option = purple_account_option_string_new(_("Yahoo Chat server"), "ycht-server", YAHOO_YCHT_HOST);
4120 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 4128 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);