Debug open group messaging
This commit is contained in:
parent
2d8933901d
commit
d01e732515
|
@ -53,7 +53,7 @@ public final class MessageSendJob : NSObject, Job, NSCoding { // NSObject/NSCodi
|
|||
switch destination {
|
||||
case .contact(let publicKey): coder.encode("contact(\(publicKey))", forKey: "destination")
|
||||
case .closedGroup(let groupPublicKey): coder.encode("closedGroup(\(groupPublicKey))", forKey: "destination")
|
||||
case .openGroup(let channel, let server): coder.encode("openGroup(\(channel), \(server))")
|
||||
case .openGroup(let channel, let server): coder.encode("openGroup(\(channel), \(server))", forKey: "destination")
|
||||
}
|
||||
coder.encode(id, forKey: "id")
|
||||
coder.encode(failureCount, forKey: "failureCount")
|
||||
|
|
|
@ -86,8 +86,8 @@ public final class OpenGroupAPI : DotNetAPI {
|
|||
}
|
||||
}
|
||||
let quote: OpenGroupMessage.Quote?
|
||||
if let quoteAsJSON = value["quote"] as? JSON, let quotedMessageTimestamp = quoteAsJSON["id"] as? UInt64, let quoteePublicKey = quoteAsJSON["author"] as? String,
|
||||
let quotedMessageBody = quoteAsJSON["text"] as? String {
|
||||
if let quoteAsJSON = value["quote"] as? JSON, let quotedMessageTimestamp = quoteAsJSON["id"] as? UInt64, let quoteePublicKey = quoteAsJSON["author"] as? String {
|
||||
let quotedMessageBody = quoteAsJSON["text"] as? String
|
||||
let quotedMessageServerID = message["reply_to"] as? UInt64
|
||||
quote = OpenGroupMessage.Quote(quotedMessageTimestamp: quotedMessageTimestamp, quoteePublicKey: quoteePublicKey, quotedMessageBody: quotedMessageBody,
|
||||
quotedMessageServerID: quotedMessageServerID)
|
||||
|
|
|
@ -137,8 +137,9 @@ public final class OpenGroupMessage : NSObject {
|
|||
internal func toJSON() -> JSON {
|
||||
var value: JSON = [ "timestamp" : timestamp ]
|
||||
if let quote = quote {
|
||||
value["quote"] = [ "id" : quote.quotedMessageTimestamp, "author" : quote.quoteePublicKey ]
|
||||
if let quotedMessageBody = quote.quotedMessageBody { value["text"] = quotedMessageBody }
|
||||
var quoteAsJSON: JSON = [ "id" : quote.quotedMessageTimestamp, "author" : quote.quoteePublicKey ]
|
||||
if let quotedMessageBody = quote.quotedMessageBody { quoteAsJSON["text"] = quotedMessageBody }
|
||||
value["quote"] = quoteAsJSON
|
||||
}
|
||||
if let signature = signature {
|
||||
value["sig"] = signature.data.toHexString()
|
||||
|
|
Loading…
Reference in New Issue