comparison libpurple/protocols/yahoo/util.c @ 32459:fcf841ffd620

Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
author andrew.victor@mxit.com
date Tue, 30 Aug 2011 20:03:11 +0000
parents a8cc50c2279f
children 0f94ec89f0bc
comparison
equal deleted inserted replaced
32458:1a3723704543 32459:fcf841ffd620
61 gchar *ans = NULL; 61 gchar *ans = NULL;
62 gchar *cur; 62 gchar *cur;
63 char firstflag = 1; 63 char firstflag = 1;
64 gchar *t1,*t2,*t3; 64 gchar *t1,*t2,*t3;
65 GSList *tmp; 65 GSList *tmp;
66 GSList *cookies; 66 YahooData *yd = purple_connection_get_protocol_data(gc);
67 cookies = ((YahooData*)(gc->proto_data))->cookies; 67 GSList *cookies = yd->cookies;
68
68 tmp = cookies; 69 tmp = cookies;
69 while(tmp) 70 while(tmp)
70 { 71 {
71 cur = tmp->data; 72 cur = tmp->data;
72 t1 = ans; 73 t1 = ans;
127 * it is not dereferenced. 128 * it is not dereferenced.
128 * @return The g_malloced string in the appropriate encoding. 129 * @return The g_malloced string in the appropriate encoding.
129 */ 130 */
130 char *yahoo_string_encode(PurpleConnection *gc, const char *str, gboolean *utf8) 131 char *yahoo_string_encode(PurpleConnection *gc, const char *str, gboolean *utf8)
131 { 132 {
132 YahooData *yd = gc->proto_data; 133 YahooData *yd = purple_connection_get_protocol_data(gc);
133 char *ret; 134 char *ret;
134 const char *to_codeset; 135 const char *to_codeset;
135 136
136 if (yd->jp) 137 if (yd->jp)
137 return g_strdup(str); 138 return g_strdup(str);
156 * @param utf8 Did the server tell us it was supposed to be utf8? 157 * @param utf8 Did the server tell us it was supposed to be utf8?
157 * @return The decoded, utf-8 string, which must be g_free()'d. 158 * @return The decoded, utf-8 string, which must be g_free()'d.
158 */ 159 */
159 char *yahoo_string_decode(PurpleConnection *gc, const char *str, gboolean utf8) 160 char *yahoo_string_decode(PurpleConnection *gc, const char *str, gboolean utf8)
160 { 161 {
161 YahooData *yd = gc->proto_data; 162 YahooData *yd = purple_connection_get_protocol_data(gc);
162 char *ret; 163 char *ret;
163 const char *from_codeset; 164 const char *from_codeset;
164 165
165 if (utf8) { 166 if (utf8) {
166 if (g_utf8_validate(str, -1, NULL)) 167 if (g_utf8_validate(str, -1, NULL))