Mercurial > pidgin.yaz
diff libpurple/protocols/oscar/oscar.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 2ec94166be43 |
children |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c Mon Sep 26 14:57:21 2011 +0900 +++ b/libpurple/protocols/oscar/oscar.c Sat Nov 19 14:42:54 2011 +0900 @@ -655,6 +655,7 @@ GList *sorted_handlers; GList *cur; GString *msg = g_string_new(""); + PurpleConnectionFlags flags; gc = purple_account_get_connection(account); od = oscar_data_new(); @@ -740,17 +741,19 @@ return; } - gc->flags |= PURPLE_CONNECTION_HTML; + flags = PURPLE_CONNECTION_HTML; if (g_str_equal(purple_account_get_protocol_id(account), "prpl-icq")) { od->icq = TRUE; } else { - gc->flags |= PURPLE_CONNECTION_AUTO_RESP; + flags |= PURPLE_CONNECTION_AUTO_RESP; } /* Set this flag based on the protocol_id rather than the username, because that is what's tied to the get_moods prpl callback. */ if (g_str_equal(purple_account_get_protocol_id(account), "prpl-icq")) - gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS; + flags |= PURPLE_CONNECTION_SUPPORT_MOODS; + + purple_connection_set_flags(gc, flags); od->default_port = purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT); @@ -1000,7 +1003,7 @@ pos->len = len; pos->modname = g_strdup(modname); - if (purple_proxy_connect(pos->gc, pos->gc->account, "pidgin.im", 80, + if (purple_proxy_connect(pos->gc, purple_connection_get_account(pos->gc), "pidgin.im", 80, straight_to_hell, pos) == NULL) { char buf[256]; @@ -1547,7 +1550,7 @@ purple_prpl_got_user_status(account, info->bn, OSCAR_STATUS_ID_OFFLINE, NULL); purple_prpl_got_user_status_deactive(account, info->bn, OSCAR_STATUS_ID_MOBILE); - g_hash_table_remove(od->buddyinfo, purple_normalize(gc->account, info->bn)); + g_hash_table_remove(od->buddyinfo, purple_normalize(purple_connection_get_account(gc), info->bn)); return 1; } @@ -2816,7 +2819,7 @@ od->rights.maxsiglen = od->rights.maxawaymsglen = (guint)maxsiglen; aim_locate_setcaps(od, purple_caps); - oscar_set_info_and_status(account, TRUE, account->user_info, TRUE, + oscar_set_info_and_status(account, TRUE, purple_account_get_user_info(account), TRUE, purple_account_get_active_status(account)); return 1; @@ -3176,9 +3179,9 @@ else { /* Don't send if this turkey is in our deny list */ GSList *list; - for (list=gc->account->deny; (list && oscar_util_name_compare(name, list->data)); list=list->next); + for (list=purple_connection_get_account(gc)->deny; (list && oscar_util_name_compare(name, list->data)); list=list->next); if (!list) { - struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(gc->account, name)); + struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(purple_connection_get_account(gc), name)); if (bi && bi->typingnot) { if (state == PURPLE_TYPING) aim_im_sendmtn(od, 0x0001, name, 0x0002); @@ -4108,11 +4111,11 @@ */ if (!od->icq && curitem->data) { guint8 perm_deny = aim_ssi_getpermdeny(&od->ssi.local); - if (perm_deny != 0 && perm_deny != account->perm_deny) + if (perm_deny != 0 && perm_deny != purple_account_get_privacy_type(account)) { purple_debug_info("oscar", - "ssi: changing permdeny from %d to %hhu\n", account->perm_deny, perm_deny); - account->perm_deny = perm_deny; + "ssi: changing permdeny from %d to %hhu\n", purple_account_get_privacy_type(account), perm_deny); + purple_account_set_privacy_type(account, perm_deny); } } } break; @@ -4741,7 +4744,7 @@ * values of libpurple's PurplePrivacyType and the values used * by the oscar protocol. */ - aim_ssi_setpermdeny(od, account->perm_deny); + aim_ssi_setpermdeny(od, purple_account_get_privacy_type(account)); } void oscar_add_permit(PurpleConnection *gc, const char *who) {