@@ -322,8 +322,13 @@ impl TryFrom<Tweak> for SdkTweak {
322
322
#[ derive( Clone , uniffi:: Enum ) ]
323
323
/// Enum representing the push notification actions for a rule.
324
324
pub enum Action {
325
- /// Causes matching events to generate a notification.
325
+ /// Causes matching events to generate a notification (both in-app and
326
+ /// remote / push).
326
327
Notify ,
328
+ /// Causes matching events to generate an in-app notification but no remote
329
+ /// / push notification.
330
+ #[ cfg( feature = "unstable-msc3768" ) ]
331
+ NotifyInApp ,
327
332
/// Sets an entry in the 'tweaks' dictionary sent to the push gateway.
328
333
SetTweak { value : Tweak } ,
329
334
}
@@ -334,6 +339,8 @@ impl TryFrom<SdkAction> for Action {
334
339
fn try_from ( value : SdkAction ) -> Result < Self , Self :: Error > {
335
340
Ok ( match value {
336
341
SdkAction :: Notify => Self :: Notify ,
342
+ #[ cfg( feature = "unstable-msc3768" ) ]
343
+ SdkAction :: NotifyInApp => Self :: NotifyInApp ,
337
344
SdkAction :: SetTweak ( tweak) => Self :: SetTweak {
338
345
value : tweak. try_into ( ) . map_err ( |e| format ! ( "Failed to convert tweak: {e}" ) ) ?,
339
346
} ,
@@ -348,6 +355,8 @@ impl TryFrom<Action> for SdkAction {
348
355
fn try_from ( value : Action ) -> Result < Self , Self :: Error > {
349
356
Ok ( match value {
350
357
Action :: Notify => Self :: Notify ,
358
+ #[ cfg( feature = "unstable-msc3768" ) ]
359
+ Action :: NotifyInApp => Self :: NotifyInApp ,
351
360
Action :: SetTweak { value } => Self :: SetTweak (
352
361
value. try_into ( ) . map_err ( |e| format ! ( "Failed to convert tweak: {e}" ) ) ?,
353
362
) ,
@@ -358,10 +367,14 @@ impl TryFrom<Action> for SdkAction {
358
367
/// Enum representing the push notification modes for a room.
359
368
#[ derive( Clone , uniffi:: Enum ) ]
360
369
pub enum RoomNotificationMode {
361
- /// Receive notifications for all messages.
370
+ /// Receive remote and in-app notifications for all messages.
362
371
AllMessages ,
363
- /// Receive notifications for mentions and keywords only.
372
+ /// Receive remote and in-app notifications for mentions and keywords only.
364
373
MentionsAndKeywordsOnly ,
374
+ /// Receive remote and in-app notifications for mentions and keywords and
375
+ /// in-app notifications only for other room messages.
376
+ #[ cfg( feature = "unstable-msc3768" ) ]
377
+ MentionsAndKeywordsOnlyTheRestInApp ,
365
378
/// Do not receive any notifications.
366
379
Mute ,
367
380
}
@@ -371,6 +384,10 @@ impl From<SdkRoomNotificationMode> for RoomNotificationMode {
371
384
match value {
372
385
SdkRoomNotificationMode :: AllMessages => Self :: AllMessages ,
373
386
SdkRoomNotificationMode :: MentionsAndKeywordsOnly => Self :: MentionsAndKeywordsOnly ,
387
+ #[ cfg( feature = "unstable-msc3768" ) ]
388
+ SdkRoomNotificationMode :: MentionsAndKeywordsOnlyTheRestInApp => {
389
+ Self :: MentionsAndKeywordsOnlyTheRestInApp
390
+ }
374
391
SdkRoomNotificationMode :: Mute => Self :: Mute ,
375
392
}
376
393
}
@@ -381,6 +398,10 @@ impl From<RoomNotificationMode> for SdkRoomNotificationMode {
381
398
match value {
382
399
RoomNotificationMode :: AllMessages => Self :: AllMessages ,
383
400
RoomNotificationMode :: MentionsAndKeywordsOnly => Self :: MentionsAndKeywordsOnly ,
401
+ #[ cfg( feature = "unstable-msc3768" ) ]
402
+ RoomNotificationMode :: MentionsAndKeywordsOnlyTheRestInApp => {
403
+ Self :: MentionsAndKeywordsOnlyTheRestInApp
404
+ }
384
405
RoomNotificationMode :: Mute => Self :: Mute ,
385
406
}
386
407
}
0 commit comments