mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
* Fixes #2360 - Add support for manually marking rooms as unread * Add analytics for marking rooms as (un)read * Remove unnecessary analytics abstraction levels * Fix breaking API changes following SDK bump * Add changelog * Handle PR comments * Fix unit tests
This commit is contained in:
@@ -1847,11 +1847,6 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
}
|
||||
var underlyingHasOngoingCall: Bool!
|
||||
var canonicalAlias: String?
|
||||
var hasUnreadNotifications: Bool {
|
||||
get { return underlyingHasUnreadNotifications }
|
||||
set(value) { underlyingHasUnreadNotifications = value }
|
||||
}
|
||||
var underlyingHasUnreadNotifications: Bool!
|
||||
var ownUserID: String {
|
||||
get { return underlyingOwnUserID }
|
||||
set(value) { underlyingOwnUserID = value }
|
||||
@@ -2222,6 +2217,44 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
return canUserTriggerRoomNotificationUserIDReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - markAsUnread
|
||||
|
||||
var markAsUnreadCallsCount = 0
|
||||
var markAsUnreadCalled: Bool {
|
||||
return markAsUnreadCallsCount > 0
|
||||
}
|
||||
var markAsUnreadReturnValue: Result<Void, RoomProxyError>!
|
||||
var markAsUnreadClosure: (() async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func markAsUnread() async -> Result<Void, RoomProxyError> {
|
||||
markAsUnreadCallsCount += 1
|
||||
if let markAsUnreadClosure = markAsUnreadClosure {
|
||||
return await markAsUnreadClosure()
|
||||
} else {
|
||||
return markAsUnreadReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - markAsRead
|
||||
|
||||
var markAsReadSendReadReceiptsReceiptTypeCallsCount = 0
|
||||
var markAsReadSendReadReceiptsReceiptTypeCalled: Bool {
|
||||
return markAsReadSendReadReceiptsReceiptTypeCallsCount > 0
|
||||
}
|
||||
var markAsReadSendReadReceiptsReceiptTypeReceivedArguments: (sendReadReceipts: Bool, receiptType: ReceiptType)?
|
||||
var markAsReadSendReadReceiptsReceiptTypeReceivedInvocations: [(sendReadReceipts: Bool, receiptType: ReceiptType)] = []
|
||||
var markAsReadSendReadReceiptsReceiptTypeReturnValue: Result<Void, RoomProxyError>!
|
||||
var markAsReadSendReadReceiptsReceiptTypeClosure: ((Bool, ReceiptType) async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func markAsRead(sendReadReceipts: Bool, receiptType: ReceiptType) async -> Result<Void, RoomProxyError> {
|
||||
markAsReadSendReadReceiptsReceiptTypeCallsCount += 1
|
||||
markAsReadSendReadReceiptsReceiptTypeReceivedArguments = (sendReadReceipts: sendReadReceipts, receiptType: receiptType)
|
||||
markAsReadSendReadReceiptsReceiptTypeReceivedInvocations.append((sendReadReceipts: sendReadReceipts, receiptType: receiptType))
|
||||
if let markAsReadSendReadReceiptsReceiptTypeClosure = markAsReadSendReadReceiptsReceiptTypeClosure {
|
||||
return await markAsReadSendReadReceiptsReceiptTypeClosure(sendReadReceipts, receiptType)
|
||||
} else {
|
||||
return markAsReadSendReadReceiptsReceiptTypeReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - canUserJoinCall
|
||||
|
||||
var canUserJoinCallUserIDCallsCount = 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated using Sourcery 2.1.2 — https://github.com/krzysztofzablocki/Sourcery
|
||||
// Generated using Sourcery 2.1.3 — https://github.com/krzysztofzablocki/Sourcery
|
||||
// DO NOT EDIT
|
||||
|
||||
// swiftlint:disable all
|
||||
|
||||
@@ -29,7 +29,6 @@ struct RoomProxyMockConfiguration {
|
||||
var isEncrypted = true
|
||||
var hasOngoingCall = true
|
||||
var canonicalAlias: String?
|
||||
var hasUnreadNotifications = Bool.random()
|
||||
|
||||
var timeline = {
|
||||
let mock = TimelineProxyMock()
|
||||
@@ -64,7 +63,6 @@ extension RoomProxyMock {
|
||||
isEncrypted = configuration.isEncrypted
|
||||
hasOngoingCall = configuration.hasOngoingCall
|
||||
canonicalAlias = configuration.canonicalAlias
|
||||
hasUnreadNotifications = configuration.hasUnreadNotifications
|
||||
|
||||
timeline = configuration.timeline
|
||||
|
||||
|
||||
Reference in New Issue
Block a user