mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-04-22 11:23:25 +00:00
Update Context to accept a name
This commit is contained in:
parent
705236f85c
commit
53597bc501
@ -22,7 +22,7 @@ pub struct Context {
|
|||||||
|
|
||||||
impl Context {
|
impl Context {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let identity = Rc::new(Identity::new());
|
let identity = Rc::new(Identity::default());
|
||||||
let inbox = Inbox::new(Rc::clone(&identity)); //
|
let inbox = Inbox::new(Rc::clone(&identity)); //
|
||||||
Self {
|
Self {
|
||||||
_identity: identity,
|
_identity: identity,
|
||||||
@ -31,6 +31,20 @@ impl Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_with_name(name: impl Into<String>) -> Self {
|
||||||
|
let identity = Rc::new(Identity::new(name));
|
||||||
|
let inbox = Inbox::new(Rc::clone(&identity)); //
|
||||||
|
Self {
|
||||||
|
_identity: identity,
|
||||||
|
store: ConversationStore::new(),
|
||||||
|
inbox,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_friendly_name(&self) -> &str {
|
||||||
|
self._identity.get_name()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn create_private_convo(
|
pub fn create_private_convo(
|
||||||
&mut self,
|
&mut self,
|
||||||
remote_bundle: &Introduction,
|
remote_bundle: &Introduction,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user