mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
Add a specific notification body for space invites. (#4808)
This commit is contained in:
@@ -99,15 +99,14 @@ struct NotificationContentBuilder {
|
||||
notificationItem: NotificationItemProxyProtocol,
|
||||
mediaProvider: MediaProviderProtocol) async {
|
||||
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
|
||||
await addCommunicationContext(notificationContent: ¬ificationContent,
|
||||
|
||||
@@ -36,6 +36,10 @@ struct NotificationItemProxy: NotificationItemProxyProtocol {
|
||||
var roomDisplayName: String {
|
||||
notificationItem.roomInfo.displayName
|
||||
}
|
||||
|
||||
var isRoomSpace: Bool {
|
||||
notificationItem.roomInfo.isSpace
|
||||
}
|
||||
|
||||
var isRoomDirect: Bool {
|
||||
notificationItem.roomInfo.isDirect
|
||||
@@ -102,6 +106,8 @@ struct EmptyNotificationItemProxy: NotificationItemProxyProtocol {
|
||||
|
||||
var isNoisy: Bool { false }
|
||||
|
||||
var isRoomSpace: Bool { false }
|
||||
|
||||
var isRoomDirect: Bool { false }
|
||||
|
||||
var isRoomPrivate: Bool { false }
|
||||
|
||||
@@ -29,6 +29,8 @@ protocol NotificationItemProxyProtocol {
|
||||
var roomAvatarMediaSource: MediaSourceProxy? { get }
|
||||
|
||||
var roomJoinedMembers: Int { get }
|
||||
|
||||
var isRoomSpace: Bool { get }
|
||||
|
||||
var isRoomDirect: Bool { get }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user