Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 13862:84f2675cf87f
[gaim-migrate @ 16324]
Handle the oscar icon retrieval timer loop in a slightly more
clear way.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 24 Jun 2006 06:47:11 +0000 |
parents | a9ff4499d9ce |
children | 77a50840d9e2 |
comparison
equal
deleted
inserted
replaced
13861:55fb5cd9bac9 | 13862:84f2675cf87f |
---|---|
1111 | 1111 |
1112 aim_clientready(od, conn); | 1112 aim_clientready(od, conn); |
1113 | 1113 |
1114 od->iconconnecting = FALSE; | 1114 od->iconconnecting = FALSE; |
1115 | 1115 |
1116 if (od->icontimer) | 1116 if (od->icontimer == 0) |
1117 gaim_timeout_remove(od->icontimer); | 1117 od->icontimer = gaim_timeout_add(100, gaim_icon_timerfunc, gc); |
1118 od->icontimer = gaim_timeout_add(100, gaim_icon_timerfunc, gc); | |
1119 } | 1118 } |
1120 | 1119 |
1121 static int | 1120 static int |
1122 flap_connection_established(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) | 1121 flap_connection_established(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
1123 { | 1122 { |
1813 GSList *cur = od->requesticon; | 1812 GSList *cur = od->requesticon; |
1814 while (cur && aim_sncmp((char *)cur->data, info->sn)) | 1813 while (cur && aim_sncmp((char *)cur->data, info->sn)) |
1815 cur = cur->next; | 1814 cur = cur->next; |
1816 if (!cur) { | 1815 if (!cur) { |
1817 od->requesticon = g_slist_append(od->requesticon, g_strdup(gaim_normalize(account, info->sn))); | 1816 od->requesticon = g_slist_append(od->requesticon, g_strdup(gaim_normalize(account, info->sn))); |
1818 if (od->icontimer) | 1817 if (od->icontimer == 0) |
1819 gaim_timeout_remove(od->icontimer); | 1818 od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); |
1820 od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); | |
1821 } | 1819 } |
1822 } | 1820 } |
1823 g_free(b16); | 1821 g_free(b16); |
1824 } | 1822 } |
1825 | 1823 |
3167 sn = od->requesticon->data; | 3165 sn = od->requesticon->data; |
3168 gaim_debug_misc("oscar", "removing %s from hash table\n", sn); | 3166 gaim_debug_misc("oscar", "removing %s from hash table\n", sn); |
3169 od->requesticon = g_slist_remove(od->requesticon, sn); | 3167 od->requesticon = g_slist_remove(od->requesticon, sn); |
3170 g_free(sn); | 3168 g_free(sn); |
3171 | 3169 |
3172 if (od->icontimer) | 3170 if (od->icontimer == 0) |
3173 gaim_timeout_remove(od->icontimer); | 3171 od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); |
3174 od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); | |
3175 | 3172 |
3176 return 1; | 3173 return 1; |
3177 } | 3174 } |
3178 | 3175 |
3179 static int gaim_icon_parseicon(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { | 3176 static int gaim_icon_parseicon(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3219 cur = od->requesticon; | 3216 cur = od->requesticon; |
3220 } else | 3217 } else |
3221 cur = cur->next; | 3218 cur = cur->next; |
3222 } | 3219 } |
3223 | 3220 |
3224 if (od->icontimer) | 3221 if (od->icontimer == 0) |
3225 gaim_timeout_remove(od->icontimer); | 3222 od->icontimer = gaim_timeout_add(250, gaim_icon_timerfunc, gc); |
3226 od->icontimer = gaim_timeout_add(250, gaim_icon_timerfunc, gc); | |
3227 | 3223 |
3228 return 1; | 3224 return 1; |
3229 } | 3225 } |
3230 | 3226 |
3231 static gboolean gaim_icon_timerfunc(gpointer data) { | 3227 static gboolean gaim_icon_timerfunc(gpointer data) { |
3232 GaimConnection *gc = data; | 3228 GaimConnection *gc = data; |
3233 OscarData *od = gc->proto_data; | 3229 OscarData *od = gc->proto_data; |
3234 aim_userinfo_t *userinfo; | 3230 aim_userinfo_t *userinfo; |
3235 FlapConnection *conn; | 3231 FlapConnection *conn; |
3232 | |
3233 od->icontimer = 0; | |
3236 | 3234 |
3237 conn = flap_connection_getbytype(od, SNAC_FAMILY_BART); | 3235 conn = flap_connection_getbytype(od, SNAC_FAMILY_BART); |
3238 if (!conn) { | 3236 if (!conn) { |
3239 if (!od->iconconnecting) { | 3237 if (!od->iconconnecting) { |
3240 aim_reqservice(od, SNAC_FAMILY_BART); | 3238 aim_reqservice(od, SNAC_FAMILY_BART); |
3284 gchar *sn = od->requesticon->data; | 3282 gchar *sn = od->requesticon->data; |
3285 od->requesticon = g_slist_remove(od->requesticon, sn); | 3283 od->requesticon = g_slist_remove(od->requesticon, sn); |
3286 g_free(sn); | 3284 g_free(sn); |
3287 } | 3285 } |
3288 | 3286 |
3289 return TRUE; | 3287 od->icontimer = gaim_timeout_add(100, gaim_icon_timerfunc, gc); |
3288 | |
3289 return FALSE; | |
3290 } | 3290 } |
3291 | 3291 |
3292 /* | 3292 /* |
3293 * Recieved in response to an IM sent with the AIM_IMFLAGS_ACK option. | 3293 * Recieved in response to an IM sent with the AIM_IMFLAGS_ACK option. |
3294 */ | 3294 */ |