mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-02-10 17:03:12 +00:00
chore: isolate ffi functions
This commit is contained in:
parent
2e48e49a9a
commit
0ca0bb9548
@ -1,7 +1,7 @@
|
|||||||
use std::{collections::HashMap, rc::Rc, sync::Arc};
|
use std::{collections::HashMap, rc::Rc, sync::Arc};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
dm::common::{HasConversationId, OutboundSession, SessionRegistry},
|
common::{HasConversationId, OutboundSession, SessionRegistry},
|
||||||
errors::ChatError,
|
errors::ChatError,
|
||||||
identity::Identity,
|
identity::Identity,
|
||||||
inbox::Inbox,
|
inbox::Inbox,
|
||||||
|
|||||||
@ -1,2 +1 @@
|
|||||||
pub mod common;
|
|
||||||
pub mod privatev1;
|
pub mod privatev1;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use crypto::SecretKey;
|
|||||||
use prost::{Message, bytes::Bytes};
|
use prost::{Message, bytes::Bytes};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
dm::common::{HasConversationId, OutboundSession, SessionId},
|
common::{HasConversationId, OutboundSession, SessionId},
|
||||||
errors::ChatError,
|
errors::ChatError,
|
||||||
types::AddressedEncryptedPayload,
|
types::AddressedEncryptedPayload,
|
||||||
utils::timestamp_millis,
|
utils::timestamp_millis,
|
||||||
|
|||||||
1
conversations/src/ffi/mod.rs
Normal file
1
conversations/src/ffi/mod.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
pub mod api;
|
||||||
@ -7,8 +7,8 @@ use std::rc::Rc;
|
|||||||
|
|
||||||
use crypto::{PrekeyBundle, SecretKey};
|
use crypto::{PrekeyBundle, SecretKey};
|
||||||
|
|
||||||
|
use crate::common::{HasConversationId, InboundSessionHandler, OutboundSession, SessionId};
|
||||||
use crate::context::Introduction;
|
use crate::context::Introduction;
|
||||||
use crate::dm::common::{HasConversationId, InboundSessionHandler, OutboundSession, SessionId};
|
|
||||||
use crate::dm::privatev1::PrivateV1Convo;
|
use crate::dm::privatev1::PrivateV1Convo;
|
||||||
use crate::errors::ChatError;
|
use crate::errors::ChatError;
|
||||||
use crate::identity::Identity;
|
use crate::identity::Identity;
|
||||||
|
|||||||
@ -1,20 +1,23 @@
|
|||||||
mod api;
|
pub mod common;
|
||||||
mod context;
|
|
||||||
pub mod dm;
|
pub mod dm;
|
||||||
mod errors;
|
pub mod ffi;
|
||||||
mod group;
|
pub mod group;
|
||||||
mod identity;
|
|
||||||
pub mod inbox;
|
pub mod inbox;
|
||||||
|
|
||||||
|
mod context;
|
||||||
|
mod errors;
|
||||||
|
mod identity;
|
||||||
mod proto;
|
mod proto;
|
||||||
mod types;
|
mod types;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
pub use api::*;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use super::*;
|
use crate::ffi::api::{
|
||||||
|
create_context, create_intro_bundle, create_new_private_convo, destroy_context,
|
||||||
|
handle_payload,
|
||||||
|
};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
use crate::proto::{self, Message};
|
use crate::proto::{self, Message};
|
||||||
|
|
||||||
// FFI Type definitions
|
|
||||||
|
|
||||||
// This struct represents Outbound data.
|
// This struct represents Outbound data.
|
||||||
// It wraps an encoded payload with a delivery address, so it can be handled by the delivery service.
|
// It wraps an encoded payload with a delivery address, so it can be handled by the delivery service.
|
||||||
pub struct AddressedEnvelope {
|
pub struct AddressedEnvelope {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user