Skip to content

Commit b480695

Browse files
committed
review: use correct ID instead of Id naming convention
1 parent 19004bb commit b480695

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
lines changed

ElementX/Sources/Mocks/Generated/GeneratedMocks.swift

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8999,72 +8999,72 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable {
89998999
}
90009000
//MARK: - declineCall
90019001

9002-
var declineCallNotificationIdUnderlyingCallsCount = 0
9003-
var declineCallNotificationIdCallsCount: Int {
9002+
var declineCallNotificationIDUnderlyingCallsCount = 0
9003+
var declineCallNotificationIDCallsCount: Int {
90049004
get {
90059005
if Thread.isMainThread {
9006-
return declineCallNotificationIdUnderlyingCallsCount
9006+
return declineCallNotificationIDUnderlyingCallsCount
90079007
} else {
90089008
var returnValue: Int? = nil
90099009
DispatchQueue.main.sync {
9010-
returnValue = declineCallNotificationIdUnderlyingCallsCount
9010+
returnValue = declineCallNotificationIDUnderlyingCallsCount
90119011
}
90129012

90139013
return returnValue!
90149014
}
90159015
}
90169016
set {
90179017
if Thread.isMainThread {
9018-
declineCallNotificationIdUnderlyingCallsCount = newValue
9018+
declineCallNotificationIDUnderlyingCallsCount = newValue
90199019
} else {
90209020
DispatchQueue.main.sync {
9021-
declineCallNotificationIdUnderlyingCallsCount = newValue
9021+
declineCallNotificationIDUnderlyingCallsCount = newValue
90229022
}
90239023
}
90249024
}
90259025
}
9026-
var declineCallNotificationIdCalled: Bool {
9027-
return declineCallNotificationIdCallsCount > 0
9026+
var declineCallNotificationIDCalled: Bool {
9027+
return declineCallNotificationIDCallsCount > 0
90289028
}
9029-
var declineCallNotificationIdReceivedNotificationId: String?
9030-
var declineCallNotificationIdReceivedInvocations: [String] = []
9029+
var declineCallNotificationIDReceivedNotificationID: String?
9030+
var declineCallNotificationIDReceivedInvocations: [String] = []
90319031

9032-
var declineCallNotificationIdUnderlyingReturnValue: Result<Void, RoomProxyError>!
9033-
var declineCallNotificationIdReturnValue: Result<Void, RoomProxyError>! {
9032+
var declineCallNotificationIDUnderlyingReturnValue: Result<Void, RoomProxyError>!
9033+
var declineCallNotificationIDReturnValue: Result<Void, RoomProxyError>! {
90349034
get {
90359035
if Thread.isMainThread {
9036-
return declineCallNotificationIdUnderlyingReturnValue
9036+
return declineCallNotificationIDUnderlyingReturnValue
90379037
} else {
90389038
var returnValue: Result<Void, RoomProxyError>? = nil
90399039
DispatchQueue.main.sync {
9040-
returnValue = declineCallNotificationIdUnderlyingReturnValue
9040+
returnValue = declineCallNotificationIDUnderlyingReturnValue
90419041
}
90429042

90439043
return returnValue!
90449044
}
90459045
}
90469046
set {
90479047
if Thread.isMainThread {
9048-
declineCallNotificationIdUnderlyingReturnValue = newValue
9048+
declineCallNotificationIDUnderlyingReturnValue = newValue
90499049
} else {
90509050
DispatchQueue.main.sync {
9051-
declineCallNotificationIdUnderlyingReturnValue = newValue
9051+
declineCallNotificationIDUnderlyingReturnValue = newValue
90529052
}
90539053
}
90549054
}
90559055
}
9056-
var declineCallNotificationIdClosure: ((String) async -> Result<Void, RoomProxyError>)?
9056+
var declineCallNotificationIDClosure: ((String) async -> Result<Void, RoomProxyError>)?
90579057

9058-
func declineCall(notificationId: String) async -> Result<Void, RoomProxyError> {
9059-
declineCallNotificationIdCallsCount += 1
9060-
declineCallNotificationIdReceivedNotificationId = notificationId
9058+
func declineCall(notificationID: String) async -> Result<Void, RoomProxyError> {
9059+
declineCallNotificationIDCallsCount += 1
9060+
declineCallNotificationIDReceivedNotificationID = notificationID
90619061
DispatchQueue.main.async {
9062-
self.declineCallNotificationIdReceivedInvocations.append(notificationId)
9062+
self.declineCallNotificationIDReceivedInvocations.append(notificationID)
90639063
}
9064-
if let declineCallNotificationIdClosure = declineCallNotificationIdClosure {
9065-
return await declineCallNotificationIdClosure(notificationId)
9064+
if let declineCallNotificationIDClosure = declineCallNotificationIDClosure {
9065+
return await declineCallNotificationIDClosure(notificationID)
90669066
} else {
9067-
return declineCallNotificationIdReturnValue
9067+
return declineCallNotificationIDReturnValue
90689068
}
90699069
}
90709070
//MARK: - matrixToPermalink

ElementX/Sources/Services/ElementCall/ElementCallService.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
1616
private struct CallID: Equatable {
1717
let callKitID: UUID
1818
let roomID: String
19-
let rtcNotificationId: String?
19+
let rtcNotificationID: String?
2020
}
2121

2222
private let pushRegistry: PKPushRegistry
@@ -94,7 +94,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
9494
let callID = if let incomingCallID, incomingCallID.roomID == roomID {
9595
incomingCallID
9696
} else {
97-
CallID(callKitID: UUID(), roomID: roomID, rtcNotificationId: nil)
97+
CallID(callKitID: UUID(), roomID: roomID, rtcNotificationID: nil)
9898
}
9999

100100
incomingCallID = nil
@@ -147,7 +147,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
147147
return
148148
}
149149

150-
guard let rtcNotificationId = payload.dictionaryPayload[ElementCallServiceNotificationKey.rtcNotifyEventId.rawValue] as? String else {
150+
guard let rtcNotificationID = payload.dictionaryPayload[ElementCallServiceNotificationKey.rtcNotifyEventID.rawValue] as? String else {
151151
MXLog.error("Something went wrong, missing rtc notification event identifier for incoming voip call: \(payload)")
152152
return
153153
}
@@ -157,7 +157,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
157157
return
158158
}
159159

160-
let callID = CallID(callKitID: UUID(), roomID: roomID, rtcNotificationId: rtcNotificationId)
160+
let callID = CallID(callKitID: UUID(), roomID: roomID, rtcNotificationID: rtcNotificationID)
161161
incomingCallID = callID
162162

163163
let roomDisplayName = payload.dictionaryPayload[ElementCallServiceNotificationKey.roomDisplayName.rawValue] as? String
@@ -287,7 +287,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
287287
}
288288

289289
private func sendDeclineCallEvent(_ incomingCallID: CallID) async {
290-
guard let rtcNotificationId = incomingCallID.rtcNotificationId else {
290+
guard let rtcNotificationID = incomingCallID.rtcNotificationID else {
291291
MXLog.info("No rtc notification event to decline.")
292292
return
293293
}
@@ -302,7 +302,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
302302
return
303303
}
304304

305-
_ = await roomProxy.declineCall(notificationId: rtcNotificationId)
305+
_ = await roomProxy.declineCall(notificationID: rtcNotificationID)
306306
}
307307

308308
private func observeIncomingCallRoomInfo() async {

ElementX/Sources/Services/ElementCall/ElementCallServiceConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum ElementCallServiceNotificationKey: String {
1212
case roomDisplayName
1313
/// When an incoming call is set to ring, there will be a `m.rtc.notification`event (MSC4075).
1414
/// Keep the notification event id as it is needed to decline calls (MSC4310).
15-
case rtcNotifyEventId
15+
case rtcNotifyEventID
1616
}
1717

1818
let ElementCallServiceNotificationDiscardDelta = 15.0

ElementX/Sources/Services/Room/JoinedRoomProxy.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,12 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
639639
ElementCallWidgetDriver(room: room, deviceID: deviceID)
640640
}
641641

642-
func declineCall(notificationId: String) async -> Result<Void, RoomProxyError> {
642+
func declineCall(notificationID: String) async -> Result<Void, RoomProxyError> {
643643
do {
644-
try await room.declineCall(rtcNotificationEventId: notificationId)
644+
try await room.declineCall(rtcNotificationEventId: notificationID)
645645
return .success(())
646646
} catch {
647-
MXLog.error("Failed to decline rtc notification \(notificationId) with error: \(error)")
647+
MXLog.error("Failed to decline rtc notification \(notificationID) with error: \(error)")
648648
return .failure(.sdkError(error))
649649
}
650650
}

ElementX/Sources/Services/Room/RoomProxyProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ protocol JoinedRoomProxyProtocol: RoomProxyProtocol {
169169
// MARK: - Element Call
170170

171171
func elementCallWidgetDriver(deviceID: String) -> ElementCallWidgetDriverProtocol
172-
func declineCall(notificationId: String) async -> Result<Void, RoomProxyError>
172+
func declineCall(notificationID: String) async -> Result<Void, RoomProxyError>
173173

174174
// MARK: - Permalinks
175175

NSE/Sources/NotificationHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class NotificationHandler {
126126
return .processedShouldDiscard
127127
case .callNotify(let notifyType):
128128
return await handleCallNotification(notifyType: notifyType,
129-
rtcNotifyEventId: event.eventId(),
129+
rtcNotifyEventID: event.eventId(),
130130
timestamp: event.timestamp(),
131131
roomID: itemProxy.roomID,
132132
roomDisplayName: itemProxy.roomDisplayName)
@@ -154,7 +154,7 @@ class NotificationHandler {
154154
/// Handle incoming call notifications.
155155
/// - Returns: A boolean indicating whether the notification was handled and should now be discarded.
156156
private func handleCallNotification(notifyType: NotifyType,
157-
rtcNotifyEventId: String,
157+
rtcNotifyEventID: String,
158158
timestamp: Timestamp,
159159
roomID: String,
160160
roomDisplayName: String) async -> NotificationProcessingResult {
@@ -209,7 +209,7 @@ class NotificationHandler {
209209

210210
let payload = [ElementCallServiceNotificationKey.roomID.rawValue: roomID,
211211
ElementCallServiceNotificationKey.roomDisplayName.rawValue: roomDisplayName,
212-
ElementCallServiceNotificationKey.rtcNotifyEventId.rawValue: rtcNotifyEventId]
212+
ElementCallServiceNotificationKey.rtcNotifyEventID.rawValue: rtcNotifyEventID]
213213

214214
do {
215215
try await CXProvider.reportNewIncomingVoIPPushPayload(payload)

0 commit comments

Comments
 (0)