lcg 1.5.2 to 1.5.4 unblock_contact()

This commit is contained in:
Dan Ballard 2022-01-16 14:00:21 -05:00
parent 3f25d8d829
commit 5db5208a54
5 changed files with 12 additions and 7 deletions

View File

@ -11,6 +11,6 @@ fn main() {
println!("cargo:rerun-if-changed=libCwtch.h");
let lib_cwtch_path = Path::new(&out_dir).join("libCwtch.so");
// https://git.openprivacy.ca/cwtch.im/libcwtch-go/releases v1.5.2
Command::new("wget").arg("https://git.openprivacy.ca/attachments/3e563341-c206-4e69-98e3-e0dca449f947").arg("-O").arg(lib_cwtch_path).output().expect("failed to download libCwtch.so");
// https://git.openprivacy.ca/cwtch.im/libcwtch-go/releases v1.5.4
Command::new("wget").arg("https://git.openprivacy.ca/attachments/dd3c6b41-98e4-4e7b-81af-d21893bfe389").arg("-O").arg(lib_cwtch_path).output().expect("failed to download libCwtch.so");
}

View File

@ -16,7 +16,6 @@ typedef struct { const char *p; ptrdiff_t n; } _GoString_;
#endif
/* Start of boilerplate cgo prologue. */
#line 1 "cgo-gcc-export-header-prolog"
@ -76,6 +75,7 @@ extern void c_CreateProfile(char* nick_ptr, int nick_len, char* pass_ptr, int pa
extern void c_LoadProfiles(char* passwordPtr, int passwordLen);
extern void c_AcceptConversation(char* profilePtr, int profileLen, int conversation_id);
extern void c_BlockContact(char* profilePtr, int profileLen, int conversation_id);
extern void c_UnblockContact(char* profilePtr, int profileLen, int conversation_id);
// the pointer returned from this function **must** be Freed by c_Free
extern char* c_GetMessage(char* profile_ptr, int profile_len, int conversation_id, int message_index);

View File

@ -89,8 +89,7 @@ impl CwtchLib for CwtchLibGo {
c_bind!(load_profiles(pass: &str;;) c_LoadProfiles);
c_bind!(accept_conversation(profile: &str ; conversation_id: i32 ;) c_AcceptConversation);
c_bind!(block_contact(profile: &str ; conversation_id: i32; ) c_BlockContact);
// todo 1.5.3
//c_bind!(unblock_contact(profile: &str ; conversation_id: i32; ) c_UnblockContact);
c_bind!(unblock_contact(profile: &str ; conversation_id: i32; ) c_UnblockContact);
c_bind!(get_message(profile: &str; conversation_id: i32, message_index: i32 ;) c_GetMessage -> String);
c_bind!(get_message_by_id(profile: &str ; conversation_id: i32, message_id: i32 ;) c_GetMessageByID -> String);
c_bind!(get_message_by_content_hash(profile: &str ; conversation_id: i32 ; hash: &str) c_GetMessagesByContentHash -> String);

View File

@ -253,6 +253,13 @@ extern "C" {
conversation_id: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn c_UnblockContact(
profilePtr: *mut ::std::os::raw::c_char,
profileLen: ::std::os::raw::c_int,
conversation_id: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn c_GetMessage(
profile_ptr: *mut ::std::os::raw::c_char,

View File

@ -35,9 +35,8 @@ pub trait CwtchLib {
/// Cause profile to block conversation
fn block_contact(&self, profile: &str, conversation_id: i32);
// TODO 1.5.3
/// Cause profile to unblock contact
//fn unblock_contact(&self, profile: &str, conversation_id: i32);
fn unblock_contact(&self, profile: &str, conversation_id: i32);
/// Get a specific message for conversation of profile by index
fn get_message(&self, profile: &str, conversation_id: i32, message_index: i32) -> String;