From e13a7d7e155c19c7fa431742b42dc8a50d829800 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Thu, 12 Nov 2020 11:18:07 +1100 Subject: [PATCH] set PN server request target as "/loki/v2/lsrpc", --- .../Push Notifications/LokiPushNotificationManager.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SignalServiceKit/src/Loki/Push Notifications/LokiPushNotificationManager.swift b/SignalServiceKit/src/Loki/Push Notifications/LokiPushNotificationManager.swift index 253e63be7..2333a7970 100644 --- a/SignalServiceKit/src/Loki/Push Notifications/LokiPushNotificationManager.swift +++ b/SignalServiceKit/src/Loki/Push Notifications/LokiPushNotificationManager.swift @@ -30,7 +30,7 @@ public final class LokiPushNotificationManager : NSObject { let request = TSRequest(url: url, method: "POST", parameters: parameters) request.allHTTPHeaderFields = [ "Content-Type" : "application/json" ] let promise: Promise = attempt(maxRetryCount: maxRetryCount, recoveringOn: DispatchQueue.global()) { - OnionRequestAPI.sendOnionRequest(request, to: server, using: pnServerPublicKey).map2 { response in + OnionRequestAPI.sendOnionRequest(request, to: server, target: "/loki/v2/lsrpc", using: pnServerPublicKey).map2 { response in guard let json = response["body"] as? JSON else { return print("[Loki] Couldn't unregister from push notifications.") } @@ -72,7 +72,7 @@ public final class LokiPushNotificationManager : NSObject { let request = TSRequest(url: url, method: "POST", parameters: parameters) request.allHTTPHeaderFields = [ "Content-Type" : "application/json" ] let promise: Promise = attempt(maxRetryCount: maxRetryCount, recoveringOn: DispatchQueue.global()) { - OnionRequestAPI.sendOnionRequest(request, to: server, using: pnServerPublicKey).map2 { response in + OnionRequestAPI.sendOnionRequest(request, to: server, target: "/loki/v2/lsrpc", using: pnServerPublicKey).map2 { response in guard let json = response["body"] as? JSON else { return print("[Loki] Couldn't register device token.") } @@ -109,7 +109,7 @@ public final class LokiPushNotificationManager : NSObject { let request = TSRequest(url: url, method: "POST", parameters: parameters) request.allHTTPHeaderFields = [ "Content-Type" : "application/json" ] let promise: Promise = attempt(maxRetryCount: maxRetryCount, recoveringOn: DispatchQueue.global()) { - OnionRequestAPI.sendOnionRequest(request, to: server, using: pnServerPublicKey).map2 { response in + OnionRequestAPI.sendOnionRequest(request, to: server, target: "/loki/v2/lsrpc", using: pnServerPublicKey).map2 { response in guard let json = response["body"] as? JSON else { return print("[Loki] Couldn't subscribe/unsubscribe closed group: \(closedGroupPublicKey).") } @@ -131,7 +131,7 @@ public final class LokiPushNotificationManager : NSObject { let request = TSRequest(url: url, method: "POST", parameters: parameters) request.allHTTPHeaderFields = [ "Content-Type" : "application/json" ] let promise: Promise = attempt(maxRetryCount: maxRetryCount, recoveringOn: DispatchQueue.global()) { - OnionRequestAPI.sendOnionRequest(request, to: server, using: pnServerPublicKey).map2 { response in + OnionRequestAPI.sendOnionRequest(request, to: server, target: "/loki/v2/lsrpc", using: pnServerPublicKey).map2 { response in guard let json = response["body"] as? JSON else { return print("[Loki] Couldn't notify PN server.") }