diff --git a/src/xmpp/chat_session.c b/src/xmpp/chat_session.c index f62f090c..56a782f1 100644 --- a/src/xmpp/chat_session.c +++ b/src/xmpp/chat_session.c @@ -120,11 +120,11 @@ chat_session_get_jid(const char* const barejid) return jid; } -char* +const char* chat_session_get_state(const char* const barejid) { ChatSession* session = chat_session_get(barejid); - char* state = NULL; + const char* state = NULL; if (session) { if (prefs_get_boolean(PREF_STATES) && session->send_states) { state = STANZA_NAME_ACTIVE; diff --git a/src/xmpp/chat_session.h b/src/xmpp/chat_session.h index e0144874..619750e4 100644 --- a/src/xmpp/chat_session.h +++ b/src/xmpp/chat_session.h @@ -59,7 +59,7 @@ void chat_session_recipient_paused(const char* const barejid, const char* const void chat_session_recipient_gone(const char* const barejid, const char* const resource); void chat_session_recipient_inactive(const char* const barejid, const char* const resource); char* chat_session_get_jid(const char* const barejid); -char* chat_session_get_state(const char* const barejid); +const char* chat_session_get_state(const char* const barejid); void chat_session_remove(const char* const barejid); diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 306b9be7..a81108fa 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -424,7 +424,7 @@ message_send_chat(const char* const barejid, const char* const msg, const char* { xmpp_ctx_t* const ctx = connection_get_ctx(); - char* state = chat_session_get_state(barejid); + const char* state = chat_session_get_state(barejid); char* jid = chat_session_get_jid(barejid); char* id = connection_create_stanza_id(); @@ -459,7 +459,7 @@ message_send_chat_pgp(const char* const barejid, const char* const msg, gboolean { xmpp_ctx_t* const ctx = connection_get_ctx(); - char* state = chat_session_get_state(barejid); + const char* state = chat_session_get_state(barejid); char* jid = chat_session_get_jid(barejid); char* id = connection_create_stanza_id(); @@ -525,7 +525,7 @@ message_send_chat_ox(const char* const barejid, const char* const msg, gboolean #ifdef HAVE_LIBGPGME xmpp_ctx_t* const ctx = connection_get_ctx(); - char* state = chat_session_get_state(barejid); + const char* state = chat_session_get_state(barejid); char* jid = chat_session_get_jid(barejid); char* id = connection_create_stanza_id(); @@ -589,7 +589,7 @@ message_send_chat_otr(const char* const barejid, const char* const msg, gboolean { xmpp_ctx_t* const ctx = connection_get_ctx(); - char* state = chat_session_get_state(barejid); + const char* state = chat_session_get_state(barejid); char* jid = chat_session_get_jid(barejid); char* id = connection_create_stanza_id(); @@ -627,7 +627,7 @@ message_send_chat_omemo(const char* const jid, uint32_t sid, GList* keys, const unsigned char* const ciphertext, size_t ciphertext_len, gboolean request_receipt, gboolean muc, const char* const replace_id) { - char* state = chat_session_get_state(jid); + const char* state = chat_session_get_state(jid); xmpp_ctx_t* const ctx = connection_get_ctx(); char* id; xmpp_stanza_t* message;