Create JSON type

pull/9/head
Niels Andriesse 7 years ago
parent 72cc345734
commit a3c92d98c0

@ -0,0 +1,2 @@
public typealias JSON = [String:String]

@ -42,7 +42,7 @@ public struct LokiMessage {
} }
} }
public func toJSON() -> [String:String] { public func toJSON() -> JSON {
var result = [ "destination" : destination, "data" : data.description, "ttl" : String(ttl) ] var result = [ "destination" : destination, "data" : data.description, "ttl" : String(ttl) ]
if let timestamp = timestamp, let nonce = nonce { if let timestamp = timestamp, let nonce = nonce {
result["timestamp"] = String(timestamp) result["timestamp"] = String(timestamp)

@ -1495,7 +1495,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
// Loki: Since we don't support multi-device sending yet, just send it to the primary device // Loki: Since we don't support multi-device sending yet, just send it to the primary device
NSMutableArray<NSNumber *> *deviceIds = @[@(OWSDevicePrimaryDeviceId)]; NSMutableArray<NSNumber *> *deviceIds = @[@(OWSDevicePrimaryDeviceId)];
/* Original code: /* Loki: Original code:
NSMutableArray<NSNumber *> *deviceIds = [recipient.devices mutableCopy]; NSMutableArray<NSNumber *> *deviceIds = [recipient.devices mutableCopy];
*/ */

Loading…
Cancel
Save