about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-03-28 01:16:31 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-04-06 10:50:20 +0200
commita0a4fd042648f0b936621b076694283dd577f016 (patch)
tree8d4164fdc512ec74fb139e78aec45fe8b70b55ab /src/xmpp
parentdef212321636b13a72fdff71431fc003ad791482 (diff)
downloadprofani-tty-a0a4fd042648f0b936621b076694283dd577f016.tar.gz
db: log all incoming and outgoing messages
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/message.c6
-rw-r--r--src/xmpp/xmpp.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 5f3b65ac..d482f258 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -508,7 +508,7 @@ message_send_chat_omemo(const char *const jid, uint32_t sid, GList *keys,
 }
 #endif
 
-void
+char*
 message_send_private(const char *const fulljid, const char *const msg, const char *const oob_url)
 {
     xmpp_ctx_t * const ctx = connection_get_ctx();
@@ -517,14 +517,14 @@ message_send_private(const char *const fulljid, const char *const msg, const cha
     xmpp_stanza_t *message = xmpp_message_new(ctx, STANZA_TYPE_CHAT, fulljid, id);
     xmpp_message_set_body(message, msg);
 
-    free(id);
-
     if (oob_url) {
         stanza_attach_x_oob_url(ctx, message, oob_url);
     }
 
     _send_message_stanza(message);
     xmpp_stanza_release(message);
+
+    return id;
 }
 
 char*
diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h
index fff2164f..4d5d8279 100644
--- a/src/xmpp/xmpp.h
+++ b/src/xmpp/xmpp.h
@@ -175,7 +175,7 @@ char* message_send_chat(const char *const barejid, const char *const msg, const
 char* message_send_chat_otr(const char *const barejid, const char *const msg, gboolean request_receipt, const char *const replace_id);
 char* message_send_chat_pgp(const char *const barejid, const char *const msg, gboolean request_receipt, const char *const replace_id);
 char* message_send_chat_omemo(const char *const jid, uint32_t sid, GList *keys, const unsigned char *const iv, size_t iv_len, const unsigned char *const ciphertext, size_t ciphertext_len, gboolean request_receipt, gboolean muc, const char *const replace_id);
-void message_send_private(const char *const fulljid, const char *const msg, const char *const oob_url);
+char* message_send_private(const char *const fulljid, const char *const msg, const char *const oob_url);
 char* message_send_groupchat(const char *const roomjid, const char *const msg, const char *const oob_url, const char *const replace_id);
 void message_send_groupchat_subject(const char *const roomjid, const char *const subject);
 void message_send_inactive(const char *const jid);