diff --git a/Cargo.lock b/Cargo.lock index 41f132612..36bbfce8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2719,6 +2719,7 @@ dependencies = [ "enum_delegate", "futures", "html2md", + "html2text", "http", "itertools 0.11.0", "lemmy_api_common", @@ -2734,6 +2735,7 @@ dependencies = [ "serde_json", "serde_with", "serial_test", + "stringreader", "strum_macros", "task-local-extensions", "tokio", @@ -4950,6 +4952,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "stringreader" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "913e7b03d63752f6cdd2df77da36749d82669904798fe8944b9ec3d23f159905" + [[package]] name = "strsim" version = "0.10.0" diff --git a/crates/apub/Cargo.toml b/crates/apub/Cargo.toml index ebdf3245e..748fe3335 100644 --- a/crates/apub/Cargo.toml +++ b/crates/apub/Cargo.toml @@ -38,6 +38,8 @@ anyhow = { workspace = true } reqwest = { workspace = true } once_cell = { workspace = true } html2md = "0.2.14" +html2text = "0.6.0" +stringreader = "0.1.1" serde_with = { workspace = true } enum_delegate = "0.2.0" moka = { version = "0.11", features = ["future"] } diff --git a/crates/apub/assets/lemmy/objects/group.json b/crates/apub/assets/lemmy/objects/group.json index 3870daf75..1b848a866 100644 --- a/crates/apub/assets/lemmy/objects/group.json +++ b/crates/apub/assets/lemmy/objects/group.json @@ -1,7 +1,7 @@ { "id": "https://enterprise.lemmy.ml/c/tenforward", "type": "Group", - "preferredUsername": "main", + "preferredUsername": "tenforward", "name": "Ten Forward", "summary": "
Lounge and recreation facility
\nWelcome to the Enterprise!.
\n", "source": { diff --git a/crates/apub/assets/mastodon/objects/page.json b/crates/apub/assets/mastodon/objects/page.json index d2195dbf3..ec4c13080 100644 --- a/crates/apub/assets/mastodon/objects/page.json +++ b/crates/apub/assets/mastodon/objects/page.json @@ -11,40 +11,42 @@ "votersCount": "toot:votersCount" } ], - "id": "https://mastodon.madrid/users/felix/statuses/107224289116410645", + "id": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519", "type": "Note", "summary": null, - "published": "2021-11-05T11:46:50Z", - "url": "https://mastodon.madrid/@felix/107224289116410645", - "attributedTo": "https://mastodon.madrid/users/felix", - "to": ["https://mastodon.madrid/users/felix/followers"], + "inReplyTo": null, + "published": "2023-08-04T09:55:39Z", + "url": "https://dice.camp/@thekernelinyellow/110830743680706519", + "attributedTo": "https://dice.camp/users/thekernelinyellow", + "to": ["https://www.w3.org/ns/activitystreams#Public"], "cc": [ - "https://www.w3.org/ns/activitystreams#Public", - "https://mamot.fr/users/retiolus" + "https://dice.camp/users/thekernelinyellow/followers", + "https://enterprise.lemmy.ml/c/tenforward", + "https://enterprise.lemmy.ml/c/tenforward/followers" ], "sensitive": false, - "atomUri": "https://mastodon.madrid/users/felix/statuses/107224289116410645", - "inReplyToAtomUri": "https://mamot.fr/users/retiolus/statuses/107224244380204526", - "conversation": "tag:mamot.fr,2021-11-05:objectId=64635960:objectType=Conversation", - "content": "@retiolus i have never been disappointed by a thinkpad. if you want to save money, get a model from a few years ago, there isnt a huge difference anyway.
", + "atomUri": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519", + "inReplyToAtomUri": null, + "conversation": "tag:dice.camp,2023-08-04:objectId=29969291:objectType=Conversation", + "content": "@tenforward Variable never resetting at refresh
Hi! I'm using a variable to count elements in my generator but every time I generate a new character, the counter's value carries on from the previous one. Is there a function to reset it (I set it to 0 at the beginning of the file)
", "contentMap": { - "en": "@retiolus i have never been disappointed by a thinkpad. if you want to save money, get a model from a few years ago, there isnt a huge difference anyway.
" + "it": "@tenforwardVariable never resetting at refresh
Hi! I'm using a variable to count elements in my generator but every time I generate a new character, the counter's value carries on from the previous one. Is there a function to reset it (I set it to 0 at the beginning of the file)
" }, "attachment": [], "tag": [ { "type": "Mention", - "href": "https://mamot.fr/users/retiolus", - "name": "@retiolus@mamot.fr" + "href": "https://enterprise.lemmy.ml/c/tenforward", + "name": "@tenforward@enterprise.lemmy.ml" } ], "replies": { - "id": "https://mastodon.madrid/users/felix/statuses/107224289116410645/replies", + "id": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519/replies", "type": "Collection", "first": { "type": "CollectionPage", - "next": "https://mastodon.madrid/users/felix/statuses/107224289116410645/replies?only_other_accounts=true&page=true", - "partOf": "https://mastodon.madrid/users/felix/statuses/107224289116410645/replies", + "next": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519/replies?only_other_accounts=true&page=true", + "partOf": "https://dice.camp/users/thekernelinyellow/statuses/110830743680706519/replies", "items": [] } } diff --git a/crates/apub/src/api/user_settings_backup.rs b/crates/apub/src/api/user_settings_backup.rs index 0349171a9..c1102791d 100644 --- a/crates/apub/src/api/user_settings_backup.rs +++ b/crates/apub/src/api/user_settings_backup.rs @@ -7,7 +7,7 @@ use crate::objects::{ use activitypub_federation::{config::Data, fetch::object_id::ObjectId}; use actix_web::web::Json; use futures::{future::try_join_all, StreamExt}; -use lemmy_api_common::{context::LemmyContext, utils::sanitize_html_api_opt, SuccessResponse}; +use lemmy_api_common::{context::LemmyContext, SuccessResponse}; use lemmy_db_schema::{ newtypes::DbUrl, source::{ @@ -20,6 +20,7 @@ use lemmy_db_schema::{ post::{PostSaved, PostSavedForm}, }, traits::{Blockable, Crud, Followable, Saveable}, + utils::diesel_option_overwrite, }; use lemmy_db_views::structs::LocalUserView; use lemmy_utils::{ @@ -96,8 +97,8 @@ pub async fn import_settings( local_user_view: LocalUserView, context: Data