mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-05-21 17:58:15 +00:00
Compare commits
5 commits
613ccbcd94
...
9425b44d08
Author | SHA1 | Date | |
---|---|---|---|
9425b44d08 | |||
487f296db5 | |||
8bdd481e0d | |||
19f18421bc | |||
e1777e9071 |
|
@ -228,7 +228,7 @@ main .article-meta {
|
|||
fill: currentColor;
|
||||
}
|
||||
.action.liked:hover svg.feather {
|
||||
background: transparentize($red, 0.75)
|
||||
background: transparentize($red, 0.75);
|
||||
color: $red;
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ main .article-meta {
|
|||
background: $primary;
|
||||
}
|
||||
.action.reshared:hover svg.feather {
|
||||
background: transparentize($primary, 0.75)
|
||||
background: transparentize($primary, 0.75);
|
||||
color: $primary;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ impl Comment {
|
|||
});
|
||||
get!(comments);
|
||||
list_by!(comments, list_by_post, post_id as i32);
|
||||
list_by!(comments, list_by_author, author_id as i32);
|
||||
find_by!(comments, find_by_ap_url, ap_url as &str);
|
||||
|
||||
pub fn get_author(&self, conn: &Connection) -> Result<User> {
|
||||
|
|
|
@ -2,12 +2,11 @@ use activitystreams::activity::{Announce, Create, Delete, Follow, Like, Undo, Up
|
|||
|
||||
use crate::{
|
||||
comments::Comment,
|
||||
db_conn::DbConn,
|
||||
follows, likes,
|
||||
posts::{Post, PostUpdate},
|
||||
reshares::Reshare,
|
||||
users::User,
|
||||
Error, CONFIG,
|
||||
Connection, Error, CONFIG,
|
||||
};
|
||||
use plume_common::activity_pub::inbox::Inbox;
|
||||
|
||||
|
@ -46,8 +45,8 @@ impl_into_inbox_result! {
|
|||
Reshare => Reshared
|
||||
}
|
||||
|
||||
pub fn inbox(conn: &DbConn, act: serde_json::Value) -> Result<InboxResult, Error> {
|
||||
Inbox::handle(&**conn, act)
|
||||
pub fn inbox(conn: &Connection, act: serde_json::Value) -> Result<InboxResult, Error> {
|
||||
Inbox::handle(conn, act)
|
||||
.with::<User, Announce, Post>(CONFIG.proxy())
|
||||
.with::<User, Create, Comment>(CONFIG.proxy())
|
||||
.with::<User, Create, Post>(CONFIG.proxy())
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use crate::{
|
||||
ap_url, blocklisted_emails::BlocklistedEmail, blogs::Blog, db_conn::DbConn, follows::Follow,
|
||||
instance::*, medias::Media, notifications::Notification, post_authors::PostAuthor, posts::Post,
|
||||
safe_string::SafeString, schema::users, timeline::Timeline, Connection, Error, Result,
|
||||
UserEvent::*, CONFIG, ITEMS_PER_PAGE, USER_CHAN,
|
||||
ap_url, blocklisted_emails::BlocklistedEmail, blogs::Blog, comments::Comment, db_conn::DbConn,
|
||||
follows::Follow, instance::*, medias::Media, notifications::Notification,
|
||||
post_authors::PostAuthor, posts::Post, safe_string::SafeString, schema::users,
|
||||
timeline::Timeline, Connection, Error, Result, UserEvent::*, CONFIG, ITEMS_PER_PAGE, USER_CHAN,
|
||||
};
|
||||
use activitystreams::{
|
||||
activity::Delete,
|
||||
|
@ -168,6 +168,14 @@ impl User {
|
|||
notif.delete(conn)?
|
||||
}
|
||||
|
||||
for comment in Comment::list_by_author(conn, self.id)? {
|
||||
let delete_activity = comment.build_delete(conn)?;
|
||||
crate::inbox::inbox(
|
||||
conn,
|
||||
serde_json::to_value(&delete_activity).map_err(Error::from)?,
|
||||
)?;
|
||||
}
|
||||
|
||||
diesel::delete(self)
|
||||
.execute(conn)
|
||||
.map(|_| ())
|
||||
|
|
Loading…
Reference in a new issue