forked from blue/squawk
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
/*
|
|
* Created by victoria on 2021-05-13.
|
|
*/
|
|
|
|
#include "pre_key_store.h"
|
|
|
|
void Signal::Store::PreKeyStore::boundToContext(
|
|
signal_protocol_store_context *ctx) {
|
|
signal_protocol_pre_key_store store{};
|
|
|
|
store.destroy_func = nullptr;
|
|
store.user_data = nullptr;
|
|
|
|
store.contains_pre_key = [](uint32_t id, void *ptr) {
|
|
return static_cast<PreKeyStore *>(ptr)->containsPreKey(id);
|
|
};
|
|
store.load_pre_key = [](signal_buffer **record, uint32_t id, void *ptr) {
|
|
return static_cast<PreKeyStore *>(ptr)->loadPreKey(record, id);
|
|
};
|
|
store.remove_pre_key = [](uint32_t id, void *ptr) {
|
|
return static_cast<PreKeyStore *>(ptr)->removePreKey(id);
|
|
};
|
|
store.store_pre_key = [](uint32_t id, uint8_t *record, size_t size,
|
|
void *ptr) {
|
|
return static_cast<PreKeyStore *>(ptr)->storePreKey(id, record, size);
|
|
};
|
|
|
|
signal_protocol_store_context_set_pre_key_store(ctx, &store);
|
|
}
|
|
|
|
int Signal::Store::PreKeyStore::containsPreKey(uint32_t pre_key_id) {
|
|
return 0;
|
|
}
|
|
|
|
int Signal::Store::PreKeyStore::loadPreKey(signal_buffer **record, uint32_t pre_key_id) {
|
|
return 0;
|
|
}
|
|
|
|
int Signal::Store::PreKeyStore::storePreKey(uint32_t pre_key_id, uint8_t *record, size_t record_len) {
|
|
return 0;
|
|
}
|
|
|
|
int Signal::Store::PreKeyStore::removePreKey(uint32_t pre_key_id) { return 0; }
|