diff --git a/ncdc/src/status.c b/ncdc/src/status.c index 7cb69e4..e6a3cc8 100644 --- a/ncdc/src/status.c +++ b/ncdc/src/status.c @@ -24,6 +24,8 @@ bool ncdc_cmd_idle(ncdc_mainwindow_t n, size_t ac, wchar_t **av, { bool ret = false; + return_if_true(!is_logged_in(), false); + ret = dc_api_set_user_status(dc_session_api(current_session), dc_session_me(current_session), DC_API_USER_STATUS_IDLE @@ -36,6 +38,8 @@ bool ncdc_cmd_online(ncdc_mainwindow_t n, size_t ac, wchar_t **av, { bool ret = false; + return_if_true(!is_logged_in(), false); + ret = dc_api_set_user_status(dc_session_api(current_session), dc_session_me(current_session), DC_API_USER_STATUS_ONLINE @@ -48,6 +52,8 @@ bool ncdc_cmd_invisible(ncdc_mainwindow_t n, size_t ac, wchar_t **av, { bool ret = false; + return_if_true(!is_logged_in(), false); + ret = dc_api_set_user_status(dc_session_api(current_session), dc_session_me(current_session), DC_API_USER_STATUS_INVISIBLE @@ -60,6 +66,8 @@ bool ncdc_cmd_dnd(ncdc_mainwindow_t n, size_t ac, wchar_t **av, { bool ret = false; + return_if_true(!is_logged_in(), false); + ret = dc_api_set_user_status(dc_session_api(current_session), dc_session_me(current_session), DC_API_USER_STATUS_DND