Refactor notifications

This commit is contained in:
Bat
2018-07-26 15:46:10 +02:00
parent 44172b67d5
commit c87d490664
12 changed files with 146 additions and 46 deletions
+2 -5
View File
@@ -70,12 +70,9 @@ impl FromActivity<FollowAct, PgConnection> for Follow {
impl Notify<PgConnection> for Follow {
fn notify(&self, conn: &PgConnection) {
let follower = User::get(conn, self.follower_id).unwrap();
Notification::insert(conn, NewNotification {
title: "{{ data }} started following you".to_string(),
data: Some(follower.display_name.clone()),
content: None,
link: Some(follower.ap_url),
kind: notification_kind::FOLLOW.to_string(),
object_id: self.id,
user_id: self.following_id
});
}