From: Dessalines Date: Thu, 11 Jun 2020 02:47:06 +0000 (-0400) Subject: Adding delete picture via pict-rs delete tokens. Fixes #505 X-Git-Url: http://these/git/%22https:/join-lemmy.org/%22%7B%7D/%22%7Burl%7D/%22?a=commitdiff_plain;h=4cf1f080bf113d6e30383eb1fddd37ce16025558;p=lemmy.git Adding delete picture via pict-rs delete tokens. Fixes #505 --- diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml index 60b04beb..ab9ab7d8 100644 --- a/docker/dev/docker-compose.yml +++ b/docker/dev/docker-compose.yml @@ -28,7 +28,7 @@ services: restart: always pictrs: - image: asonix/pictrs:v0.1.0-r13 + image: asonix/pictrs:v0.1.3-r1 ports: - "127.0.0.1:8537:8080" user: 991:991 diff --git a/server/src/api/post.rs b/server/src/api/post.rs index 0e8a17e7..9eeb5158 100644 --- a/server/src/api/post.rs +++ b/server/src/api/post.rs @@ -116,8 +116,8 @@ impl Perform for Oper { return Err(APIError::err("site_ban").into()); } - // Fetch Iframely and Pictshare cached image - let (iframely_title, iframely_description, iframely_html, pictshare_thumbnail) = + // Fetch Iframely and pictrs cached image + let (iframely_title, iframely_description, iframely_html, pictrs_thumbnail) = fetch_iframely_and_pictrs_data(data.url.to_owned()); let post_form = PostForm { @@ -135,7 +135,7 @@ impl Perform for Oper { embed_title: iframely_title, embed_description: iframely_description, embed_html: iframely_html, - thumbnail_url: pictshare_thumbnail, + thumbnail_url: pictrs_thumbnail, }; let inserted_post = match Post::create(&conn, &post_form) { @@ -450,8 +450,8 @@ impl Perform for Oper { return Err(APIError::err("site_ban").into()); } - // Fetch Iframely and Pictshare cached image - let (iframely_title, iframely_description, iframely_html, pictshare_thumbnail) = + // Fetch Iframely and Pictrs cached image + let (iframely_title, iframely_description, iframely_html, pictrs_thumbnail) = fetch_iframely_and_pictrs_data(data.url.to_owned()); let post_form = PostForm { @@ -469,7 +469,7 @@ impl Perform for Oper { embed_title: iframely_title, embed_description: iframely_description, embed_html: iframely_html, - thumbnail_url: pictshare_thumbnail, + thumbnail_url: pictrs_thumbnail, }; let _updated_post = match Post::update(&conn, data.edit_id, &post_form) { diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 7abab752..79aa91bd 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -18,6 +18,7 @@ import { setupTribute, wsJsonToRes, emojiPicker, + pictrsDeleteToast, } from '../utils'; import { WebSocketService, UserService } from '../services'; import autosize from 'autosize'; @@ -162,8 +163,9 @@ export class CommentForm extends Component { {this.state.commentForm.content && (