Mercurial > pidgin
comparison src/server.c @ 9235:7ae39c31e401
[gaim-migrate @ 10031]
Revert that for now. I didn't take into account buddys being removed.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 08 Jun 2004 02:05:05 +0000 |
parents | f18eb3f22733 |
children | e8d86fd68552 |
comparison
equal
deleted
inserted
replaced
9234:f18eb3f22733 | 9235:7ae39c31e401 |
---|---|
1053 | 1053 |
1054 g_free(name); | 1054 g_free(name); |
1055 g_free(message); | 1055 g_free(message); |
1056 } | 1056 } |
1057 | 1057 |
1058 /* | 1058 |
1059 * NOTE: This is a bit hacky, but needed for core support for the | |
1060 * buddy-idle-updated signal. It's temporary, and will be replaced | |
1061 * with better code in the status rewrite. | |
1062 */ | |
1063 static GList *idle_buddies = NULL; | |
1064 static guint idle_buddy_timeout_id = 0; | |
1065 | |
1066 static gboolean | |
1067 idle_timeout_cb(void) | |
1068 { | |
1069 GList *l; | |
1070 | |
1071 for (l = idle_buddies; l != NULL; l = l->next) | |
1072 { | |
1073 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated", | |
1074 l->data); | |
1075 } | |
1076 | |
1077 return TRUE; | |
1078 } | |
1079 | 1059 |
1080 void serv_got_update(GaimConnection *gc, const char *name, int loggedin, | 1060 void serv_got_update(GaimConnection *gc, const char *name, int loggedin, |
1081 int evil, time_t signon, time_t idle, int type) | 1061 int evil, time_t signon, time_t idle, int type) |
1082 { | 1062 { |
1083 GaimAccount *account; | 1063 GaimAccount *account; |
1237 gaim_blist_update_buddy_status(b, type); | 1217 gaim_blist_update_buddy_status(b, type); |
1238 | 1218 |
1239 if (!old_idle && idle) | 1219 if (!old_idle && idle) |
1240 { | 1220 { |
1241 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b); | 1221 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b); |
1242 | |
1243 idle_buddies = g_list_append(idle_buddies, b); | |
1244 | |
1245 if (idle_buddy_timeout_id == 0) | |
1246 { | |
1247 idle_buddy_timeout_id = gaim_timeout_add(10000, | |
1248 (GSourceFunc)idle_timeout_cb, NULL); | |
1249 } | |
1250 } | 1222 } |
1251 else if (old_idle && !idle) | 1223 else if (old_idle && !idle) |
1252 { | 1224 { |
1253 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b); | 1225 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b); |
1254 | 1226 } |
1255 idle_buddies = g_list_remove(idle_buddies, b); | 1227 else if (old_idle != idle) |
1256 | 1228 { |
1257 if (idle_buddies == NULL) | 1229 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated", b); |
1258 { | |
1259 gaim_timeout_remove(idle_buddy_timeout_id); | |
1260 idle_buddy_timeout_id = 0; | |
1261 } | |
1262 } | 1230 } |
1263 | 1231 |
1264 if (c != NULL) | 1232 if (c != NULL) |
1265 gaim_conversation_update(c, GAIM_CONV_UPDATE_AWAY); | 1233 gaim_conversation_update(c, GAIM_CONV_UPDATE_AWAY); |
1266 | 1234 |