mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 22:31:20 +00:00
update
This commit is contained in:
parent
f86a99b336
commit
53079c113a
3 changed files with 123 additions and 1008 deletions
1121
Cargo.lock
generated
1121
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -44,4 +44,4 @@ anyhow = "1.0.43"
|
||||||
thiserror = "1.0.26"
|
thiserror = "1.0.26"
|
||||||
background-jobs = "0.9.0"
|
background-jobs = "0.9.0"
|
||||||
reqwest = { version = "0.11.4", features = ["json"] }
|
reqwest = { version = "0.11.4", features = ["json"] }
|
||||||
webmention = {version = "0.1.3", features = ["hyper"], default-features = false }
|
webmention = {version = "0.3.0", git = "https://github.com/marinintim/webmention.git", branch = "feature/response" }
|
||||||
|
|
|
@ -28,6 +28,7 @@ use lemmy_utils::{
|
||||||
LemmyError,
|
LemmyError,
|
||||||
};
|
};
|
||||||
use lemmy_websocket::{send::send_post_ws_message, LemmyContext, UserOperationCrud};
|
use lemmy_websocket::{send::send_post_ws_message, LemmyContext, UserOperationCrud};
|
||||||
|
use log::warn;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use webmention::Webmention;
|
use webmention::Webmention;
|
||||||
|
|
||||||
|
@ -141,8 +142,11 @@ impl PerformCrud for CreatePost {
|
||||||
|
|
||||||
if let Some(url) = updated_post_url {
|
if let Some(url) = updated_post_url {
|
||||||
let hostname = Url::parse(&Settings::get().get_protocol_and_hostname())?;
|
let hostname = Url::parse(&Settings::get().get_protocol_and_hostname())?;
|
||||||
let mut webmention: Webmention = (hostname, url.clone().into_inner()).into();
|
let mut webmention: Webmention = (hostname, url.into_inner()).into();
|
||||||
webmention.send().await?;
|
webmention.set_checked(true);
|
||||||
|
if let Err(e) = webmention.send().await {
|
||||||
|
warn!("Failed to send webmention: {}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
send_post_ws_message(
|
send_post_ws_message(
|
||||||
|
|
Loading…
Reference in a new issue