Skip to content

Commit be72c82

Browse files
committed
feat(push): add experimental support for MSC3768 (in-app-only notifications)
Signed-off-by: Johannes Marbach <[email protected]>
1 parent ada68e1 commit be72c82

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ proptest = { version = "1.6.0", default-features = false, features = ["std"] }
5959
rand = "0.8.5"
6060
reqwest = { version = "0.12.12", default-features = false }
6161
rmp-serde = "1.3.0"
62-
ruma = { git = "https://github.com/ruma/ruma", rev = "de19ebaf71af620eb17abaefd92e43153f9d041d", features = [
62+
ruma = { git = "https://github.com/ruma/ruma", rev = "dd7b085424930c34323a60ef360194c27a61459c", features = [
6363
"client-api-c",
6464
"compat-upload-signatures",
6565
"compat-arbitrary-length-ids",
@@ -70,14 +70,15 @@ ruma = { git = "https://github.com/ruma/ruma", rev = "de19ebaf71af620eb17abaefd9
7070
"unstable-msc3401",
7171
"unstable-msc3488",
7272
"unstable-msc3489",
73+
"unstable-msc3768",
7374
"unstable-msc4075",
7475
"unstable-msc4140",
7576
"unstable-msc4143",
7677
"unstable-msc4171",
7778
"unstable-msc4278",
7879
"unstable-msc4286",
7980
] }
80-
ruma-common = { git = "https://github.com/ruma/ruma", rev = "de19ebaf71af620eb17abaefd92e43153f9d041d" }
81+
ruma-common = { git = "https://github.com/ruma/ruma", rev = "dd7b085424930c34323a60ef360194c27a61459c" }
8182
sentry = "0.36.0"
8283
sentry-tracing = "0.36.0"
8384
serde = { version = "1.0.217", features = ["rc"] }

bindings/matrix-sdk-ffi/src/notification_settings.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ impl TryFrom<Tweak> for SdkTweak {
322322
#[derive(Clone, uniffi::Enum)]
323323
/// Enum representing the push notification actions for a rule.
324324
pub enum Action {
325-
/// Causes matching events to generate a notification.
325+
/// Causes matching events to generate a notification (both in-app and remote / push).
326326
Notify,
327+
/// Causes matching events to generate an in-app notification but no remote / push notification.
328+
NotifyInApp,
327329
/// Sets an entry in the 'tweaks' dictionary sent to the push gateway.
328330
SetTweak { value: Tweak },
329331
}
@@ -334,6 +336,7 @@ impl TryFrom<SdkAction> for Action {
334336
fn try_from(value: SdkAction) -> Result<Self, Self::Error> {
335337
Ok(match value {
336338
SdkAction::Notify => Self::Notify,
339+
SdkAction::NotifyInApp => Self::NotifyInApp,
337340
SdkAction::SetTweak(tweak) => Self::SetTweak {
338341
value: tweak.try_into().map_err(|e| format!("Failed to convert tweak: {e}"))?,
339342
},
@@ -348,6 +351,7 @@ impl TryFrom<Action> for SdkAction {
348351
fn try_from(value: Action) -> Result<Self, Self::Error> {
349352
Ok(match value {
350353
Action::Notify => Self::Notify,
354+
Action::NotifyInApp => Self::NotifyInApp,
351355
Action::SetTweak { value } => Self::SetTweak(
352356
value.try_into().map_err(|e| format!("Failed to convert tweak: {e}"))?,
353357
),

0 commit comments

Comments
 (0)