mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-04-01 09:04:03 +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 {
|
||||
pub fn new() -> Self {
|
||||
let identity = Rc::new(Identity::new());
|
||||
let identity = Rc::new(Identity::default());
|
||||
let inbox = Inbox::new(Rc::clone(&identity)); //
|
||||
Self {
|
||||
_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(
|
||||
&mut self,
|
||||
remote_bundle: &Introduction,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user