diff options
author | James Booth <boothj5@gmail.com> | 2013-10-07 00:51:00 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-10-07 00:51:00 +0100 |
commit | acf1afe02538d51b7b613b75334c824e2d314cf4 (patch) | |
tree | 06564a2f2709cfc23747bbd77942d3dcb7b3a1be /src/ui | |
parent | 383d91ec36b7b4afad79dffe2049dabbe2ec93fa (diff) | |
download | profani-tty-acf1afe02538d51b7b613b75334c824e2d314cf4.tar.gz |
Moved idle chat state handling out of ui module
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/core.c | 28 | ||||
-rw-r--r-- | src/ui/ui.h | 2 |
2 files changed, 4 insertions, 26 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index 6a6c15c4..24e8b822 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -211,33 +211,11 @@ ui_contact_typing(const char * const barejid) } } -void -ui_idle(void) +GSList * +ui_get_recipients(void) { GSList *recipients = wins_get_chat_recipients(); - GSList *curr = recipients; - while (curr != NULL) { - char *recipient = curr->data; - chat_session_no_activity(recipient); - - if (chat_session_is_gone(recipient) && - !chat_session_get_sent(recipient)) { - message_send_gone(recipient); - } else if (chat_session_is_inactive(recipient) && - !chat_session_get_sent(recipient)) { - message_send_inactive(recipient); - } else if (prefs_get_boolean(PREF_OUTTYPE) && - chat_session_is_paused(recipient) && - !chat_session_get_sent(recipient)) { - message_send_paused(recipient); - } - - curr = g_slist_next(curr); - } - - if (recipients != NULL) { - g_slist_free(recipients); - } + return recipients; } void diff --git a/src/ui/ui.h b/src/ui/ui.h index 7fff0703..9c1cba52 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -48,7 +48,7 @@ void ui_refresh(void); void ui_close(void); void ui_resize(const int ch, const char * const input, const int size); -void ui_idle(void); +GSList* ui_get_recipients(void); void ui_handle_special_keys(const wint_t * const ch, const char * const inp, const int size); void ui_switch_win(const int i); |