comparison libpurple/protocols/yahoo/libymsg.c @ 32827:4a34689eeb33 default tip

merged from im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 19 Nov 2011 14:42:54 +0900
parents 0f94ec89f0bc 3e7a7e14af62
children
comparison
equal deleted inserted replaced
32692:0f94ec89f0bc 32827:4a34689eeb33
335 PurpleBuddy *b; 335 PurpleBuddy *b;
336 336
337 if (!name) 337 if (!name)
338 break; 338 break;
339 339
340 b = purple_find_buddy(gc->account, name); 340 b = purple_find_buddy(purple_connection_get_account(gc), name);
341 341
342 if (!cksum || (cksum == -1)) { 342 if (!cksum || (cksum == -1)) {
343 if (f) 343 if (f)
344 yahoo_friend_set_buddy_icon_need_request(f, TRUE); 344 yahoo_friend_set_buddy_icon_need_request(f, TRUE);
345 purple_buddy_icons_set_for_user(gc->account, name, NULL, 0, NULL); 345 purple_buddy_icons_set_for_user(purple_connection_get_account(gc), name, NULL, 0, NULL);
346 break; 346 break;
347 } 347 }
348 348
349 if (!f) 349 if (!f)
350 break; 350 break;
571 f->p2p_packet_sent = 0; 571 f->p2p_packet_sent = 0;
572 } else 572 } else
573 yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_DO_NOT_CONNECT); 573 yahoo_friend_set_p2p_status(f, YAHOO_P2PSTATUS_DO_NOT_CONNECT);
574 } else { 574 } else {
575 /* This buddy is on the ignore list (and therefore in no group) */ 575 /* This buddy is on the ignore list (and therefore in no group) */
576 purple_debug_info("yahoo", "%s adding %s to the deny list because of the ignore list / no group was found\n",account->username, norm_bud); 576 purple_debug_info("yahoo", "%s adding %s to the deny list because of the ignore list / no group was found\n", purple_account_get_username(account), norm_bud);
577 purple_privacy_deny_add(account, norm_bud, 1); 577 purple_privacy_deny_add(account, norm_bud, 1);
578 } 578 }
579 579
580 g_free(norm_bud); 580 g_free(norm_bud);
581 norm_bud=NULL; 581 norm_bud=NULL;
746 g_string_free(yd->tmp_serv_ilist, TRUE); 746 g_string_free(yd->tmp_serv_ilist, TRUE);
747 yd->tmp_serv_ilist = NULL; 747 yd->tmp_serv_ilist = NULL;
748 } 748 }
749 749
750 if (got_serv_list && 750 if (got_serv_list &&
751 ((account->perm_deny != PURPLE_PRIVACY_ALLOW_BUDDYLIST) && 751 ((purple_account_get_privacy_type(account) != PURPLE_PRIVACY_ALLOW_BUDDYLIST) &&
752 (account->perm_deny != PURPLE_PRIVACY_DENY_ALL) && 752 (purple_account_get_privacy_type(account) != PURPLE_PRIVACY_DENY_ALL) &&
753 (account->perm_deny != PURPLE_PRIVACY_ALLOW_USERS))) 753 (purple_account_get_privacy_type(account) != PURPLE_PRIVACY_ALLOW_USERS)))
754 { 754 {
755 account->perm_deny = PURPLE_PRIVACY_DENY_USERS; 755 purple_account_set_privacy_type(account, PURPLE_PRIVACY_DENY_USERS);
756 purple_debug_info("yahoo", "%s privacy defaulting to PURPLE_PRIVACY_DENY_USERS.\n", 756 purple_debug_info("yahoo", "%s privacy defaulting to PURPLE_PRIVACY_DENY_USERS.\n",
757 account->username); 757 purple_account_get_username(account));
758 } 758 }
759 759
760 if (yd->tmp_serv_plist) { 760 if (yd->tmp_serv_plist) {
761 buddies = g_strsplit(yd->tmp_serv_plist->str, ",", -1); 761 buddies = g_strsplit(yd->tmp_serv_plist->str, ",", -1);
762 for (bud = buddies; bud && *bud; bud++) { 762 for (bud = buddies; bud && *bud; bud++) {
763 f = yahoo_friend_find(gc, *bud); 763 f = yahoo_friend_find(gc, *bud);
764 if (f) { 764 if (f) {
765 purple_debug_info("yahoo", "%s setting presence for %s to PERM_OFFLINE\n", 765 purple_debug_info("yahoo", "%s setting presence for %s to PERM_OFFLINE\n",
766 account->username, *bud); 766 purple_account_get_username(account), *bud);
767 f->presence = YAHOO_PRESENCE_PERM_OFFLINE; 767 f->presence = YAHOO_PRESENCE_PERM_OFFLINE;
768 } 768 }
769 } 769 }
770 g_strfreev(buddies); 770 g_strfreev(buddies);
771 g_string_free(yd->tmp_serv_plist, TRUE); 771 g_string_free(yd->tmp_serv_plist, TRUE);
2184 case 12: 2184 case 12:
2185 purple_debug_info("yahoo", "Server reported \"is a buddy\" for %s while %s", 2185 purple_debug_info("yahoo", "Server reported \"is a buddy\" for %s while %s",
2186 who, (ignore ? "ignoring" : "unignoring")); 2186 who, (ignore ? "ignoring" : "unignoring"));
2187 2187
2188 if (ignore) { 2188 if (ignore) {
2189 b = purple_find_buddy(gc->account, who); 2189 b = purple_find_buddy(purple_connection_get_account(gc), who);
2190 g_snprintf(buf, sizeof(buf), _("You have tried to ignore %s, but the " 2190 g_snprintf(buf, sizeof(buf), _("You have tried to ignore %s, but the "
2191 "user is on your buddy list. Clicking \"Yes\" " 2191 "user is on your buddy list. Clicking \"Yes\" "
2192 "will remove and ignore the buddy."), who); 2192 "will remove and ignore the buddy."), who);
2193 purple_request_yes_no(gc, NULL, _("Ignore buddy?"), buf, 0, 2193 purple_request_yes_no(gc, NULL, _("Ignore buddy?"), buf, 0,
2194 gc->account, who, NULL, 2194 purple_connection_get_account(gc), who, NULL,
2195 b, 2195 b,
2196 G_CALLBACK(ignore_buddy), 2196 G_CALLBACK(ignore_buddy),
2197 G_CALLBACK(keep_buddy)); 2197 G_CALLBACK(keep_buddy));
2198 break; 2198 break;
2199 } 2199 }
2218 GSList *l = pkt->hash; 2218 GSList *l = pkt->hash;
2219 int err = 0; 2219 int err = 0;
2220 char *msg; 2220 char *msg;
2221 char *url = NULL; 2221 char *url = NULL;
2222 char *fullmsg; 2222 char *fullmsg;
2223 PurpleAccount *account = gc->account; 2223 PurpleAccount *account = purple_connection_get_account(gc);
2224 PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR; 2224 PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
2225 2225
2226 while (l) { 2226 while (l) {
2227 struct yahoo_pair *pair = l->data; 2227 struct yahoo_pair *pair = l->data;
2228 2228
2248 if (!yd->wm) { 2248 if (!yd->wm) {
2249 PurpleUtilFetchUrlData *url_data; 2249 PurpleUtilFetchUrlData *url_data;
2250 yd->wm = TRUE; 2250 yd->wm = TRUE;
2251 if (yd->fd >= 0) 2251 if (yd->fd >= 0)
2252 close(yd->fd); 2252 close(yd->fd);
2253 if (gc->inpa) 2253 if (yd->inpa) {
2254 purple_input_remove(gc->inpa); 2254 purple_input_remove(yd->inpa);
2255 yd->inpa = 0;
2256 }
2255 url_data = purple_util_fetch_url(WEBMESSENGER_URL, TRUE, 2257 url_data = purple_util_fetch_url(WEBMESSENGER_URL, TRUE,
2256 "Purple/" VERSION, FALSE, -1, yahoo_login_page_cb, gc); 2258 "Purple/" VERSION, FALSE, -1, yahoo_login_page_cb, gc);
2257 if (url_data != NULL) 2259 if (url_data != NULL)
2258 yd->url_datas = g_slist_prepend(yd->url_datas, url_data); 2260 yd->url_datas = g_slist_prepend(yd->url_datas, url_data);
2259 return; 2261 return;
3159 } else if (len == 0) { 3161 } else if (len == 0) {
3160 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 3162 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
3161 _("Server closed the connection")); 3163 _("Server closed the connection"));
3162 return; 3164 return;
3163 } 3165 }
3164 gc->last_received = time(NULL); 3166 purple_connection_update_last_received(gc);
3165 yd->rxqueue = g_realloc(yd->rxqueue, len + yd->rxlen); 3167 yd->rxqueue = g_realloc(yd->rxqueue, len + yd->rxlen);
3166 memcpy(yd->rxqueue + yd->rxlen, buf, len); 3168 memcpy(yd->rxqueue + yd->rxlen, buf, len);
3167 yd->rxlen += len; 3169 yd->rxlen += len;
3168 3170
3169 while (1) { 3171 while (1) {
3249 yd = purple_connection_get_protocol_data(gc); 3251 yd = purple_connection_get_protocol_data(gc);
3250 yd->fd = source; 3252 yd->fd = source;
3251 3253
3252 pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH, yd->current_status, yd->session_id); 3254 pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH, yd->current_status, yd->session_id);
3253 3255
3254 yahoo_packet_hash_str(pkt, 1, purple_normalize(gc->account, purple_account_get_username(purple_connection_get_account(gc)))); 3256 yahoo_packet_hash_str(pkt, 1, purple_normalize(purple_connection_get_account(gc), purple_account_get_username(purple_connection_get_account(gc))));
3255 yahoo_packet_send_and_free(pkt, yd); 3257 yahoo_packet_send_and_free(pkt, yd);
3256 3258
3257 gc->inpa = purple_input_add(yd->fd, PURPLE_INPUT_READ, yahoo_pending, gc); 3259 yd->inpa = purple_input_add(yd->fd, PURPLE_INPUT_READ, yahoo_pending, gc);
3258 } 3260 }
3259 3261
3260 #ifdef TRY_WEBMESSENGER_LOGIN 3262 #ifdef TRY_WEBMESSENGER_LOGIN
3261 static void yahoo_got_web_connected(gpointer data, gint source, const gchar *error_message) 3263 static void yahoo_got_web_connected(gpointer data, gint source, const gchar *error_message)
3262 { 3264 {
3276 yd->fd = source; 3278 yd->fd = source;
3277 3279
3278 pkt = yahoo_packet_new(YAHOO_SERVICE_WEBLOGIN, YAHOO_STATUS_WEBLOGIN, yd->session_id); 3280 pkt = yahoo_packet_new(YAHOO_SERVICE_WEBLOGIN, YAHOO_STATUS_WEBLOGIN, yd->session_id);
3279 3281
3280 yahoo_packet_hash(pkt, "sss", 0, 3282 yahoo_packet_hash(pkt, "sss", 0,
3281 purple_normalize(gc->account, purple_account_get_username(purple_connection_get_account(gc))), 3283 purple_normalize(purple_connection_get_account(gc), purple_account_get_username(purple_connection_get_account(gc))),
3282 1, purple_normalize(gc->account, purple_account_get_username(purple_connection_get_account(gc))), 3284 1, purple_normalize(purple_connection_get_account(gc), purple_account_get_username(purple_connection_get_account(gc))),
3283 6, yd->auth); 3285 6, yd->auth);
3284 yahoo_packet_send_and_free(pkt, yd); 3286 yahoo_packet_send_and_free(pkt, yd);
3285 3287
3286 g_free(yd->auth); 3288 g_free(yd->auth);
3287 gc->inpa = purple_input_add(yd->fd, PURPLE_INPUT_READ, yahoo_pending, gc); 3289 yd->inpa = purple_input_add(yd->fd, PURPLE_INPUT_READ, yahoo_pending, gc);
3288 } 3290 }
3289 3291
3290 static void yahoo_web_pending(gpointer data, gint source, PurpleInputCondition cond) 3292 static void yahoo_web_pending(gpointer data, gint source, PurpleInputCondition cond)
3291 { 3293 {
3292 PurpleConnection *gc = data; 3294 PurpleConnection *gc = data;
3346 * It seems to work without these 3348 * It seems to work without these
3347 */ 3349 */
3348 } 3350 }
3349 3351
3350 yd->auth = g_string_free(s, FALSE); 3352 yd->auth = g_string_free(s, FALSE);
3351 purple_input_remove(gc->inpa); 3353 purple_input_remove(yd->inpa);
3354 yd->inpa = 0;
3352 close(source); 3355 close(source);
3353 g_free(yd->rxqueue); 3356 g_free(yd->rxqueue);
3354 yd->rxqueue = NULL; 3357 yd->rxqueue = NULL;
3355 yd->rxlen = 0; 3358 yd->rxlen = 0;
3356 /* Now we have our cookies to login with. I'll go get the milk. */ 3359 /* Now we have our cookies to login with. I'll go get the milk. */
3363 } 3366 }
3364 } 3367 }
3365 3368
3366 static void yahoo_got_cookies_send_cb(gpointer data, gint source, PurpleInputCondition cond) 3369 static void yahoo_got_cookies_send_cb(gpointer data, gint source, PurpleInputCondition cond)
3367 { 3370 {
3368 PurpleConnection *gc; 3371 PurpleConnection *gc = data;
3369 YahooData *yd; 3372 YahooData *yd = purple_connection_get_protocol_data(gc);
3370 int written, remaining; 3373 int written, remaining;
3371
3372 gc = data;
3373 yd = purple_connection_get_protocol_data(gc);
3374 3374
3375 remaining = strlen(yd->auth) - yd->auth_written; 3375 remaining = strlen(yd->auth) - yd->auth_written;
3376 written = write(source, yd->auth + yd->auth_written, remaining); 3376 written = write(source, yd->auth + yd->auth_written, remaining);
3377 3377
3378 if (written < 0 && errno == EAGAIN) 3378 if (written < 0 && errno == EAGAIN)
3379 written = 0; 3379 written = 0;
3380 else if (written <= 0) { 3380 else if (written <= 0) {
3381 gchar *tmp; 3381 gchar *tmp;
3382 g_free(yd->auth); 3382 g_free(yd->auth);
3383 yd->auth = NULL; 3383 yd->auth = NULL;
3384 if (gc->inpa) 3384 if (yd->inpa) {
3385 purple_input_remove(gc->inpa); 3385 purple_input_remove(yd->inpa);
3386 gc->inpa = 0; 3386 yd->inpa = 0;
3387 }
3387 tmp = g_strdup_printf(_("Lost connection with %s: %s"), 3388 tmp = g_strdup_printf(_("Lost connection with %s: %s"),
3388 "login.yahoo.com:80", g_strerror(errno)); 3389 "login.yahoo.com:80", g_strerror(errno));
3389 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); 3390 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
3390 g_free(tmp); 3391 g_free(tmp);
3391 return; 3392 return;
3397 } 3398 }
3398 3399
3399 g_free(yd->auth); 3400 g_free(yd->auth);
3400 yd->auth = NULL; 3401 yd->auth = NULL;
3401 yd->auth_written = 0; 3402 yd->auth_written = 0;
3402 purple_input_remove(gc->inpa); 3403 purple_input_remove(yd->inpa);
3403 gc->inpa = purple_input_add(source, PURPLE_INPUT_READ, yahoo_web_pending, gc); 3404 yd->inpa = purple_input_add(source, PURPLE_INPUT_READ, yahoo_web_pending, gc);
3404 } 3405 }
3405 3406
3406 static void yahoo_got_cookies(gpointer data, gint source, const gchar *error_message) 3407 static void yahoo_got_cookies(gpointer data, gint source, const gchar *error_message)
3407 { 3408 {
3408 PurpleConnection *gc = data; 3409 PurpleConnection *gc = data;
3410 YahooData *yd = purple_connection_get_protocol_data(gc);
3409 3411
3410 if (source < 0) { 3412 if (source < 0) {
3411 gchar *tmp; 3413 gchar *tmp;
3412 tmp = g_strdup_printf(_("Unable to establish a connection with %s: %s"), 3414 tmp = g_strdup_printf(_("Unable to establish a connection with %s: %s"),
3413 "login.yahoo.com:80", error_message); 3415 "login.yahoo.com:80", error_message);
3414 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); 3416 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
3415 g_free(tmp); 3417 g_free(tmp);
3416 return; 3418 return;
3417 } 3419 }
3418 3420
3419 if (gc->inpa == 0) 3421 if (yd->inpa == 0)
3420 { 3422 {
3421 gc->inpa = purple_input_add(source, PURPLE_INPUT_WRITE, 3423 yd->inpa = purple_input_add(source, PURPLE_INPUT_WRITE,
3422 yahoo_got_cookies_send_cb, gc); 3424 yahoo_got_cookies_send_cb, gc);
3423 yahoo_got_cookies_send_cb(gc, source, PURPLE_INPUT_WRITE); 3425 yahoo_got_cookies_send_cb(gc, source, PURPLE_INPUT_WRITE);
3424 } 3426 }
3425 } 3427 }
3426 3428
3682 gboolean use_whole_url = yahoo_account_use_http_proxy(gc); 3684 gboolean use_whole_url = yahoo_account_use_http_proxy(gc);
3683 gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE); 3685 gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE);
3684 PurpleUtilFetchUrlData *url_data; 3686 PurpleUtilFetchUrlData *url_data;
3685 3687
3686 purple_connection_set_protocol_data(gc, yd); 3688 purple_connection_set_protocol_data(gc, yd);
3687 gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC; 3689 purple_connection_set_flags(gc, PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC);
3688 3690
3689 purple_connection_update_progress(gc, _("Connecting"), 1, 2); 3691 purple_connection_update_progress(gc, _("Connecting"), 1, 2);
3690 3692
3691 purple_connection_set_display_name(gc, purple_account_get_username(account)); 3693 purple_connection_set_display_name(gc, purple_account_get_username(account));
3692 3694
3729 3731
3730 void yahoo_close(PurpleConnection *gc) { 3732 void yahoo_close(PurpleConnection *gc) {
3731 YahooData *yd = purple_connection_get_protocol_data(gc); 3733 YahooData *yd = purple_connection_get_protocol_data(gc);
3732 GSList *l; 3734 GSList *l;
3733 3735
3734 if (gc->inpa) 3736 if (yd->inpa) {
3735 purple_input_remove(gc->inpa); 3737 purple_input_remove(yd->inpa);
3738 yd->inpa = 0;
3739 }
3736 3740
3737 while (yd->url_datas) { 3741 while (yd->url_datas) {
3738 purple_util_fetch_url_cancel(yd->url_datas->data); 3742 purple_util_fetch_url_cancel(yd->url_datas->data);
3739 yd->url_datas = g_slist_delete_link(yd->url_datas, yd->url_datas); 3743 yd->url_datas = g_slist_delete_link(yd->url_datas, yd->url_datas);
3740 } 3744 }
4480 "Content-Length: %" G_GSIZE_FORMAT "\r\n" 4484 "Content-Length: %" G_GSIZE_FORMAT "\r\n"
4481 "Cache-Control: no-cache\r\n\r\n%s", 4485 "Cache-Control: no-cache\r\n\r\n%s",
4482 YAHOO_CLIENT_VERSION, yd->cookie_t, yd->cookie_y, strlen(validate_request_str), validate_request_str); 4486 YAHOO_CLIENT_VERSION, yd->cookie_t, yd->cookie_y, strlen(validate_request_str), validate_request_str);
4483 4487
4484 /* use whole URL if using HTTP Proxy */ 4488 /* use whole URL if using HTTP Proxy */
4485 if ((gc->account->proxy_info) && (purple_proxy_info_get_type(gc->account->proxy_info) == PURPLE_PROXY_HTTP)) 4489 if ((purple_account_get_proxy_info(purple_connection_get_account(gc))) && (purple_proxy_info_get_type(purple_account_get_proxy_info(purple_connection_get_account(gc))) == PURPLE_PROXY_HTTP))
4486 use_whole_url = TRUE; 4490 use_whole_url = TRUE;
4487 4491
4488 url_data = purple_util_fetch_url_request( 4492 url_data = purple_util_fetch_url_request(
4489 purple_connection_get_account(gc), YAHOO_SMS_CARRIER_URL, use_whole_url, 4493 purple_connection_get_account(gc), YAHOO_SMS_CARRIER_URL, use_whole_url,
4490 YAHOO_CLIENT_USERAGENT, TRUE, request, FALSE, -1, 4494 YAHOO_CLIENT_USERAGENT, TRUE, request, FALSE, -1,
4616 * just so that we don't inadvertantly reset their IMVironment back 4620 * just so that we don't inadvertantly reset their IMVironment back
4617 * to nothing. 4621 * to nothing.
4618 * 4622 *
4619 * If they have not set an IMVironment, then use the default. 4623 * If they have not set an IMVironment, then use the default.
4620 */ 4624 */
4621 wb = purple_whiteboard_get_session(gc->account, who); 4625 wb = purple_whiteboard_get_session(purple_connection_get_account(gc), who);
4622 if (wb) 4626 if (wb)
4623 yahoo_packet_hash_str(pkt, 63, DOODLE_IMV_KEY); 4627 yahoo_packet_hash_str(pkt, 63, DOODLE_IMV_KEY);
4624 else 4628 else
4625 { 4629 {
4626 const char *imv; 4630 const char *imv;
5122 PurpleAccount *account; 5126 PurpleAccount *account;
5123 GSList *deny; 5127 GSList *deny;
5124 5128
5125 account = purple_connection_get_account(gc); 5129 account = purple_connection_get_account(gc);
5126 5130
5127 switch (account->perm_deny) 5131 switch (purple_account_get_privacy_type(account))
5128 { 5132 {
5129 case PURPLE_PRIVACY_ALLOW_ALL: 5133 case PURPLE_PRIVACY_ALLOW_ALL:
5130 for (deny = account->deny; deny; deny = deny->next) 5134 for (deny = account->deny; deny; deny = deny->next)
5131 yahoo_rem_deny(gc, deny->data); 5135 yahoo_rem_deny(gc, deny->data);
5132 break; 5136 break;
5218 PurpleAccount *account = purple_conversation_get_account(c); 5222 PurpleAccount *account = purple_conversation_get_account(c);
5219 5223
5220 if (*args && args[0]) 5224 if (*args && args[0])
5221 return PURPLE_CMD_RET_FAILED; 5225 return PURPLE_CMD_RET_FAILED;
5222 5226
5223 purple_prpl_send_attention(account->gc, c->name, YAHOO_BUZZ); 5227 purple_prpl_send_attention(purple_account_get_connection(account), purple_conversation_get_name(c), YAHOO_BUZZ);
5224 5228
5225 return PURPLE_CMD_RET_OK; 5229 return PURPLE_CMD_RET_OK;
5226 } 5230 }
5227 5231
5228 PurpleCmdRet 5232 PurpleCmdRet
5233 PurpleConnection *gc; 5237 PurpleConnection *gc;
5234 5238
5235 if (!args || !args[0]) 5239 if (!args || !args[0])
5236 return PURPLE_CMD_RET_FAILED; 5240 return PURPLE_CMD_RET_FAILED;
5237 5241
5238 gc = purple_conversation_get_gc(conv); 5242 gc = purple_conversation_get_connection(conv);
5239 purple_debug_info("yahoo", "Trying to join %s \n", args[0]); 5243 purple_debug_info("yahoo", "Trying to join %s \n", args[0]);
5240 5244
5241 comp = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); 5245 comp = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
5242 g_hash_table_replace(comp, g_strdup("room"), g_ascii_strdown(args[0], -1)); 5246 g_hash_table_replace(comp, g_strdup("room"), g_ascii_strdown(args[0], -1));
5243 g_hash_table_replace(comp, g_strdup("type"), g_strdup("Chat")); 5247 g_hash_table_replace(comp, g_strdup("type"), g_strdup("Chat"));
5267 gboolean yahoo_send_attention(PurpleConnection *gc, const char *username, guint type) 5271 gboolean yahoo_send_attention(PurpleConnection *gc, const char *username, guint type)
5268 { 5272 {
5269 PurpleConversation *c; 5273 PurpleConversation *c;
5270 5274
5271 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, 5275 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM,
5272 username, gc->account); 5276 username, purple_connection_get_account(gc));
5273 5277
5274 g_return_val_if_fail(c != NULL, FALSE); 5278 g_return_val_if_fail(c != NULL, FALSE);
5275 5279
5276 purple_debug_info("yahoo", "Sending <ding> on account %s to buddy %s.\n", 5280 purple_debug_info("yahoo", "Sending <ding> on account %s to buddy %s.\n",
5277 username, c->name); 5281 username, purple_conversation_get_name(c));
5278 purple_conv_im_send_with_flags(PURPLE_CONV_IM(c), "<ding>", PURPLE_MESSAGE_INVISIBLE); 5282 purple_conv_im_send_with_flags(PURPLE_CONV_IM(c), "<ding>", PURPLE_MESSAGE_INVISIBLE);
5279 5283
5280 return TRUE; 5284 return TRUE;
5281 } 5285 }
5282 5286