Merge remote-tracking branch 'upstream/dev' into feature/groups-rebuild

pull/894/head
Morgan Pretty 9 months ago
commit ba3acaa2da

@ -509,17 +509,11 @@ public enum PushNotificationAPI {
return (nil, notification.info, .successTooLong) return (nil, notification.info, .successTooLong)
} }
// Only show notifcations for messages from default namespace // Check that the body we were given is valid and not empty
// TODO: Add group messages namespace
guard notification.info.namespace == .default else {
SNLog("Ignoring notification due to namespace being \(notification.info.namespace) instead of default")
return (nil, notification.info, .failureNoContent)
}
// Check that the body we were given is valid
guard guard
let notificationData: Data = notification.data, let notificationData: Data = notification.data,
notification.info.dataLength == notificationData.count notification.info.dataLength == notificationData.count,
!notificationData.isEmpty
else { else {
SNLog("Get notification data failed") SNLog("Get notification data failed")
return (nil, notification.info, .failureNoContent) return (nil, notification.info, .failureNoContent)

Loading…
Cancel
Save