diff --git a/whatsrust/src/actions.rs b/whatsrust/src/actions.rs index 15961e1..cc3b71a 100644 --- a/whatsrust/src/actions.rs +++ b/whatsrust/src/actions.rs @@ -1,6 +1,7 @@ use std::ffi::CString; use super::*; +use crate::abi::{C_EditMessage, C_ReactToMessage, C_RevokeMessage}; pub(crate) fn reaction_to_ffi( target_jid: &JID, diff --git a/whatsrust/src/facade_tests.rs b/whatsrust/src/facade_tests.rs index 1baf694..99f30aa 100644 --- a/whatsrust/src/facade_tests.rs +++ b/whatsrust/src/facade_tests.rs @@ -22,9 +22,10 @@ mod file_kind_tests { mod message_action_tests { use std::ffi::CString; + use crate::abi::{CMessageActionEvent, CReactionEvent}; use crate::actions::{edit_to_ffi, reaction_to_ffi, revoke_to_ffi}; use crate::events::{message_action_event_from_ffi, reaction_event_from_ffi}; - use crate::{CMessageActionEvent, CReactionEvent, Event, JID, MessageActionKind}; + use crate::{Event, JID, MessageActionKind}; #[test] fn reaction_mapping_preserves_every_ordinary_message_field() { @@ -171,7 +172,8 @@ mod presence_event_tests { }; use crate::{ - C_TestEmitPresenceEvent, C_TestEmitPresenceEventsConcurrently, PresenceUpdate, + PresenceUpdate, + abi::{C_TestEmitPresenceEvent, C_TestEmitPresenceEventsConcurrently}, set_presence_handler, }; diff --git a/whatsrust/src/lib.rs b/whatsrust/src/lib.rs index a0a35b4..0afa1c0 100644 --- a/whatsrust/src/lib.rs +++ b/whatsrust/src/lib.rs @@ -19,7 +19,6 @@ mod presence; mod queries; mod read_sync; mod registrations; -use abi::*; pub use abi::{LogoutStatus, ReceiptKind}; pub use actions::{edit_message, react_to_message, react_to_message_in_chat, revoke_message}; pub use callbacks::CallbackTranslator; diff --git a/whatsrust/src/lifecycle.rs b/whatsrust/src/lifecycle.rs index 3ab9d75..82dc549 100644 --- a/whatsrust/src/lifecycle.rs +++ b/whatsrust/src/lifecycle.rs @@ -1,6 +1,9 @@ use std::ffi::{CStr, CString, c_char}; use super::*; +use crate::abi::{ + C_Connect, C_Disconnect, C_FreePairPhoneResult, C_Logout, C_NewClient, C_PairPhone, +}; impl CallbackTranslator<*const c_char> for String { unsafe fn to_rust(ptr: *const c_char) -> String { diff --git a/whatsrust/src/media.rs b/whatsrust/src/media.rs index 82e3925..c432038 100644 --- a/whatsrust/src/media.rs +++ b/whatsrust/src/media.rs @@ -4,6 +4,10 @@ use std::{ }; use super::*; +use crate::abi::{ + C_DownloadFile, C_FreeProfilePicture, C_GetCommunityProfilePicture, C_GetProfilePicture, CJID, + CProfilePictureResult, +}; fn profile_picture_from_parts( status: u8, diff --git a/whatsrust/src/presence.rs b/whatsrust/src/presence.rs index 5fe807a..f668895 100644 --- a/whatsrust/src/presence.rs +++ b/whatsrust/src/presence.rs @@ -4,6 +4,9 @@ use std::{ }; use super::*; +use crate::abi::{ + C_DrainRawPresenceDiagnostics, C_FreeRawPresenceDiagnostics, C_SubscribePresence, +}; static PRESENCE_CALLBACK_INGRESS: AtomicUsize = AtomicUsize::new(0); diff --git a/whatsrust/src/queries.rs b/whatsrust/src/queries.rs index 0c6e1ed..1127872 100644 --- a/whatsrust/src/queries.rs +++ b/whatsrust/src/queries.rs @@ -2,13 +2,13 @@ use std::ffi::CStr; use std::sync::Arc; use super::{ + ChatSettings, CommunitiesError, CommunityInfo, GroupInfo, GroupInfoError, GroupParticipant, JID, +}; +use crate::abi::{ C_FreeCommunities, C_FreeContacts, C_FreeGroupParticipants, C_FreeResolveDmChatId, C_GetChatSettings, C_GetCommunities, C_GetContacts, C_GetGroupInfo, C_GetGroupParticipants, C_ResolveDmChatId, CJID, }; -use super::{ - ChatSettings, CommunitiesError, CommunityInfo, GroupInfo, GroupInfoError, GroupParticipant, JID, -}; /// Returns all contacts and groups as (JID, display name). Includes LID aliases for contacts. pub fn get_contacts() -> Vec<(JID, Arc)> { diff --git a/whatsrust/src/read_sync.rs b/whatsrust/src/read_sync.rs index 2f6fec9..f05444f 100644 --- a/whatsrust/src/read_sync.rs +++ b/whatsrust/src/read_sync.rs @@ -1,9 +1,7 @@ use std::ffi::{CString, c_char}; -use crate::{ - abi::*, - models::{JID, MessageId}, -}; +use crate::abi::{C_MarkAsRead, C_MarkChatReadSync}; +use crate::models::{JID, MessageId}; #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum MarkAsReadError { diff --git a/whatsrust/src/registrations.rs b/whatsrust/src/registrations.rs index 074b35a..be304c3 100644 --- a/whatsrust/src/registrations.rs +++ b/whatsrust/src/registrations.rs @@ -1,6 +1,10 @@ use std::ffi::c_char; use super::*; +use crate::abi::{ + C_SetLogHandler, C_SetMessageHandler, C_SetOptimisticTextSentHandler, C_SetPresenceHandler, + CJID, CMessage, +}; impl CallbackTranslator for bool { unsafe fn to_rust(value: bool) -> Self {