refactor person registry

This commit is contained in:
2026-01-06 20:17:49 +07:00
parent 0072c5255d
commit 2d9563b888
12 changed files with 77 additions and 77 deletions

View File

@@ -508,7 +508,7 @@ impl ChatPanel {
fn profile(&self, public_key: &PublicKey, cx: &Context<Self>) -> Profile {
let persons = PersonRegistry::global(cx);
persons.read(cx).get_person(public_key, cx)
persons.read(cx).get(public_key, cx)
}
fn render_announcement(&self, ix: usize, cx: &Context<Self>) -> AnyElement {
@@ -795,7 +795,7 @@ impl ChatPanel {
fn render_report(report: &SendReport, cx: &App) -> impl IntoElement {
let persons = PersonRegistry::global(cx);
let profile = persons.read(cx).get_person(&report.receiver, cx);
let profile = persons.read(cx).get(&report.receiver, cx);
let name = profile.display_name();
let avatar = profile.avatar(true);
@@ -1057,7 +1057,7 @@ impl ChatPanel {
fn render_reply(&self, id: &EventId, cx: &Context<Self>) -> impl IntoElement {
if let Some(text) = self.message(id) {
let persons = PersonRegistry::global(cx);
let profile = persons.read(cx).get_person(&text.author, cx);
let profile = persons.read(cx).get(&text.author, cx);
div()
.w_full()

View File

@@ -254,7 +254,7 @@ fn render_pubkey(
cx: &App,
) {
let persons = PersonRegistry::global(cx);
let profile = persons.read(cx).get_person(&public_key, cx);
let profile = persons.read(cx).get(&public_key, cx);
let display_name = format!("@{}", profile.display_name());
text.replace_range(range.clone(), &display_name);