mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-01 21:07:34 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fd875e7fc |
No files matched your search
Generated
+9
-9
@@ -1026,7 +1026,7 @@ dependencies = [
|
||||
"serde-saphyr",
|
||||
"serde_json",
|
||||
"serde_regex",
|
||||
"sha2 0.11.2",
|
||||
"sha2 0.11.3",
|
||||
"smallstr",
|
||||
"smallvec",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1152,7 +1152,7 @@ dependencies = [
|
||||
"serde-saphyr",
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"sha2 0.11.2",
|
||||
"sha2 0.11.3",
|
||||
"termimad",
|
||||
"tokio",
|
||||
"tracing",
|
||||
@@ -1866,7 +1866,7 @@ dependencies = [
|
||||
"curve25519-dalek",
|
||||
"ed25519",
|
||||
"serde",
|
||||
"sha2 0.11.2",
|
||||
"sha2 0.11.3",
|
||||
"signature 3.0.0",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
@@ -4182,7 +4182,7 @@ dependencies = [
|
||||
"elliptic-curve 0.14.3",
|
||||
"primefield",
|
||||
"primeorder 0.14.0",
|
||||
"sha2 0.11.2",
|
||||
"sha2 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4196,7 +4196,7 @@ dependencies = [
|
||||
"fiat-crypto",
|
||||
"primefield",
|
||||
"primeorder 0.14.0",
|
||||
"sha2 0.11.2",
|
||||
"sha2 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5226,7 +5226,7 @@ dependencies = [
|
||||
"ruma-common",
|
||||
"ruma-events",
|
||||
"serde_json",
|
||||
"sha2 0.11.2",
|
||||
"sha2 0.11.3",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
@@ -5909,9 +5909,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.11.2"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b0e5c7d67bc53f435386b2130fdc900488c5703770f6d8a4633060e34288a27"
|
||||
checksum = "820083d430c52864bf834423fc988cbcf61685d6f9d22a765a64e3f6cfe3521c"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures 0.3.1",
|
||||
@@ -7120,7 +7120,7 @@ dependencies = [
|
||||
"hkdf 0.13.0",
|
||||
"http",
|
||||
"p256 0.13.2",
|
||||
"sha2 0.11.2",
|
||||
"sha2 0.11.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -398,7 +398,6 @@ features = [
|
||||
"unstable-msc4484",
|
||||
"unstable-msc4540",
|
||||
"unstable-msc4560",
|
||||
"unstable-msc4563",
|
||||
"unstable-extensible-events",
|
||||
]
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Added server-side support for [MSC4563: direct_message push rule](https://github.com/matrix-org/matrix-spec-proposals/pull/4563). Contributed by @nex.
|
||||
@@ -2808,18 +2808,6 @@
|
||||
# env: CONTINUWUITY_EXPERIMENTS__MSC4560
|
||||
#msc4560 = false
|
||||
|
||||
# MSC4563: `direct_message` push rule
|
||||
#
|
||||
# Creates a new kind of push rule that creates a notification if a message
|
||||
# is received in a room that is in the user's direct message list. This
|
||||
# more accurately identifies direct messages, rather than relying on a "DM
|
||||
# room" only consisting of two members.
|
||||
#
|
||||
# https://github.com/matrix-org/matrix-spec-proposals/pull/4563
|
||||
#
|
||||
# env: CONTINUWUITY_EXPERIMENTS__MSC4563
|
||||
#msc4563 = false
|
||||
|
||||
#[global.experiments.msc2815]
|
||||
# MSC2815: Proposal to allow room moderators to view redacted event content
|
||||
#
|
||||
|
||||
@@ -146,19 +146,6 @@ pub struct Experiments {
|
||||
/// default: false
|
||||
#[serde(default)]
|
||||
pub msc4560: SimpleExperiment,
|
||||
|
||||
/// MSC4563: `direct_message` push rule
|
||||
///
|
||||
/// Creates a new kind of push rule that creates a notification if a message
|
||||
/// is received in a room that is in the user's direct message list. This
|
||||
/// more accurately identifies direct messages, rather than relying on a "DM
|
||||
/// room" only consisting of two members.
|
||||
///
|
||||
/// https://github.com/matrix-org/matrix-spec-proposals/pull/4563
|
||||
///
|
||||
/// default: false
|
||||
#[serde(default)]
|
||||
pub msc4563: SimpleExperiment,
|
||||
}
|
||||
|
||||
/// Represents a "simple" experiment, which is either disabled or enabled.
|
||||
|
||||
@@ -2,7 +2,6 @@ mod webpush;
|
||||
|
||||
use std::{fmt::Debug, mem, net::IpAddr, sync::Arc};
|
||||
|
||||
use assign::assign;
|
||||
use bytes::BytesMut;
|
||||
use conduwuit::{config::experiments::ToggledExperiment, utils::response::LimitReadExt};
|
||||
use conduwuit_core::{
|
||||
@@ -24,10 +23,7 @@ use ruma::{
|
||||
v1::{Device, Notification, NotificationCounts, NotificationPriority},
|
||||
},
|
||||
},
|
||||
events::{
|
||||
AnySyncTimelineEvent, GlobalAccountDataEvent, GlobalAccountDataEventType,
|
||||
TimelineEventType, direct::DirectEventContent, room::power_levels::RoomPowerLevels,
|
||||
},
|
||||
events::{AnySyncTimelineEvent, TimelineEventType, room::power_levels::RoomPowerLevels},
|
||||
push::{
|
||||
Action, HighlightTweakValue, PushConditionPowerLevelsCtx, PushConditionRoomCtx,
|
||||
PushFormat, Ruleset, Tweak,
|
||||
@@ -40,7 +36,7 @@ use url::Host;
|
||||
|
||||
pub use self::webpush::ActivationOutcome;
|
||||
use self::webpush::Vapid;
|
||||
use crate::{Dep, account_data, client, config, globals, rooms, sending, users};
|
||||
use crate::{Dep, client, config, globals, rooms, sending, users};
|
||||
|
||||
const PUSH_GATEWAY_SCHEMES: &[&str] = &["http", "https"];
|
||||
const WEBPUSH_SCHEMES: &[&str] = &["https"];
|
||||
@@ -61,7 +57,6 @@ pub struct Service {
|
||||
struct Services {
|
||||
server: Arc<Server>,
|
||||
globals: Dep<globals::Service>,
|
||||
account_data: Dep<account_data::Service>,
|
||||
config: Dep<config::Service>,
|
||||
client: Dep<client::Service>,
|
||||
state_accessor: Dep<rooms::state_accessor::Service>,
|
||||
@@ -91,7 +86,6 @@ impl crate::Service for Service {
|
||||
services: Services {
|
||||
server: args.server.clone(),
|
||||
globals: args.depend::<globals::Service>("globals"),
|
||||
account_data: args.depend::<account_data::Service>("account_data"),
|
||||
client: args.depend::<client::Service>("client"),
|
||||
config: args.depend::<config::Service>("config"),
|
||||
state_accessor: args
|
||||
@@ -494,34 +488,11 @@ impl Service {
|
||||
.await
|
||||
.unwrap_or_else(|_| user.localpart().to_owned());
|
||||
|
||||
let is_direct = self.services.config.experiments.msc4563.is_enabled()
|
||||
&& self
|
||||
.services
|
||||
.account_data
|
||||
.get_global::<GlobalAccountDataEvent<DirectEventContent>>(
|
||||
user,
|
||||
GlobalAccountDataEventType::Direct,
|
||||
)
|
||||
.await
|
||||
.ok()
|
||||
.and_then(|direct| {
|
||||
direct
|
||||
.content
|
||||
.values()
|
||||
.flatten()
|
||||
.any(|dm_room_id| dm_room_id == room_id)
|
||||
.then_some(())
|
||||
})
|
||||
.is_some();
|
||||
|
||||
assign!(
|
||||
PushConditionRoomCtx::new(
|
||||
room_id.to_owned(),
|
||||
room_joined_count,
|
||||
user.to_owned(),
|
||||
user_display_name,
|
||||
),
|
||||
{ is_direct }
|
||||
PushConditionRoomCtx::new(
|
||||
room_id.to_owned(),
|
||||
room_joined_count,
|
||||
user.to_owned(),
|
||||
user_display_name,
|
||||
)
|
||||
.with_power_levels(power_levels)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user