Switch Reveddit to Unddit

This commit is contained in:
spikecodes 2022-10-31 22:30:31 -07:00
parent aa54301054
commit b170a8dd99
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB
3 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@ -582,7 +582,7 @@ checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
[[package]]
name = "libreddit"
version = "0.23.0"
version = "0.23.1"
dependencies = [
"askama",
"async-recursion",

View File

@ -3,7 +3,7 @@ name = "libreddit"
description = " Alternative private front-end to Reddit"
license = "AGPL-3.0"
repository = "https://github.com/spikecodes/libreddit"
version = "0.23.0"
version = "0.23.1"
authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"]
edition = "2021"

View File

@ -100,7 +100,7 @@ async fn parse_post(json: &serde_json::Value) -> Post {
let body = if val(post, "removed_by_category") == "moderator" {
format!(
"<div class=\"md\"><p>[removed] — <a href=\"https://www.reveddit.com{}\">view removed post</a></p></div>",
"<div class=\"md\"><p>[removed] — <a href=\"https://www.unddit.com{}\">view removed post</a></p></div>",
permalink
)
} else {
@ -200,9 +200,9 @@ fn parse_comments(json: &serde_json::Value, post_link: &str, post_author: &str,
let id = val(&comment, "id");
let highlighted = id == highlighted_comment;
let body = if val(&comment, "author") == "[deleted]" && val(&comment, "body") == "[removed]" {
let body = if (val(&comment, "author") == "[deleted]" && val(&comment, "body") == "[removed]") || val(&comment, "body") == "[ Removed by Reddit ]" {
format!(
"<div class=\"md\"><p>[removed] — <a href=\"https://www.reveddit.com{}{}\">view removed comment</a></p></div>",
"<div class=\"md\"><p>[removed] — <a href=\"https://www.unddit.com{}{}\">view removed comment</a></p></div>",
post_link, id
)
} else {