Commit 510777853a64ab98d4245e9dca948518fc0057e8
1 parent
58e58d38
Exists in
federation_followers_backend
Create controller action
Signed-off-by: Artur Bersan de Faria <artur_bersan@hotmail.com> Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Showing
3 changed files
with
22 additions
and
10 deletions
Show diff stats
app/controllers/my_profile/followed_people_controller.rb
app/controllers/public/profile_controller.rb
| ... | ... | @@ -155,6 +155,18 @@ class ProfileController < PublicController |
| 155 | 155 | end |
| 156 | 156 | end |
| 157 | 157 | |
| 158 | + def follow | |
| 159 | + if !current_person.follows?(profile) | |
| 160 | + current_person.follow(profile) | |
| 161 | + end | |
| 162 | + end | |
| 163 | + | |
| 164 | + def unfollow | |
| 165 | + if current_person.follows?(profile) | |
| 166 | + current_person.unfollow(profile) | |
| 167 | + end | |
| 168 | + end | |
| 169 | + | |
| 158 | 170 | def check_friendship |
| 159 | 171 | unless logged_in? |
| 160 | 172 | render :text => '' | ... | ... |