about summary refs log tree commit diff stats
path: root/src/omemo
diff options
context:
space:
mode:
Diffstat (limited to 'src/omemo')
-rw-r--r--src/omemo/store.c15
-rw-r--r--src/omemo/store.h10
2 files changed, 25 insertions, 0 deletions
diff --git a/src/omemo/store.c b/src/omemo/store.c
index 93289b90..eee58e19 100644
--- a/src/omemo/store.c
+++ b/src/omemo/store.c
@@ -1,6 +1,7 @@
 #include <glib.h>
 #include <signal/signal_protocol.h>
 
+#include "config.h"
 #include "omemo/omemo.h"
 #include "omemo/store.h"
 
@@ -30,9 +31,15 @@ identity_key_store_new(identity_key_store_t *identity_key_store)
     identity_key_store->public = NULL;
 }
 
+#ifdef HAVE_LIBSIGNAL_LT_2_3_2
 int
 load_session(signal_buffer **record, const signal_protocol_address *address,
     void *user_data)
+#else
+int
+load_session(signal_buffer **record, signal_buffer **user_record,
+    const signal_protocol_address *address, void *user_data)
+#endif
 {
     GHashTable *session_store = (GHashTable *)user_data;
     GHashTable *device_store = NULL;
@@ -76,9 +83,17 @@ get_sub_device_sessions(signal_int_list **sessions, const char *name,
     return SG_SUCCESS;
 }
 
+#ifdef HAVE_LIBSIGNAL_LT_2_3_2
 int
 store_session(const signal_protocol_address *address, uint8_t *record,
     size_t record_len, void *user_data)
+#else
+int
+store_session(const signal_protocol_address *address,
+    uint8_t *record, size_t record_len,
+    uint8_t *user_record, size_t user_record_len,
+    void *user_data)
+#endif
 {
     GHashTable *session_store = (GHashTable *)user_data;
     GHashTable *device_store = NULL;
diff --git a/src/omemo/store.h b/src/omemo/store.h
index ad33d5a5..986b7c42 100644
--- a/src/omemo/store.h
+++ b/src/omemo/store.h
@@ -1,5 +1,7 @@
 #include <signal/signal_protocol.h>
 
+#include "config.h"
+
 #define OMEMO_STORE_GROUP_IDENTITY "identity"
 #define OMEMO_STORE_KEY_DEVICE_ID "device_id"
 #define OMEMO_STORE_KEY_REGISTRATION_ID "registration_id"
@@ -28,7 +30,11 @@ void identity_key_store_new(identity_key_store_t *identity_key_store);
  * @param address the address of the remote client
  * @return 1 if the session was loaded, 0 if the session was not found, negative on failure
  */
+#ifdef HAVE_LIBSIGNAL_LT_2_3_2
 int load_session(signal_buffer **record, const signal_protocol_address *address, void *user_data);
+#else
+int load_session(signal_buffer **record, signal_buffer **user_record, const signal_protocol_address *address, void *user_data);
+#endif
 
 /**
  * Returns all known devices with active sessions for a recipient
@@ -50,7 +56,11 @@ int get_sub_device_sessions(signal_int_list **sessions, const char *name, size_t
  * @param record_len length of the serialized session record
  * @return 0 on success, negative on failure
  */
+#ifdef HAVE_LIBSIGNAL_LT_2_3_2
 int store_session(const signal_protocol_address *address, uint8_t *record, size_t record_len, void *user_data);
+#else
+int store_session(const signal_protocol_address *address, uint8_t *record, size_t record_len, uint8_t *user_record, size_t user_record_len, void *user_data);
+#endif
 
 /**
  * Determine whether there is a committed session record for a