add actions for follow/unfollow

Signed-off-by: kernelkind <kernelkind@gmail.com>
Co-authored-by: Jakub Gladysz <jakub.gladysz@protonmail.com>
Co-authored-by: William Casarin <jb55@jb55.com>
This commit is contained in:
kernelkind
2025-07-05 14:26:24 -04:00
parent 00d6651533
commit a883ac8c34
4 changed files with 22 additions and 2 deletions

View File

@@ -38,6 +38,8 @@ fn add_client_tag(builder: NoteBuilder<'_>) -> NoteBuilder<'_> {
pub enum ProfileAction {
Edit(FullKeypair),
SaveChanges(SaveProfileChanges),
Follow(Pubkey),
Unfollow(Pubkey),
}
impl ProfileAction {
@@ -46,6 +48,7 @@ impl ProfileAction {
state_map: &mut HashMap<Pubkey, ProfileState>,
ndb: &Ndb,
pool: &mut RelayPool,
accounts: &Accounts,
) -> Option<RouterAction> {
match self {
ProfileAction::Edit(kp) => Some(RouterAction::route_to(Route::EditProfile(kp.pubkey))),
@@ -63,6 +66,14 @@ impl ProfileAction {
Some(RouterAction::GoBack)
}
ProfileAction::Follow(target_key) => {
Self::send_follow_user_event(ndb, pool, accounts, target_key);
None
}
ProfileAction::Unfollow(target_key) => {
Self::send_unfollow_user_event(ndb, pool, accounts, target_key);
None
}
}
}