static void lednot_conversation_updated(PurpleConversation *conv, PurpleConvUpdateType type) { GList *list; if( type != PURPLE_CONV_UPDATE_UNSEEN ) { return; } #if 0 purple_debug_info("bar-notification", "Change in unseen conversations\n"); #endif list=get_pending_list(1); if(list==NULL) { bar_set(FALSE); } else if(list!=NULL) { bar_set(TRUE); } g_list_free(list); }
void *time_out_task(void *arg) { tl_timer_t *first_arg = NULL; int ret, waite_interval = 0; while (1) { if (get_pending_list_count() == 0) { struct timespec timerout; waite_interval = get_waite_interval(); timerout.tv_sec = time(0) + waite_interval + 5; pthread_mutex_lock(&timeout_mutex); ret = pthread_cond_timedwait(&timeout_cond, &timeout_mutex, &timerout); if(ret == ETIMEDOUT) { timeout_thread_is_on = 0; pthread_mutex_unlock(&timeout_mutex); pthread_exit((void *)0); } else { pthread_mutex_unlock(&timeout_mutex); continue; } } else { first_arg = get_pending_list(); if (first_arg == NULL) { continue; } else { if (first_arg->handler) { first_arg->handler(first_arg->handler_arg); free(first_arg); first_arg = NULL; } } } } return NULL; }