diff options
author | Steffen Jaeckel <jaeckel-floss@eyet-services.de> | 2023-01-09 17:58:40 +0100 |
---|---|---|
committer | Steffen Jaeckel <jaeckel-floss@eyet-services.de> | 2023-01-18 20:11:13 +0100 |
commit | 1a85448bf21ee7c3e217e5cb0d51364516018075 (patch) | |
tree | 84e80eedd53b45c612a3487b927285230b747485 /src/xmpp | |
parent | e886ba0c6fed433b561c4d0efb4f91b0681aa788 (diff) | |
download | profani-tty-1a85448bf21ee7c3e217e5cb0d51364516018075.tar.gz |
improve const correctness
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/chat_session.c | 4 | ||||
-rw-r--r-- | src/xmpp/chat_session.h | 2 | ||||
-rw-r--r-- | src/xmpp/message.c | 10 |
3 files changed, 8 insertions, 8 deletions
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; |