pull/8/head
Niels Andriesse 7 years ago
parent 78adfabf0c
commit 5541e2c2c3

@ -2569,3 +2569,4 @@
"Invalid public key" = "Invalid public key";
"No search results" = "No search results";
"Calculating proof of work" = "Calculating proof of work";
"Failed to calculate proof of work." = "Failed to calculate proof of work.";

@ -16,7 +16,7 @@ extern void curve25519_donna(unsigned char *output, const unsigned char *a, cons
}
static const uint8_t basepoint[ECCKeyLength] = { 9 };
NSMutableData *publicKey = [NSMutableData dataWithLength:ECCKeyLength];
if (!publicKey) { OWSFail(@"Could not allocate buffer"); }
if (!publicKey) { OWSFail(@"Couldn't allocate buffer."); }
curve25519_donna(publicKey.mutableBytes, privateKey.mutableBytes, basepoint);
// Use KVC to access privateKey and publicKey even though they're private
ECKeyPair *result = [ECKeyPair new];

@ -1,6 +1,6 @@
import PromiseKit
@objc public final class LokiMessage : NSObject {
public struct LokiMessage {
/// The hex encoded public key of the receiver.
let destination: String
/// The content of the message.
@ -12,7 +12,7 @@ import PromiseKit
/// The base 64 encoded proof of work.
let nonce: String
init(destination: String, data: LosslessStringConvertible, ttl: UInt64, timestamp: UInt64, nonce: String) {
public init(destination: String, data: LosslessStringConvertible, ttl: UInt64, timestamp: UInt64, nonce: String) {
self.destination = destination
self.data = data
self.ttl = ttl
@ -37,7 +37,7 @@ import PromiseKit
}
}
func toJSON() -> [String:String] {
public func toJSON() -> [String:String] {
return [
"destination" : destination,
"data" : data.description,

@ -2,9 +2,9 @@ import PromiseKit
@objc public final class LokiMessagingAPI : NSObject {
private static var baseURL: String { return textSecureServerURL }
private static var port: String { return "8080" }
private static var apiVersion: String { return "v1" }
private static let baseURL = "http://13.238.53.205"
private static let port = "8080"
private static let apiVersion = "v1"
public static let defaultTTL: UInt64 = 4 * 24 * 60 * 60
// MARK: Types
@ -50,4 +50,9 @@ import PromiseKit
]
return invoke(.retrieveAllMessages, parameters: parameters)
}
// MARK: Obj-C API
@objc public static func sendSignalMessage(_ signalMessage: SignalMessage, to destination: String, completionHandler: @escaping (Any?, NSError?) -> Void) {
sendSignalMessage(signalMessage, to: destination).done { completionHandler($0.responseObject, nil) }.catch { completionHandler(nil, $0 as NSError) }
}
}

Loading…
Cancel
Save