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:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user