1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Only set autoaway when status is "online" or "chat"

fixes #122
This commit is contained in:
James Booth 2013-04-27 22:39:51 +01:00
parent 070c3ae6cc
commit e02ab52a4e

View File

@ -482,9 +482,11 @@ static void
_handle_idle_time() _handle_idle_time()
{ {
gint prefs_time = prefs_get_autoaway_time() * 60000; gint prefs_time = prefs_get_autoaway_time() * 60000;
resource_presence_t current_presence = accounts_get_last_presence(jabber_get_account_name());
unsigned long idle_ms = ui_get_idle_time(); unsigned long idle_ms = ui_get_idle_time();
if (!idle) { if (!idle) {
if ((current_presence == RESOURCE_ONLINE) || (current_presence == RESOURCE_CHAT)) {
if (idle_ms >= prefs_time) { if (idle_ms >= prefs_time) {
idle = TRUE; idle = TRUE;
@ -515,6 +517,7 @@ _handle_idle_time()
prefs_get_string(PREF_AUTOAWAY_MESSAGE), idle_ms / 1000); prefs_get_string(PREF_AUTOAWAY_MESSAGE), idle_ms / 1000);
} }
} }
}
} else { } else {
if (idle_ms < prefs_time) { if (idle_ms < prefs_time) {