mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-22 18:51:08 +00:00
Add creator_id to edit
This commit is contained in:
parent
e568f109f9
commit
8ed35141b7
17 changed files with 131 additions and 194 deletions
260
Cargo.lock
generated
260
Cargo.lock
generated
|
@ -4,8 +4,9 @@ version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "activitypub_federation"
|
name = "activitypub_federation"
|
||||||
version = "0.5.0-beta.5"
|
version = "0.5.0-beta.6"
|
||||||
source = "git+https://github.com/LemmyNet/activitypub-federation-rust.git?branch=diesel-feature#9ffdadfc8df6719542861466234a7dac2f9707c9"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0e0aafb8ad437a019bac2e11d47fad6131974dace1855640a09d0e71d26571c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activitystreams-kinds",
|
"activitystreams-kinds",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
@ -19,7 +20,8 @@ dependencies = [
|
||||||
"enum_delegate",
|
"enum_delegate",
|
||||||
"futures",
|
"futures",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
|
"http-body-util",
|
||||||
"http-signature-normalization",
|
"http-signature-normalization",
|
||||||
"http-signature-normalization-reqwest",
|
"http-signature-normalization-reqwest",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
|
@ -97,26 +99,6 @@ version = "1.0.75"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
|
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "async-io"
|
|
||||||
version = "1.13.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af"
|
|
||||||
dependencies = [
|
|
||||||
"async-lock",
|
|
||||||
"autocfg",
|
|
||||||
"cfg-if",
|
|
||||||
"concurrent-queue",
|
|
||||||
"futures-lite",
|
|
||||||
"log",
|
|
||||||
"parking",
|
|
||||||
"polling",
|
|
||||||
"rustix 0.37.27",
|
|
||||||
"slab",
|
|
||||||
"socket2 0.4.10",
|
|
||||||
"waker-fn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-lock"
|
name = "async-lock"
|
||||||
version = "2.8.0"
|
version = "2.8.0"
|
||||||
|
@ -155,8 +137,8 @@ dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"headers",
|
"headers",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
"http-body",
|
"http-body 0.4.5",
|
||||||
"hyper",
|
"hyper",
|
||||||
"itoa",
|
"itoa",
|
||||||
"matchit",
|
"matchit",
|
||||||
|
@ -185,8 +167,8 @@ dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
"http-body",
|
"http-body 0.4.5",
|
||||||
"mime",
|
"mime",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
|
@ -371,15 +353,6 @@ dependencies = [
|
||||||
"inout",
|
"inout",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "concurrent-queue"
|
|
||||||
version = "2.3.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400"
|
|
||||||
dependencies = [
|
|
||||||
"crossbeam-utils",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation"
|
name = "core-foundation"
|
||||||
version = "0.9.3"
|
version = "0.9.3"
|
||||||
|
@ -690,15 +663,6 @@ version = "2.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
|
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "fastrand"
|
|
||||||
version = "1.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
|
|
||||||
dependencies = [
|
|
||||||
"instant",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fastrand"
|
name = "fastrand"
|
||||||
version = "2.0.1"
|
version = "2.0.1"
|
||||||
|
@ -761,9 +725,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "form_urlencoded"
|
name = "form_urlencoded"
|
||||||
version = "1.2.0"
|
version = "1.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
|
checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
@ -816,21 +780,6 @@ version = "0.3.29"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"
|
checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "futures-lite"
|
|
||||||
version = "1.13.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce"
|
|
||||||
dependencies = [
|
|
||||||
"fastrand 1.9.0",
|
|
||||||
"futures-core",
|
|
||||||
"futures-io",
|
|
||||||
"memchr",
|
|
||||||
"parking",
|
|
||||||
"pin-project-lite",
|
|
||||||
"waker-fn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-macro"
|
name = "futures-macro"
|
||||||
version = "0.3.29"
|
version = "0.3.29"
|
||||||
|
@ -918,7 +867,7 @@ dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
"indexmap 1.9.3",
|
"indexmap 1.9.3",
|
||||||
"slab",
|
"slab",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
@ -947,7 +896,7 @@ dependencies = [
|
||||||
"base64 0.21.5",
|
"base64 0.21.5",
|
||||||
"bytes",
|
"bytes",
|
||||||
"headers-core",
|
"headers-core",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
"mime",
|
"mime",
|
||||||
"sha1",
|
"sha1",
|
||||||
|
@ -959,7 +908,7 @@ version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429"
|
checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"http",
|
"http 0.2.11",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -991,6 +940,17 @@ dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"fnv",
|
||||||
|
"itoa",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http-body"
|
name = "http-body"
|
||||||
version = "0.4.5"
|
version = "0.4.5"
|
||||||
|
@ -998,7 +958,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
|
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
|
"pin-project-lite",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http-body"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"http 1.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http-body-util"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"futures-util",
|
||||||
|
"http 1.0.0",
|
||||||
|
"http-body 1.0.0",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1013,10 +996,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http-signature-normalization-reqwest"
|
name = "http-signature-normalization-reqwest"
|
||||||
version = "0.8.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c382c69a07b21accae86298d520579403af6479b1cd1c389e3ee11f01d48627"
|
checksum = "10cfb84663420ec12c4422820bfdf5e8e5e57467892587f43ac432e73ebce880"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"async-trait",
|
||||||
"base64 0.13.1",
|
"base64 0.13.1",
|
||||||
"http-signature-normalization",
|
"http-signature-normalization",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
|
@ -1050,8 +1034,8 @@ dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
"http-body",
|
"http-body 0.4.5",
|
||||||
"httparse",
|
"httparse",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
"itoa",
|
"itoa",
|
||||||
|
@ -1107,9 +1091,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "idna"
|
name = "idna"
|
||||||
version = "0.4.0"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
|
checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-bidi",
|
"unicode-bidi",
|
||||||
"unicode-normalization",
|
"unicode-normalization",
|
||||||
|
@ -1144,26 +1128,6 @@ dependencies = [
|
||||||
"generic-array",
|
"generic-array",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "instant"
|
|
||||||
version = "0.1.12"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "io-lifetimes"
|
|
||||||
version = "1.0.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
|
|
||||||
dependencies = [
|
|
||||||
"hermit-abi",
|
|
||||||
"libc",
|
|
||||||
"windows-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipnet"
|
name = "ipnet"
|
||||||
version = "2.9.0"
|
version = "2.9.0"
|
||||||
|
@ -1172,9 +1136,9 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "itertools"
|
||||||
version = "0.10.5"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
]
|
]
|
||||||
|
@ -1221,12 +1185,6 @@ version = "0.2.150"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "linux-raw-sys"
|
|
||||||
version = "0.3.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.4.11"
|
version = "0.4.11"
|
||||||
|
@ -1338,12 +1296,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "moka"
|
name = "moka"
|
||||||
version = "0.11.3"
|
version = "0.12.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fa6e72583bf6830c956235bff0d5afec8cf2952f579ebad18ae7821a917d950f"
|
checksum = "d8017ec3548ffe7d4cef7ac0e12b044c01164a74c0f3119420faeaf13490ad8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-io",
|
|
||||||
"async-lock",
|
"async-lock",
|
||||||
|
"async-trait",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
"crossbeam-epoch",
|
"crossbeam-epoch",
|
||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
|
@ -1352,7 +1310,6 @@ dependencies = [
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"quanta",
|
"quanta",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"scheduled-thread-pool",
|
|
||||||
"skeptic",
|
"skeptic",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"tagptr",
|
"tagptr",
|
||||||
|
@ -1440,15 +1397,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.18.0"
|
version = "1.19.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl"
|
name = "openssl"
|
||||||
version = "0.10.59"
|
version = "0.10.61"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33"
|
checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.1",
|
"bitflags 2.4.1",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
@ -1478,9 +1435,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl-sys"
|
name = "openssl-sys"
|
||||||
version = "0.9.95"
|
version = "0.9.97"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9"
|
checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -1494,12 +1451,6 @@ version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "parking"
|
|
||||||
version = "2.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.12.1"
|
version = "0.12.1"
|
||||||
|
@ -1535,9 +1486,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "percent-encoding"
|
name = "percent-encoding"
|
||||||
version = "2.3.0"
|
version = "2.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
|
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project"
|
name = "pin-project"
|
||||||
|
@ -1577,22 +1528,6 @@ version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
|
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "polling"
|
|
||||||
version = "2.8.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce"
|
|
||||||
dependencies = [
|
|
||||||
"autocfg",
|
|
||||||
"bitflags 1.3.2",
|
|
||||||
"cfg-if",
|
|
||||||
"concurrent-queue",
|
|
||||||
"libc",
|
|
||||||
"log",
|
|
||||||
"pin-project-lite",
|
|
||||||
"windows-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "powerfmt"
|
name = "powerfmt"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -1758,8 +1693,8 @@ dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
"http-body",
|
"http-body 0.4.5",
|
||||||
"hyper",
|
"hyper",
|
||||||
"hyper-tls",
|
"hyper-tls",
|
||||||
"ipnet",
|
"ipnet",
|
||||||
|
@ -1795,7 +1730,7 @@ checksum = "88a3e86aa6053e59030e7ce2d2a3b258dd08fc2d337d52f73f6cb480f5858690"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"http",
|
"http 0.2.11",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"task-local-extensions",
|
"task-local-extensions",
|
||||||
|
@ -1831,20 +1766,6 @@ dependencies = [
|
||||||
"semver",
|
"semver",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustix"
|
|
||||||
version = "0.37.27"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags 1.3.2",
|
|
||||||
"errno",
|
|
||||||
"io-lifetimes",
|
|
||||||
"libc",
|
|
||||||
"linux-raw-sys 0.3.8",
|
|
||||||
"windows-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.38.23"
|
version = "0.38.23"
|
||||||
|
@ -1854,7 +1775,7 @@ dependencies = [
|
||||||
"bitflags 2.4.1",
|
"bitflags 2.4.1",
|
||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys 0.4.11",
|
"linux-raw-sys",
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1888,15 +1809,6 @@ dependencies = [
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "scheduled-thread-pool"
|
|
||||||
version = "0.2.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19"
|
|
||||||
dependencies = [
|
|
||||||
"parking_lot",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
|
@ -1937,18 +1849,18 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.192"
|
version = "1.0.193"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001"
|
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.192"
|
version = "1.0.193"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1"
|
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -2180,9 +2092,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
|
checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"fastrand 2.0.1",
|
"fastrand",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"rustix 0.38.23",
|
"rustix",
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2252,9 +2164,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.34.0"
|
version = "1.35.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"
|
checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
@ -2454,9 +2366,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "url"
|
name = "url"
|
||||||
version = "2.4.1"
|
version = "2.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5"
|
checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"form_urlencoded",
|
"form_urlencoded",
|
||||||
"idna",
|
"idna",
|
||||||
|
@ -2486,12 +2398,6 @@ version = "0.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "waker-fn"
|
|
||||||
version = "1.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "walkdir"
|
name = "walkdir"
|
||||||
version = "2.4.0"
|
version = "2.4.0"
|
||||||
|
|
|
@ -4,7 +4,7 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
activitypub_federation = { git = "https://github.com/LemmyNet/activitypub-federation-rust.git", branch = "diesel-feature", features = ["axum", "diesel"], default-features = false }
|
activitypub_federation = { version = "0.5.0-beta.6", features = ["axum", "diesel"], default-features = false }
|
||||||
anyhow = "1.0.75"
|
anyhow = "1.0.75"
|
||||||
async-trait = "0.1.74"
|
async-trait = "0.1.74"
|
||||||
axum = "0.6.20"
|
axum = "0.6.20"
|
||||||
|
|
|
@ -45,6 +45,7 @@ create table article (
|
||||||
|
|
||||||
create table edit (
|
create table edit (
|
||||||
id serial primary key,
|
id serial primary key,
|
||||||
|
creator_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
||||||
hash uuid not null,
|
hash uuid not null,
|
||||||
ap_id varchar(255) not null unique,
|
ap_id varchar(255) not null unique,
|
||||||
diff text not null,
|
diff text not null,
|
||||||
|
@ -55,6 +56,7 @@ create table edit (
|
||||||
create table conflict (
|
create table conflict (
|
||||||
id uuid primary key,
|
id uuid primary key,
|
||||||
diff text not null,
|
diff text not null,
|
||||||
|
creator_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
||||||
article_id int REFERENCES article ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
article_id int REFERENCES article ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
||||||
previous_version_id uuid not null
|
previous_version_id uuid not null
|
||||||
);
|
);
|
|
@ -77,7 +77,7 @@ pub struct EditArticleData {
|
||||||
/// Conflicts are stored in the database so they can be retrieved later from `/api/v3/edit_conflicts`.
|
/// Conflicts are stored in the database so they can be retrieved later from `/api/v3/edit_conflicts`.
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
pub(in crate::api) async fn edit_article(
|
pub(in crate::api) async fn edit_article(
|
||||||
Extension(_user): Extension<LocalUserView>,
|
Extension(user): Extension<LocalUserView>,
|
||||||
data: Data<MyDataHandle>,
|
data: Data<MyDataHandle>,
|
||||||
Form(edit_form): Form<EditArticleData>,
|
Form(edit_form): Form<EditArticleData>,
|
||||||
) -> MyResult<Json<Option<ApiConflict>>> {
|
) -> MyResult<Json<Option<ApiConflict>>> {
|
||||||
|
@ -90,10 +90,11 @@ pub(in crate::api) async fn edit_article(
|
||||||
if edit_form.previous_version_id == original_article.latest_version {
|
if edit_form.previous_version_id == original_article.latest_version {
|
||||||
// No intermediate changes, simply submit new version
|
// No intermediate changes, simply submit new version
|
||||||
submit_article_update(
|
submit_article_update(
|
||||||
&data,
|
|
||||||
edit_form.new_text.clone(),
|
edit_form.new_text.clone(),
|
||||||
edit_form.previous_version_id,
|
edit_form.previous_version_id,
|
||||||
&original_article.article,
|
&original_article.article,
|
||||||
|
user.person.id,
|
||||||
|
&data,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
Ok(Json(None))
|
Ok(Json(None))
|
||||||
|
@ -108,6 +109,7 @@ pub(in crate::api) async fn edit_article(
|
||||||
let form = DbConflictForm {
|
let form = DbConflictForm {
|
||||||
id: EditVersion::new(&patch.to_string())?,
|
id: EditVersion::new(&patch.to_string())?,
|
||||||
diff: patch.to_string(),
|
diff: patch.to_string(),
|
||||||
|
creator_id: user.person.id,
|
||||||
article_id: original_article.article.id,
|
article_id: original_article.article.id,
|
||||||
previous_version_id: previous_version.hash,
|
previous_version_id: previous_version.hash,
|
||||||
};
|
};
|
||||||
|
@ -176,6 +178,7 @@ pub(in crate::api) async fn fork_article(
|
||||||
let form = DbEditForm {
|
let form = DbEditForm {
|
||||||
ap_id,
|
ap_id,
|
||||||
diff: e.diff,
|
diff: e.diff,
|
||||||
|
creator_id: e.creator_id,
|
||||||
article_id: article.id,
|
article_id: article.id,
|
||||||
hash: e.hash,
|
hash: e.hash,
|
||||||
previous_version_id: e.previous_version_id,
|
previous_version_id: e.previous_version_id,
|
||||||
|
|
|
@ -24,6 +24,7 @@ use std::sync::Mutex;
|
||||||
pub struct DbConflict {
|
pub struct DbConflict {
|
||||||
pub id: EditVersion,
|
pub id: EditVersion,
|
||||||
pub diff: String,
|
pub diff: String,
|
||||||
|
pub creator_id: i32,
|
||||||
pub article_id: i32,
|
pub article_id: i32,
|
||||||
pub previous_version_id: EditVersion,
|
pub previous_version_id: EditVersion,
|
||||||
}
|
}
|
||||||
|
@ -41,6 +42,7 @@ pub struct ApiConflict {
|
||||||
pub struct DbConflictForm {
|
pub struct DbConflictForm {
|
||||||
pub id: EditVersion,
|
pub id: EditVersion,
|
||||||
pub diff: String,
|
pub diff: String,
|
||||||
|
pub creator_id: i32,
|
||||||
pub article_id: i32,
|
pub article_id: i32,
|
||||||
pub previous_version_id: EditVersion,
|
pub previous_version_id: EditVersion,
|
||||||
}
|
}
|
||||||
|
@ -84,10 +86,11 @@ impl DbConflict {
|
||||||
// patch applies cleanly so we are done
|
// patch applies cleanly so we are done
|
||||||
// federate the change
|
// federate the change
|
||||||
submit_article_update(
|
submit_article_update(
|
||||||
data,
|
|
||||||
new_text,
|
new_text,
|
||||||
self.previous_version_id.clone(),
|
self.previous_version_id.clone(),
|
||||||
&original_article,
|
&original_article,
|
||||||
|
self.creator_id,
|
||||||
|
data,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
DbConflict::delete(self.id.clone(), &data.db_connection)?;
|
DbConflict::delete(self.id.clone(), &data.db_connection)?;
|
||||||
|
|
|
@ -20,6 +20,7 @@ pub struct DbEdit {
|
||||||
// TODO: we could use hash as primary key, but that gives errors on forking because
|
// TODO: we could use hash as primary key, but that gives errors on forking because
|
||||||
// the same edit is used for multiple articles
|
// the same edit is used for multiple articles
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
pub creator_id: i32,
|
||||||
/// UUID built from sha224 hash of diff
|
/// UUID built from sha224 hash of diff
|
||||||
pub hash: EditVersion,
|
pub hash: EditVersion,
|
||||||
pub ap_id: ObjectId<DbEdit>,
|
pub ap_id: ObjectId<DbEdit>,
|
||||||
|
@ -32,6 +33,7 @@ pub struct DbEdit {
|
||||||
#[derive(Debug, Clone, Insertable, AsChangeset)]
|
#[derive(Debug, Clone, Insertable, AsChangeset)]
|
||||||
#[diesel(table_name = edit, check_for_backend(diesel::pg::Pg))]
|
#[diesel(table_name = edit, check_for_backend(diesel::pg::Pg))]
|
||||||
pub struct DbEditForm {
|
pub struct DbEditForm {
|
||||||
|
pub creator_id: i32,
|
||||||
pub hash: EditVersion,
|
pub hash: EditVersion,
|
||||||
pub ap_id: ObjectId<DbEdit>,
|
pub ap_id: ObjectId<DbEdit>,
|
||||||
pub diff: String,
|
pub diff: String,
|
||||||
|
@ -42,6 +44,7 @@ pub struct DbEditForm {
|
||||||
impl DbEditForm {
|
impl DbEditForm {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
original_article: &DbArticle,
|
original_article: &DbArticle,
|
||||||
|
creator_id: i32,
|
||||||
updated_text: &str,
|
updated_text: &str,
|
||||||
previous_version_id: EditVersion,
|
previous_version_id: EditVersion,
|
||||||
) -> MyResult<Self> {
|
) -> MyResult<Self> {
|
||||||
|
@ -52,6 +55,7 @@ impl DbEditForm {
|
||||||
hash: version,
|
hash: version,
|
||||||
ap_id,
|
ap_id,
|
||||||
diff: diff.to_string(),
|
diff: diff.to_string(),
|
||||||
|
creator_id,
|
||||||
article_id: original_article.id,
|
article_id: original_article.id,
|
||||||
previous_version_id,
|
previous_version_id,
|
||||||
})
|
})
|
||||||
|
|
|
@ -16,6 +16,7 @@ diesel::table! {
|
||||||
conflict (id) {
|
conflict (id) {
|
||||||
id -> Uuid,
|
id -> Uuid,
|
||||||
diff -> Text,
|
diff -> Text,
|
||||||
|
creator_id -> Int4,
|
||||||
article_id -> Int4,
|
article_id -> Int4,
|
||||||
previous_version_id -> Uuid,
|
previous_version_id -> Uuid,
|
||||||
}
|
}
|
||||||
|
@ -24,6 +25,7 @@ diesel::table! {
|
||||||
diesel::table! {
|
diesel::table! {
|
||||||
edit (id) {
|
edit (id) {
|
||||||
id -> Int4,
|
id -> Int4,
|
||||||
|
creator_id -> Int4,
|
||||||
hash -> Uuid,
|
hash -> Uuid,
|
||||||
#[max_length = 255]
|
#[max_length = 255]
|
||||||
ap_id -> Varchar,
|
ap_id -> Varchar,
|
||||||
|
@ -81,7 +83,11 @@ diesel::table! {
|
||||||
|
|
||||||
diesel::joinable!(article -> instance (instance_id));
|
diesel::joinable!(article -> instance (instance_id));
|
||||||
diesel::joinable!(conflict -> article (article_id));
|
diesel::joinable!(conflict -> article (article_id));
|
||||||
|
diesel::joinable!(conflict -> person (creator_id));
|
||||||
diesel::joinable!(edit -> article (article_id));
|
diesel::joinable!(edit -> article (article_id));
|
||||||
|
diesel::joinable!(edit -> person (creator_id));
|
||||||
|
diesel::joinable!(instance_follow -> instance (instance_id));
|
||||||
|
diesel::joinable!(instance_follow -> person (follower_id));
|
||||||
diesel::joinable!(local_user -> person (person_id));
|
diesel::joinable!(local_user -> person (person_id));
|
||||||
|
|
||||||
diesel::allow_tables_to_appear_in_same_query!(
|
diesel::allow_tables_to_appear_in_same_query!(
|
||||||
|
|
|
@ -80,6 +80,11 @@ impl DbPerson {
|
||||||
.get_result::<DbPerson>(conn.deref_mut())?)
|
.get_result::<DbPerson>(conn.deref_mut())?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn read(id: i32, data: &Data<MyDataHandle>) -> MyResult<DbPerson> {
|
||||||
|
let mut conn = data.db_connection.lock().unwrap();
|
||||||
|
Ok(person::table.find(id).get_result(conn.deref_mut())?)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn create_local(
|
pub fn create_local(
|
||||||
username: String,
|
username: String,
|
||||||
password: String,
|
password: String,
|
||||||
|
|
|
@ -34,7 +34,6 @@ impl Accept {
|
||||||
kind: Default::default(),
|
kind: Default::default(),
|
||||||
id,
|
id,
|
||||||
};
|
};
|
||||||
dbg!(&accept);
|
|
||||||
send_activity(
|
send_activity(
|
||||||
&local_instance,
|
&local_instance,
|
||||||
accept,
|
accept,
|
||||||
|
@ -64,7 +63,6 @@ impl ActivityHandler for Accept {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn receive(self, data: &Data<Self::DataType>) -> Result<(), Self::Error> {
|
async fn receive(self, data: &Data<Self::DataType>) -> Result<(), Self::Error> {
|
||||||
dbg!(&self);
|
|
||||||
// add to follows
|
// add to follows
|
||||||
let person = self.object.actor.dereference_local(data).await?;
|
let person = self.object.actor.dereference_local(data).await?;
|
||||||
let instance = self.actor.dereference(data).await?;
|
let instance = self.actor.dereference(data).await?;
|
||||||
|
|
|
@ -55,10 +55,8 @@ impl ActivityHandler for Follow {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn receive(self, data: &Data<Self::DataType>) -> Result<(), Self::Error> {
|
async fn receive(self, data: &Data<Self::DataType>) -> Result<(), Self::Error> {
|
||||||
dbg!(&self);
|
|
||||||
let actor = self.actor.dereference(data).await?;
|
let actor = self.actor.dereference(data).await?;
|
||||||
let local_instance = DbInstance::read_local_instance(&data.db_connection)?;
|
let local_instance = DbInstance::read_local_instance(&data.db_connection)?;
|
||||||
dbg!(&actor.ap_id, &local_instance.ap_id);
|
|
||||||
DbInstance::follow(&actor, &local_instance, false, data)?;
|
DbInstance::follow(&actor, &local_instance, false, data)?;
|
||||||
|
|
||||||
// send back an accept
|
// send back an accept
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::database::article::DbArticle;
|
use crate::database::article::DbArticle;
|
||||||
use crate::database::edit::{DbEdit, DbEditForm};
|
use crate::database::edit::{DbEdit, DbEditForm};
|
||||||
use crate::database::instance::DbInstance;
|
use crate::database::instance::DbInstance;
|
||||||
|
|
||||||
use crate::database::version::EditVersion;
|
use crate::database::version::EditVersion;
|
||||||
use crate::database::MyDataHandle;
|
use crate::database::MyDataHandle;
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
@ -16,12 +17,13 @@ pub mod update_local_article;
|
||||||
pub mod update_remote_article;
|
pub mod update_remote_article;
|
||||||
|
|
||||||
pub async fn submit_article_update(
|
pub async fn submit_article_update(
|
||||||
data: &Data<MyDataHandle>,
|
|
||||||
new_text: String,
|
new_text: String,
|
||||||
previous_version: EditVersion,
|
previous_version: EditVersion,
|
||||||
original_article: &DbArticle,
|
original_article: &DbArticle,
|
||||||
|
creator_id: i32,
|
||||||
|
data: &Data<MyDataHandle>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let form = DbEditForm::new(original_article, &new_text, previous_version)?;
|
let form = DbEditForm::new(original_article, creator_id, &new_text, previous_version)?;
|
||||||
if original_article.local {
|
if original_article.local {
|
||||||
let edit = DbEdit::create(&form, &data.db_connection)?;
|
let edit = DbEdit::create(&form, &data.db_connection)?;
|
||||||
let updated_article =
|
let updated_article =
|
||||||
|
@ -32,6 +34,7 @@ pub async fn submit_article_update(
|
||||||
// dont insert edit into db, might be invalid in case of conflict
|
// dont insert edit into db, might be invalid in case of conflict
|
||||||
let edit = DbEdit {
|
let edit = DbEdit {
|
||||||
id: -1,
|
id: -1,
|
||||||
|
creator_id,
|
||||||
hash: form.hash,
|
hash: form.hash,
|
||||||
ap_id: form.ap_id,
|
ap_id: form.ap_id,
|
||||||
diff: form.diff,
|
diff: form.diff,
|
||||||
|
|
|
@ -73,9 +73,11 @@ impl ActivityHandler for RejectEdit {
|
||||||
async fn receive(self, data: &Data<Self::DataType>) -> Result<(), Self::Error> {
|
async fn receive(self, data: &Data<Self::DataType>) -> Result<(), Self::Error> {
|
||||||
// cant convert this to DbEdit as it tries to apply patch and fails
|
// cant convert this to DbEdit as it tries to apply patch and fails
|
||||||
let article = self.object.object.dereference(data).await?;
|
let article = self.object.object.dereference(data).await?;
|
||||||
|
let creator = self.object.attributed_to.dereference(data).await?;
|
||||||
let form = DbConflictForm {
|
let form = DbConflictForm {
|
||||||
id: EditVersion::new(&self.object.content)?,
|
id: EditVersion::new(&self.object.content)?,
|
||||||
diff: self.object.content,
|
diff: self.object.content,
|
||||||
|
creator_id: creator.id,
|
||||||
article_id: article.id,
|
article_id: article.id,
|
||||||
previous_version_id: self.object.previous_version,
|
previous_version_id: self.object.previous_version,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::database::article::DbArticle;
|
use crate::database::article::DbArticle;
|
||||||
use crate::database::edit::{DbEdit, DbEditForm};
|
use crate::database::edit::{DbEdit, DbEditForm};
|
||||||
|
use crate::database::user::DbPerson;
|
||||||
use crate::database::version::EditVersion;
|
use crate::database::version::EditVersion;
|
||||||
use crate::database::MyDataHandle;
|
use crate::database::MyDataHandle;
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
@ -26,6 +27,7 @@ pub struct ApubEdit {
|
||||||
pub version: EditVersion,
|
pub version: EditVersion,
|
||||||
pub previous_version: EditVersion,
|
pub previous_version: EditVersion,
|
||||||
pub object: ObjectId<DbArticle>,
|
pub object: ObjectId<DbArticle>,
|
||||||
|
pub attributed_to: ObjectId<DbPerson>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
|
@ -43,6 +45,7 @@ impl Object for DbEdit {
|
||||||
|
|
||||||
async fn into_json(self, data: &Data<Self::DataType>) -> Result<Self::Kind, Self::Error> {
|
async fn into_json(self, data: &Data<Self::DataType>) -> Result<Self::Kind, Self::Error> {
|
||||||
let article = DbArticle::read(self.article_id, &data.db_connection)?;
|
let article = DbArticle::read(self.article_id, &data.db_connection)?;
|
||||||
|
let creator = DbPerson::read(self.creator_id, data)?;
|
||||||
Ok(ApubEdit {
|
Ok(ApubEdit {
|
||||||
kind: PatchType::Patch,
|
kind: PatchType::Patch,
|
||||||
id: self.ap_id,
|
id: self.ap_id,
|
||||||
|
@ -50,6 +53,7 @@ impl Object for DbEdit {
|
||||||
version: self.hash,
|
version: self.hash,
|
||||||
previous_version: self.previous_version_id,
|
previous_version: self.previous_version_id,
|
||||||
object: article.ap_id,
|
object: article.ap_id,
|
||||||
|
attributed_to: creator.ap_id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +67,9 @@ impl Object for DbEdit {
|
||||||
|
|
||||||
async fn from_json(json: Self::Kind, data: &Data<Self::DataType>) -> Result<Self, Self::Error> {
|
async fn from_json(json: Self::Kind, data: &Data<Self::DataType>) -> Result<Self, Self::Error> {
|
||||||
let article = json.object.dereference(data).await?;
|
let article = json.object.dereference(data).await?;
|
||||||
|
let creator = json.attributed_to.dereference(data).await?;
|
||||||
let form = DbEditForm {
|
let form = DbEditForm {
|
||||||
|
creator_id: creator.id,
|
||||||
ap_id: json.id,
|
ap_id: json.id,
|
||||||
diff: json.content,
|
diff: json.content,
|
||||||
article_id: article.id,
|
article_id: article.id,
|
||||||
|
|
|
@ -3,10 +3,10 @@ use crate::database::MyDataHandle;
|
||||||
use crate::error::{Error, MyResult};
|
use crate::error::{Error, MyResult};
|
||||||
use crate::federation::objects::articles_collection::DbArticleCollection;
|
use crate::federation::objects::articles_collection::DbArticleCollection;
|
||||||
use crate::federation::send_activity;
|
use crate::federation::send_activity;
|
||||||
use activitypub_federation::activity_sending::SendActivityTask;
|
|
||||||
use activitypub_federation::fetch::collection_id::CollectionId;
|
use activitypub_federation::fetch::collection_id::CollectionId;
|
||||||
use activitypub_federation::kinds::actor::ServiceType;
|
use activitypub_federation::kinds::actor::ServiceType;
|
||||||
use activitypub_federation::protocol::context::WithContext;
|
|
||||||
use activitypub_federation::traits::ActivityHandler;
|
use activitypub_federation::traits::ActivityHandler;
|
||||||
use activitypub_federation::{
|
use activitypub_federation::{
|
||||||
config::Data,
|
config::Data,
|
||||||
|
@ -17,7 +17,7 @@ use activitypub_federation::{
|
||||||
use chrono::{DateTime, Local, Utc};
|
use chrono::{DateTime, Local, Utc};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use tracing::log::warn;
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
|
|
@ -150,10 +150,10 @@ impl Object for UserOrInstance {
|
||||||
object_id: Url,
|
object_id: Url,
|
||||||
data: &Data<Self::DataType>,
|
data: &Data<Self::DataType>,
|
||||||
) -> Result<Option<Self>, Error> {
|
) -> Result<Option<Self>, Error> {
|
||||||
let person = DbPerson::read_from_id(object_id.clone(), data).await?;
|
let person = DbPerson::read_from_id(object_id.clone(), data).await;
|
||||||
Ok(match person {
|
Ok(match person {
|
||||||
Some(o) => Some(UserOrInstance::User(o)),
|
Ok(Some(o)) => Some(UserOrInstance::User(o)),
|
||||||
None => DbInstance::read_from_id(object_id, data)
|
_ => DbInstance::read_from_id(object_id.clone(), data)
|
||||||
.await?
|
.await?
|
||||||
.map(UserOrInstance::Instance),
|
.map(UserOrInstance::Instance),
|
||||||
})
|
})
|
||||||
|
|
|
@ -49,6 +49,7 @@ mod test {
|
||||||
let diff = create_patch(a, b).to_string();
|
let diff = create_patch(a, b).to_string();
|
||||||
Ok(DbEdit {
|
Ok(DbEdit {
|
||||||
id: 0,
|
id: 0,
|
||||||
|
creator_id: 0,
|
||||||
hash: EditVersion::new(&diff)?,
|
hash: EditVersion::new(&diff)?,
|
||||||
ap_id: ObjectId::parse("http://example.com")?,
|
ap_id: ObjectId::parse("http://example.com")?,
|
||||||
diff,
|
diff,
|
||||||
|
|
|
@ -163,7 +163,7 @@ pub async fn create_article(instance: &FediwikiInstance, title: String) -> MyRes
|
||||||
previous_version_id: article.latest_version,
|
previous_version_id: article.latest_version,
|
||||||
resolve_conflict_id: None,
|
resolve_conflict_id: None,
|
||||||
};
|
};
|
||||||
edit_article(&instance, &edit_form).await
|
edit_article(instance, &edit_form).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_article(hostname: &str, article_id: i32) -> MyResult<ArticleView> {
|
pub async fn get_article(hostname: &str, article_id: i32) -> MyResult<ArticleView> {
|
||||||
|
|
Loading…
Reference in a new issue