summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-01-25 02:19:29 -0500
committerMason Reed <mason@vector35.com>2025-01-25 02:19:29 -0500
commit26ed2cdfb13591c63a52e978ead5eae0b6acb0c4 (patch)
treeb9a6af3bdf15e2b1a46e5ad84ae05f7b722c6829 /rust/src
parente2bd9eae7b5d9eab93b59e481bfa2afbdf875dab (diff)
Fix collaboration support checks in rust unit tests
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/collaboration.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/rust/src/collaboration.rs b/rust/src/collaboration.rs
index 1dce8104..e173afaa 100644
--- a/rust/src/collaboration.rs
+++ b/rust/src/collaboration.rs
@@ -36,6 +36,16 @@ use crate::string::{BnStrCompatible, BnString};
// TODO: on what functions need to have been called prior? I feel like we should make the user have to pull
// TODO: the data because they have a greater understanding of where the function is being called from.
+/// Check whether the client has collaboration support.
+///
+/// Call this if you intend on providing divergent behavior, as otherwise you will likely
+/// crash calling collaboration APIs on unsupported builds of Binary Ninja.
+pub fn has_collaboration_support() -> bool {
+ let mut count = 0;
+ let value = unsafe { BNCollaborationGetRemotes(&mut count) };
+ !value.is_null()
+}
+
/// Get the single actively connected Remote (for ux simplification), if any
pub fn active_remote() -> Option<Ref<Remote>> {
let value = unsafe { BNCollaborationGetActiveRemote() };