Mercurial > pidgin
comparison libgaim/protocols/qq/utils.c @ 15071:902f3621aa13
[gaim-migrate @ 17855]
Use the QQ faces as buddy icons instead of status icons. Also, a few minor cleanups and a bug fix for faces > 33.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Huetsch <markhuetsch> |
---|---|
date | Thu, 30 Nov 2006 10:30:13 +0000 |
parents | c039c920e11c |
children | 2c93b0620065 |
comparison
equal
deleted
inserted
replaced
15070:97ae8709d6dc | 15071:902f3621aa13 |
---|---|
155 ip[0] = a; | 155 ip[0] = a; |
156 ip[1] = b; | 156 ip[1] = b; |
157 ip[2] = c; | 157 ip[2] = c; |
158 ip[3] = d; | 158 ip[3] = d; |
159 return ip; | 159 return ip; |
160 } | |
161 | |
162 /* return the QQ icon file name | |
163 * the return needs to be freed */ | |
164 gchar *get_icon_name(gint set) | |
165 { | |
166 return g_strdup_printf("qq_%d", set); | |
167 } | 160 } |
168 | 161 |
169 /* convert Gaim name to original QQ UID */ | 162 /* convert Gaim name to original QQ UID */ |
170 guint32 gaim_name_to_uid(const gchar *const name) | 163 guint32 gaim_name_to_uid(const gchar *const name) |
171 { | 164 { |
335 /* GString can be freed without freeing it character data */ | 328 /* GString can be freed without freeing it character data */ |
336 g_string_free(str, FALSE); | 329 g_string_free(str, FALSE); |
337 | 330 |
338 return ret; | 331 return ret; |
339 } | 332 } |
333 | |
334 /* convert face num from packet (0-299) to local face (1-100) */ | |
335 gchar *face_to_icon_str(gint face) | |
336 { | |
337 gchar *icon_num_str; | |
338 gint icon_num = face / 3 + 1; | |
339 icon_num_str = g_strdup_printf("%d", icon_num); | |
340 return icon_num_str; | |
341 } | |
342 | |
343 /* | |
344 gint face_to_icon_num(const gchar *face) | |
345 { | |
346 gchar *icon_str = face_to_icon_str(face); | |
347 gint icon_num = strtol(icon_str, NULL, 10); | |
348 g_free(icon_str); | |
349 return icon_num; | |
350 } | |
351 */ |