mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add a specific notification body for space invites. (#4808)
This commit is contained in:
@@ -442,6 +442,7 @@
|
|||||||
"notification_room_invite_body_with_sender" = "%1$@ invited you to join the room";
|
"notification_room_invite_body_with_sender" = "%1$@ invited you to join the room";
|
||||||
"notification_sender_me" = "Me";
|
"notification_sender_me" = "Me";
|
||||||
"notification_sender_mention_reply" = "%1$@ mentioned or replied";
|
"notification_sender_mention_reply" = "%1$@ mentioned or replied";
|
||||||
|
"notification_space_invite_body" = "Invited you to join the space";
|
||||||
"notification_test_push_notification_content" = "You are viewing the notification! Click me!";
|
"notification_test_push_notification_content" = "You are viewing the notification! Click me!";
|
||||||
"notification_ticker_text_dm" = "%1$@: %2$@";
|
"notification_ticker_text_dm" = "%1$@: %2$@";
|
||||||
"notification_ticker_text_group" = "%1$@: %2$@ %3$@";
|
"notification_ticker_text_group" = "%1$@: %2$@ %3$@";
|
||||||
|
|||||||
@@ -442,6 +442,7 @@
|
|||||||
"notification_room_invite_body_with_sender" = "%1$@ invited you to join the room";
|
"notification_room_invite_body_with_sender" = "%1$@ invited you to join the room";
|
||||||
"notification_sender_me" = "Me";
|
"notification_sender_me" = "Me";
|
||||||
"notification_sender_mention_reply" = "%1$@ mentioned or replied";
|
"notification_sender_mention_reply" = "%1$@ mentioned or replied";
|
||||||
|
"notification_space_invite_body" = "Invited you to join the space";
|
||||||
"notification_test_push_notification_content" = "You are viewing the notification! Click me!";
|
"notification_test_push_notification_content" = "You are viewing the notification! Click me!";
|
||||||
"notification_ticker_text_dm" = "%1$@: %2$@";
|
"notification_ticker_text_dm" = "%1$@: %2$@";
|
||||||
"notification_ticker_text_group" = "%1$@: %2$@ %3$@";
|
"notification_ticker_text_group" = "%1$@: %2$@ %3$@";
|
||||||
|
|||||||
@@ -1034,6 +1034,8 @@ internal enum L10n {
|
|||||||
internal static func notificationSenderMentionReply(_ p1: Any) -> String {
|
internal static func notificationSenderMentionReply(_ p1: Any) -> String {
|
||||||
return L10n.tr("Localizable", "notification_sender_mention_reply", String(describing: p1))
|
return L10n.tr("Localizable", "notification_sender_mention_reply", String(describing: p1))
|
||||||
}
|
}
|
||||||
|
/// Invited you to join the space
|
||||||
|
internal static var notificationSpaceInviteBody: String { return L10n.tr("Localizable", "notification_space_invite_body") }
|
||||||
/// You are viewing the notification! Click me!
|
/// You are viewing the notification! Click me!
|
||||||
internal static var notificationTestPushNotificationContent: String { return L10n.tr("Localizable", "notification_test_push_notification_content") }
|
internal static var notificationTestPushNotificationContent: String { return L10n.tr("Localizable", "notification_test_push_notification_content") }
|
||||||
/// Thread in %1$@
|
/// Thread in %1$@
|
||||||
|
|||||||
@@ -11776,6 +11776,11 @@ class NotificationItemProxyMock: NotificationItemProxyProtocol, @unchecked Senda
|
|||||||
set(value) { underlyingRoomJoinedMembers = value }
|
set(value) { underlyingRoomJoinedMembers = value }
|
||||||
}
|
}
|
||||||
var underlyingRoomJoinedMembers: Int!
|
var underlyingRoomJoinedMembers: Int!
|
||||||
|
var isRoomSpace: Bool {
|
||||||
|
get { return underlyingIsRoomSpace }
|
||||||
|
set(value) { underlyingIsRoomSpace = value }
|
||||||
|
}
|
||||||
|
var underlyingIsRoomSpace: Bool!
|
||||||
var isRoomDirect: Bool {
|
var isRoomDirect: Bool {
|
||||||
get { return underlyingIsRoomDirect }
|
get { return underlyingIsRoomDirect }
|
||||||
set(value) { underlyingIsRoomDirect = value }
|
set(value) { underlyingIsRoomDirect = value }
|
||||||
|
|||||||
@@ -99,15 +99,14 @@ struct NotificationContentBuilder {
|
|||||||
notificationItem: NotificationItemProxyProtocol,
|
notificationItem: NotificationItemProxyProtocol,
|
||||||
mediaProvider: MediaProviderProtocol) async {
|
mediaProvider: MediaProviderProtocol) async {
|
||||||
notificationContent.categoryIdentifier = NotificationConstants.Category.invite
|
notificationContent.categoryIdentifier = NotificationConstants.Category.invite
|
||||||
|
|
||||||
let body: String
|
|
||||||
if !notificationItem.isDM {
|
|
||||||
body = L10n.notificationRoomInviteBody
|
|
||||||
} else {
|
|
||||||
body = L10n.notificationInviteBody
|
|
||||||
}
|
|
||||||
|
|
||||||
notificationContent.body = body
|
notificationContent.body = if notificationItem.isDM {
|
||||||
|
L10n.notificationInviteBody
|
||||||
|
} else if notificationItem.isRoomSpace {
|
||||||
|
L10n.notificationSpaceInviteBody
|
||||||
|
} else {
|
||||||
|
L10n.notificationRoomInviteBody
|
||||||
|
}
|
||||||
|
|
||||||
let name = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName
|
let name = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName
|
||||||
await addCommunicationContext(notificationContent: ¬ificationContent,
|
await addCommunicationContext(notificationContent: ¬ificationContent,
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ struct NotificationItemProxy: NotificationItemProxyProtocol {
|
|||||||
var roomDisplayName: String {
|
var roomDisplayName: String {
|
||||||
notificationItem.roomInfo.displayName
|
notificationItem.roomInfo.displayName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isRoomSpace: Bool {
|
||||||
|
notificationItem.roomInfo.isSpace
|
||||||
|
}
|
||||||
|
|
||||||
var isRoomDirect: Bool {
|
var isRoomDirect: Bool {
|
||||||
notificationItem.roomInfo.isDirect
|
notificationItem.roomInfo.isDirect
|
||||||
@@ -102,6 +106,8 @@ struct EmptyNotificationItemProxy: NotificationItemProxyProtocol {
|
|||||||
|
|
||||||
var isNoisy: Bool { false }
|
var isNoisy: Bool { false }
|
||||||
|
|
||||||
|
var isRoomSpace: Bool { false }
|
||||||
|
|
||||||
var isRoomDirect: Bool { false }
|
var isRoomDirect: Bool { false }
|
||||||
|
|
||||||
var isRoomPrivate: Bool { false }
|
var isRoomPrivate: Bool { false }
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ protocol NotificationItemProxyProtocol {
|
|||||||
var roomAvatarMediaSource: MediaSourceProxy? { get }
|
var roomAvatarMediaSource: MediaSourceProxy? { get }
|
||||||
|
|
||||||
var roomJoinedMembers: Int { get }
|
var roomJoinedMembers: Int { get }
|
||||||
|
|
||||||
|
var isRoomSpace: Bool { get }
|
||||||
|
|
||||||
var isRoomDirect: Bool { get }
|
var isRoomDirect: Bool { get }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user