diff --git a/src/bindings_go.rs b/src/bindings_go.rs
index 37c4874..1acb34c 100644
--- a/src/bindings_go.rs
+++ b/src/bindings_go.rs
@@ -8,7 +8,7 @@ use std::ffi::CString;
use super::CwtchLib;
use crate::cwtchlib_go::bindings;
-use crate::{ConversationID, CwtchError, ProfileIdentity, ServerIdentity, structs::*};
+use crate::{ConversationID, CwtchError, FileKey, ProfileIdentity, ServerIdentity, structs::*};
use crate::event::Event;
struct c_str_wrap {
@@ -123,48 +123,48 @@ impl CwtchLib for CwtchLibGo {
c_bind!(started(;;) c_Started -> i32);
c_bind!(send_app_event(event_json: &str;;) c_SendAppEvent);
fn send_profile_event(&self, profile: ProfileIdentity, event_jason: &str) {
- self._send_profile_event(profile.into(), event_jason)
+ self._send_profile_event(String::from(profile).as_str(), event_jason)
}
c_bind!(create_profile(nick: &str, pass: &str;;) c_CreateProfile);
c_bind!(load_profiles(pass: &str;;) c_LoadProfiles);
fn accept_conversation(&self, profile: ProfileIdentity, conversation_id: ConversationID) {
- self._accept_conversation(profile.into(), conversation_id.into())
+ self._accept_conversation(String::from(profile).as_str(), conversation_id.into())
}
fn block_contact(&self, profile: ProfileIdentity, conversation_id: ConversationID) {
- self._block_contact(profile.into(), conversation_id.into())
+ self._block_contact(String::from(profile).as_str(), conversation_id.into())
}
fn unblock_contact(&self, profile: ProfileIdentity, conversation_id: ConversationID) {
- self._unblock_contact(profile.into(), conversation_id.into())
+ self._unblock_contact(String::from(profile).as_str(), conversation_id.into())
}
fn get_message(&self, profile: ProfileIdentity, conversation_id: ConversationID, message_index: i32) -> String {
- self._get_message(profile.into(), conversation_id.into(), message_index)
+ self._get_message(String::from(profile).as_str(), conversation_id.into(), message_index)
}
fn get_message_by_id(&self, profile: ProfileIdentity, conversation_id: ConversationID, message_id: i32) -> String {
- self._get_message_by_id(profile.into(), conversation_id.into(), message_id)
+ self._get_message_by_id(String::from(profile).as_str(), conversation_id.into(), message_id)
}
fn get_message_by_content_hash(&self, profile: ProfileIdentity, conversation_id: ConversationID, hash: &str) -> String {
- self._get_message_by_content_hash(profile.into(), conversation_id.into(), hash)
+ self._get_message_by_content_hash(String::from(profile).as_str(), conversation_id.into(), hash)
}
fn get_messages(&self, profile: ProfileIdentity, conversation_id: ConversationID, message_index: i32, count: i32) -> String {
- self.get_messages(profile.into(), conversation_id, message_index, count)
+ self._get_messages(String::from(profile).as_str(), conversation_id.into(), message_index, count)
}
fn send_message(&self, profile: ProfileIdentity, conversation_id: ConversationID, msg: &str) -> String {
- self._send_message(profile.into(), conversation_id.into(), msg)
+ self._send_message(String::from(profile).as_str(), conversation_id.into(), msg)
}
fn send_invitation(&self, profile: ProfileIdentity, conversation_id: ConversationID, target_id: i32) -> String {
- self._send_invitation(profile.into(), conversation_id.into(), target_id)
+ self._send_invitation(String::from(profile).as_str(), conversation_id.into(), target_id)
}
fn share_file(&self, profile: ProfileIdentity, conversation_id: ConversationID, file_path: &str) -> String {
- self.share_file(profile.into(), conversation_id, file_path)
+ self._share_file(String::from(profile).as_str(), conversation_id.into(), file_path)
}
- fn download_file(&self, profile: ProfileIdentity, conversation_id: ConversationID, file_path: &str, manifest_path: &str, file_key: &str) {
- self._download_file(profile.into(), conversation_id.into(), file_path, manifest_path, file_key)
+ fn download_file(&self, profile: ProfileIdentity, conversation_id: ConversationID, file_path: &str, manifest_path: &str, file_key: FileKey) {
+ self._download_file(String::from(profile).as_str(), conversation_id.into(), file_path, manifest_path, String::from(file_key).as_str())
}
- fn check_download_status(&self, profile: ProfileIdentity, file_key: &str) {
- self._check_download_status(profile.into(), file_key)
+ fn check_download_status(&self, profile: ProfileIdentity, file_key: FileKey) {
+ self._check_download_status(String::from(profile).as_str(), String::from(file_key).as_str())
}
- fn verify_or_resume_download(&self, profile: ProfileIdentity, conversation_id: ConversationID, file_key: &str) {
- self._verify_or_resume_download(profile.into(), conversation_id.into(), file_key)
+ fn verify_or_resume_download(&self, profile: ProfileIdentity, conversation_id: ConversationID, file_key: FileKey) {
+ self._verify_or_resume_download(String::from(profile).as_str(), conversation_id.into(), String::from(file_key).as_str())
}
fn reset_tor(&self) {
@@ -173,26 +173,26 @@ impl CwtchLib for CwtchLibGo {
}
}
fn create_group(&self, profile: ProfileIdentity, server: &str, name: &str) {
- self._create_group(profile.into(), server, name)
+ self._create_group(String::from(profile).as_str(), server, name)
}
fn delete_profile(&self, profile: ProfileIdentity, pass: &str) {
- self._delete_profile(profile.into(), pass)
+ self._delete_profile(String::from(profile).as_str(), pass)
}
fn archive_conversation(&self, profile: ProfileIdentity, conversation_id: ConversationID) {
- self._archive_conversation(profile.into(), conversation_id.into())
+ self._archive_conversation(String::from(profile).as_str(), conversation_id.into())
}
fn delete_contact(&self, profile: ProfileIdentity, conversation_id: ConversationID) {
- self._delete_contact(profile.into(), conversation_id.into())
+ self._delete_contact(String::from(profile).as_str(), conversation_id.into())
}
fn import_bundle(&self, profile: ProfileIdentity, bundle: &str) {
- self._import_bundle(profile.into(), bundle)
+ self._import_bundle(String::from(profile).as_str(), bundle)
}
fn set_profile_attribute(&self, profile: ProfileIdentity, key: &str, val: &str) {
- self._set_profile_attribute(profile.into(), key, val)
+ self._set_profile_attribute(String::from(profile).as_str(), key, val)
}
fn get_profile_attribute(&self, profile: ProfileIdentity, key: &str) -> Result