mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Allow /lastactivity on|off when not connected
This commit is contained in:
parent
904a5a81cf
commit
ea4fb2ce6c
@ -3271,6 +3271,10 @@ cmd_disco(ProfWin *window, const char * const command, gchar **args)
|
|||||||
gboolean
|
gboolean
|
||||||
cmd_lastactivity(ProfWin *window, const char * const command, gchar **args)
|
cmd_lastactivity(ProfWin *window, const char * const command, gchar **args)
|
||||||
{
|
{
|
||||||
|
if ((g_strcmp0(args[0], "on") == 0) || (g_strcmp0(args[0], "off") == 0)) {
|
||||||
|
return _cmd_set_boolean_preference(args[0], command, "Last activity", PREF_LASTACTIVITY);
|
||||||
|
}
|
||||||
|
|
||||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||||
|
|
||||||
if (conn_status != JABBER_CONNECTED) {
|
if (conn_status != JABBER_CONNECTED) {
|
||||||
@ -3288,10 +3292,6 @@ cmd_lastactivity(ProfWin *window, const char * const command, gchar **args)
|
|||||||
jid_destroy(jidp);
|
jid_destroy(jidp);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
} else if ((g_strcmp0(args[0], "on") == 0) || (g_strcmp0(args[0], "off") == 0)) {
|
|
||||||
return _cmd_set_boolean_preference(args[0], command, "Last activity responses", PREF_LASTACTIVITY);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
iq_last_activity_request(args[0]);
|
iq_last_activity_request(args[0]);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user