Update Context to accept a name

This commit is contained in:
Jazz Turner-Baggs 2026-02-18 10:00:28 -08:00
parent 705236f85c
commit 53597bc501
No known key found for this signature in database

View File

@ -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,