mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-04-01 17:13:13 +00:00
rename functions for symmetry
This commit is contained in:
parent
a11e3c3fed
commit
9e03eca3c4
@ -54,10 +54,10 @@ pub fn create_context(name: repr_c::String) -> repr_c::Box<ContextHandle> {
|
||||
Box::new(ContextHandle(Context::new_with_name(&*name))).into()
|
||||
}
|
||||
|
||||
/// Returns the friendly name of the context's identity
|
||||
/// Returns the friendly name of the contexts installation.
|
||||
#[ffi_export]
|
||||
pub fn get_friendly_name(ctx: &ContextHandle) -> repr_c::String {
|
||||
ctx.0.get_friendly_name().to_string().into()
|
||||
pub fn installation_name(ctx: &ContextHandle) -> repr_c::String {
|
||||
ctx.0.installation_name().to_string().into()
|
||||
}
|
||||
|
||||
/// Destroys a conversation store and frees its memory
|
||||
|
||||
@ -31,7 +31,7 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_friendly_name(&self) -> &str {
|
||||
pub fn installation_name(&self) -> &str {
|
||||
self._identity.get_name()
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ proc create_context*(name: ReprCString): ContextHandle {.importc, dynlib: CONVER
|
||||
|
||||
## Returns the friendly name of the context's identity
|
||||
## The result must be freed by the caller (repr_c::String ownership transfers)
|
||||
proc get_friendly_name*(ctx: ContextHandle): ReprCString {.importc, dynlib: CONVERSATIONS_LIB.}
|
||||
proc installation_name*(ctx: ContextHandle): ReprCString {.importc, dynlib: CONVERSATIONS_LIB.}
|
||||
|
||||
## Destroys a context and frees its memory
|
||||
## - handle must be a valid pointer from create_context()
|
||||
|
||||
@ -24,7 +24,7 @@ proc newConversationsContext*(name: string): LibChat =
|
||||
proc getInstallationName*(ctx: LibChat): string =
|
||||
if ctx.handle == nil:
|
||||
return ""
|
||||
let name = get_friendly_name(ctx.handle)
|
||||
let name = installation_name(ctx.handle)
|
||||
result = $name
|
||||
|
||||
## Destroy the context and free resources
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user