mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-09 10:56:41 +02:00
disable URL previews by default upon admin room creation
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
434b5118cc
commit
d715ab7f5e
2 changed files with 34 additions and 12 deletions
24
Cargo.lock
generated
24
Cargo.lock
generated
|
@ -2723,7 +2723,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma"
|
||||
version = "0.10.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"assign",
|
||||
"js_int",
|
||||
|
@ -2743,7 +2743,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-appservice-api"
|
||||
version = "0.10.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
|
@ -2755,7 +2755,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-client-api"
|
||||
version = "0.18.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"assign",
|
||||
|
@ -2777,7 +2777,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-common"
|
||||
version = "0.13.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"base64 0.22.1",
|
||||
|
@ -2807,7 +2807,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-events"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"indexmap 2.2.6",
|
||||
|
@ -2829,7 +2829,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-federation-api"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
|
@ -2841,7 +2841,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-identifiers-validation"
|
||||
version = "0.9.5"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"thiserror",
|
||||
|
@ -2850,7 +2850,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-identity-service-api"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
|
@ -2860,7 +2860,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-macros"
|
||||
version = "0.13.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"proc-macro-crate",
|
||||
|
@ -2875,7 +2875,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-push-gateway-api"
|
||||
version = "0.9.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
|
@ -2887,7 +2887,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-signatures"
|
||||
version = "0.15.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"ed25519-dalek",
|
||||
|
@ -2903,7 +2903,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "ruma-state-res"
|
||||
version = "0.11.0"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#9e29e07ae1561fa7e6ed1897192f9c43c111b026"
|
||||
source = "git+https://github.com/girlbossceo/ruma?branch=conduwuit-changes#62aca1e976d0c161d5b2c413bde6d0079f75f3ee"
|
||||
dependencies = [
|
||||
"itertools",
|
||||
"js_int",
|
||||
|
|
|
@ -16,6 +16,7 @@ use ruma::{
|
|||
message::{Relation::Reply, RoomMessageEventContent},
|
||||
name::RoomNameEventContent,
|
||||
power_levels::RoomPowerLevelsEventContent,
|
||||
preview_url::RoomPreviewUrlsEventContent,
|
||||
topic::RoomTopicEventContent,
|
||||
},
|
||||
TimelineEventType,
|
||||
|
@ -634,6 +635,27 @@ impl Service {
|
|||
|
||||
services().rooms.alias.set_alias(&alias, &room_id)?;
|
||||
|
||||
// 7. (ad-hoc) Disable room previews for everyone by default
|
||||
services()
|
||||
.rooms
|
||||
.timeline
|
||||
.build_and_append_pdu(
|
||||
PduBuilder {
|
||||
event_type: TimelineEventType::RoomPreviewUrls,
|
||||
content: to_raw_value(&RoomPreviewUrlsEventContent {
|
||||
disabled: true,
|
||||
})
|
||||
.expect("event is valid we just created it"),
|
||||
unsigned: None,
|
||||
state_key: Some(String::new()),
|
||||
redacts: None,
|
||||
},
|
||||
&server_user,
|
||||
&room_id,
|
||||
&state_lock,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue