commit 142aa879c3db8147f6f0697bfebe681ff405c73b
parent a7f5319fdeab57b8cc95e34b1b3bb827187de324
Author: kernelkind <kernelkind@gmail.com>
Date: Mon, 14 Jul 2025 21:14:01 -0400
make `Contacts::is_following` use bytes instead of `Pubkey`
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/crates/notedeck/src/account/contacts.rs b/crates/notedeck/src/account/contacts.rs
@@ -49,14 +49,14 @@ impl Contacts {
update_state(&mut self.state, &res.note, res.note_key);
}
- pub fn is_following(&self, other: &Pubkey) -> IsFollowing {
+ pub fn is_following(&self, other_pubkey: &[u8; 32]) -> IsFollowing {
match &self.state {
ContactState::Unreceived => IsFollowing::Unknown,
ContactState::Received {
contacts,
note_key: _,
} => {
- if contacts.contains(other) {
+ if contacts.contains(other_pubkey) {
IsFollowing::Yes
} else {
IsFollowing::No
diff --git a/crates/notedeck/src/user_account.rs b/crates/notedeck/src/user_account.rs
@@ -1,4 +1,4 @@
-use enostr::{Keypair, KeypairUnowned, Pubkey};
+use enostr::{Keypair, KeypairUnowned};
use tokenator::{ParseError, TokenParser, TokenSerializable};
use crate::{
@@ -33,8 +33,8 @@ impl UserAccount {
self
}
- pub fn is_following(&self, pk: &Pubkey) -> IsFollowing {
- self.data.contacts.is_following(pk)
+ pub fn is_following(&self, other_pubkey: &[u8; 32]) -> IsFollowing {
+ self.data.contacts.is_following(other_pubkey)
}
}
diff --git a/crates/notedeck_columns/src/ui/profile/mod.rs b/crates/notedeck_columns/src/ui/profile/mod.rs
@@ -178,7 +178,7 @@ impl<'a, 'd> ProfileView<'a, 'd> {
} else if &selected.key.pubkey == self.pubkey {
ProfileType::MyProfile
} else {
- ProfileType::Followable(selected.is_following(target_key))
+ ProfileType::Followable(selected.is_following(target_key.bytes()))
};
match profile_type {