diff --git a/src/event/client_events.c b/src/event/client_events.c index d2dc29c6..3ef193b1 100644 --- a/src/event/client_events.c +++ b/src/event/client_events.c @@ -99,12 +99,12 @@ void cl_ev_presence_send(const resource_presence_t presence_type, const int idle_secs) { char *signed_status = NULL; - char *msg = connection_get_presence_msg(); #ifdef HAVE_LIBGPGME char *account_name = session_get_account_name(); ProfAccount *account = accounts_get_account(account_name); if (account->pgp_keyid) { + char *msg = connection_get_presence_msg(); signed_status = p_gpg_sign(msg, account->pgp_keyid); } account_free(account); diff --git a/tests/unittests/test_cmd_account.c b/tests/unittests/test_cmd_account.c index 9e7ae197..a1fff9b9 100644 --- a/tests/unittests/test_cmd_account.c +++ b/tests/unittests/test_cmd_account.c @@ -806,7 +806,6 @@ void cmd_account_set_priority_updates_presence_when_account_connected_with_prese expect_any(accounts_get_account, name); will_return(accounts_get_account, account); #endif - will_return(connection_get_presence_msg, "Free to chat"); expect_value(presence_send, status, RESOURCE_ONLINE); expect_value(presence_send, idle, 0); expect_value(presence_send, signed_status, NULL);