mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Fixed autoaway
This commit is contained in:
parent
c3b7388e61
commit
91289b8d8d
@ -452,28 +452,28 @@ _handle_idle_time()
|
|||||||
|
|
||||||
// handle away mode
|
// handle away mode
|
||||||
if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "away") == 0) {
|
if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "away") == 0) {
|
||||||
presence_update(CONTACT_AWAY, prefs_get_string(PREF_AUTOAWAY_MESSAGE), 0);
|
presence_update(RESOURCE_AWAY, prefs_get_string(PREF_AUTOAWAY_MESSAGE), 0);
|
||||||
if (prefs_get_string(PREF_AUTOAWAY_MESSAGE) != NULL) {
|
if (prefs_get_string(PREF_AUTOAWAY_MESSAGE) != NULL) {
|
||||||
int pri =
|
int pri =
|
||||||
accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
||||||
CONTACT_AWAY);
|
RESOURCE_AWAY);
|
||||||
cons_show("Idle for %d minutes, status set to away (priority %d), \"%s\".",
|
cons_show("Idle for %d minutes, status set to away (priority %d), \"%s\".",
|
||||||
prefs_get_autoaway_time(), pri, prefs_get_string(PREF_AUTOAWAY_MESSAGE));
|
prefs_get_autoaway_time(), pri, prefs_get_string(PREF_AUTOAWAY_MESSAGE));
|
||||||
title_bar_set_status(RESOURCE_AWAY);
|
title_bar_set_status(CONTACT_AWAY);
|
||||||
win_current_page_off();
|
win_current_page_off();
|
||||||
} else {
|
} else {
|
||||||
int pri =
|
int pri =
|
||||||
accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
||||||
CONTACT_AWAY);
|
RESOURCE_AWAY);
|
||||||
cons_show("Idle for %d minutes, status set to away (priority %d).",
|
cons_show("Idle for %d minutes, status set to away (priority %d).",
|
||||||
prefs_get_autoaway_time(), pri);
|
prefs_get_autoaway_time(), pri);
|
||||||
title_bar_set_status(RESOURCE_AWAY);
|
title_bar_set_status(CONTACT_AWAY);
|
||||||
win_current_page_off();
|
win_current_page_off();
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle idle mode
|
// handle idle mode
|
||||||
} else if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "idle") == 0) {
|
} else if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "idle") == 0) {
|
||||||
presence_update(CONTACT_ONLINE,
|
presence_update(RESOURCE_ONLINE,
|
||||||
prefs_get_string(PREF_AUTOAWAY_MESSAGE), idle_ms / 1000);
|
prefs_get_string(PREF_AUTOAWAY_MESSAGE), idle_ms / 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -485,16 +485,16 @@ _handle_idle_time()
|
|||||||
// handle check
|
// handle check
|
||||||
if (prefs_get_boolean(PREF_AUTOAWAY_CHECK)) {
|
if (prefs_get_boolean(PREF_AUTOAWAY_CHECK)) {
|
||||||
if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "away") == 0) {
|
if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "away") == 0) {
|
||||||
presence_update(CONTACT_ONLINE, NULL, 0);
|
presence_update(RESOURCE_ONLINE, NULL, 0);
|
||||||
int pri =
|
int pri =
|
||||||
accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
accounts_get_priority_for_presence_type(jabber_get_account_name(),
|
||||||
CONTACT_ONLINE);
|
RESOURCE_ONLINE);
|
||||||
cons_show("No longer idle, status set to online (priority %d).", pri);
|
cons_show("No longer idle, status set to online (priority %d).", pri);
|
||||||
title_bar_set_status(RESOURCE_ONLINE);
|
title_bar_set_status(CONTACT_ONLINE);
|
||||||
win_current_page_off();
|
win_current_page_off();
|
||||||
} else if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "idle") == 0) {
|
} else if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "idle") == 0) {
|
||||||
presence_update(CONTACT_ONLINE, NULL, 0);
|
presence_update(RESOURCE_ONLINE, NULL, 0);
|
||||||
title_bar_set_status(RESOURCE_ONLINE);
|
title_bar_set_status(CONTACT_ONLINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user