mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
feat: start integrating conversation wrapper functions
This commit is contained in:
parent
ed6930ba10
commit
3e348dc7e2
@ -26,6 +26,7 @@ set(SOURCES
|
||||
user_profile.cpp
|
||||
config_base.cpp
|
||||
contacts.cpp
|
||||
conversation.cpp
|
||||
util.cpp)
|
||||
|
||||
add_library( # Sets the name of the library.
|
||||
|
19
libsession-util/src/main/cpp/conversation.cpp
Normal file
19
libsession-util/src/main/cpp/conversation.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <jni.h>
|
||||
#include "conversation.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
extern "C"
|
||||
#pragma ide diagnostic ignored "bugprone-reserved-identifier"
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_messenger_libsession_1util_ConversationVolatileConfig_00024Companion_newInstance___3B(
|
||||
JNIEnv *env, jobject thiz, jbyteArray ed25519_secret_key) {
|
||||
|
||||
}
|
||||
extern "C"
|
||||
#pragma ide diagnostic ignored "bugprone-reserved-identifier"
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_messenger_libsession_1util_ConversationVolatileConfig_00024Companion_newInstance___3B_3B(
|
||||
JNIEnv *env, jobject thiz, jbyteArray ed25519_secret_key, jbyteArray initial_dump) {
|
||||
|
||||
}
|
||||
#pragma clang diagnostic pop
|
32
libsession-util/src/main/cpp/conversation.h
Normal file
32
libsession-util/src/main/cpp/conversation.h
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef SESSION_ANDROID_CONVERSATION_H
|
||||
#define SESSION_ANDROID_CONVERSATION_H
|
||||
|
||||
#include <jni.h>
|
||||
#include "util.h"
|
||||
#include "session/config/convo_info_volatile.hpp"
|
||||
|
||||
inline session::config::ConvoInfoVolatile *ptrToContacts(JNIEnv *env, jobject obj) {
|
||||
jclass contactsClass = env->FindClass("network/loki/messenger/libsession_util/ConversationVolatileConfig");
|
||||
jfieldID pointerField = env->GetFieldID(contactsClass, "pointer", "J");
|
||||
return (session::config::ConvoInfoVolatile *) env->GetLongField(obj, pointerField);
|
||||
}
|
||||
|
||||
inline jobject serialize_one_on_one(JNIEnv *env, session::config::convo::one_to_one one_to_one) {
|
||||
// TODO serialize function
|
||||
}
|
||||
|
||||
inline jobject serialize_open_group(JNIEnv *env, session::config::convo::open_group open_group) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
inline jobject serialize_legacy_group(JNIEnv *env, session::config::convo::legacy_closed_group legacy_group) {
|
||||
|
||||
}
|
||||
|
||||
inline jobject serialize_any(JNIEnv *env, session::config::convo::any)
|
||||
|
||||
inline session::config::ConvoInfoVolatile* deserialize_convo_info(JNIEnv *env, jobject info) {
|
||||
// TODO deserialize function
|
||||
}
|
||||
|
||||
#endif //SESSION_ANDROID_CONVERSATION_H
|
@ -67,18 +67,16 @@ class UserProfile(pointer: Long) : ConfigBase(pointer) {
|
||||
external fun setPic(userPic: UserPic)
|
||||
}
|
||||
|
||||
class ConversationConfig(pointer: Long): ConfigBase(pointer) {
|
||||
class ConversationVolatileConfig(pointer: Long): ConfigBase(pointer) {
|
||||
companion object {
|
||||
init {
|
||||
System.loadLibrary("session_util")
|
||||
}
|
||||
|
||||
external fun newInstance(ed25519SecretKey: ByteArray): ConversationConfig
|
||||
external fun newInstance(ed25519SecretKey: ByteArray): ConversationVolatileConfig
|
||||
|
||||
external fun newInstance(ed25519SecretKey: ByteArray, initialDump: ByteArray): ConversationConfig
|
||||
external fun newInstance(ed25519SecretKey: ByteArray, initialDump: ByteArray): ConversationVolatileConfig
|
||||
|
||||
}
|
||||
|
||||
external fun todo()
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user