Debug
This commit is contained in:
parent
37f0dbd5b8
commit
6b7b158000
|
@ -429,9 +429,8 @@ static NSTimeInterval launchStartedAt;
|
||||||
|
|
||||||
if (CurrentAppContext().isMainApp) {
|
if (CurrentAppContext().isMainApp) {
|
||||||
[SNJobQueue.shared resumePendingJobs];
|
[SNJobQueue.shared resumePendingJobs];
|
||||||
|
[self syncConfigurationIfNeeded];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self syncConfigurationIfNeeded];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,10 @@ extension Storage {
|
||||||
let thread = TSThread.fetch(uniqueId: threadID, transaction: transaction) else { return nil }
|
let thread = TSThread.fetch(uniqueId: threadID, transaction: transaction) else { return nil }
|
||||||
let tsMessage: TSMessage
|
let tsMessage: TSMessage
|
||||||
if message.sender == getUserPublicKey() {
|
if message.sender == getUserPublicKey() {
|
||||||
tsMessage = TSOutgoingMessage.from(message, associatedWith: thread, using: transaction)
|
guard let syncTarget = message.syncTarget else { return nil }
|
||||||
|
let tsOutgoingMessage = TSOutgoingMessage.from(message, associatedWith: thread, using: transaction)
|
||||||
|
tsOutgoingMessage.update(withSentRecipient: syncTarget, wasSentByUD: true, transaction: transaction)
|
||||||
|
tsMessage = tsOutgoingMessage
|
||||||
} else {
|
} else {
|
||||||
tsMessage = TSIncomingMessage.from(message, quotedMessage: quotedMessage, linkPreview: linkPreview, associatedWith: thread)
|
tsMessage = TSIncomingMessage.from(message, quotedMessage: quotedMessage, linkPreview: linkPreview, associatedWith: thread)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import SessionUtilitiesKit
|
||||||
public final class ConfigurationMessage : ControlMessage {
|
public final class ConfigurationMessage : ControlMessage {
|
||||||
public var closedGroups: Set<ClosedGroup> = []
|
public var closedGroups: Set<ClosedGroup> = []
|
||||||
public var openGroups: Set<String> = []
|
public var openGroups: Set<String> = []
|
||||||
|
|
||||||
|
public override var ttl: UInt64 { 4 * 24 * 60 * 60 * 1000 }
|
||||||
|
|
||||||
public override var isSelfSendValid: Bool { true }
|
public override var isSelfSendValid: Bool { true }
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import SessionUtilitiesKit
|
||||||
outgoingMessageWithTimestamp: visibleMessage.sentTimestamp!,
|
outgoingMessageWithTimestamp: visibleMessage.sentTimestamp!,
|
||||||
in: thread,
|
in: thread,
|
||||||
messageBody: visibleMessage.text,
|
messageBody: visibleMessage.text,
|
||||||
attachmentIds: NSMutableArray(),
|
attachmentIds: NSMutableArray(array: visibleMessage.attachmentIDs),
|
||||||
expiresInSeconds: expiration,
|
expiresInSeconds: expiration,
|
||||||
expireStartedAt: 0,
|
expireStartedAt: 0,
|
||||||
isVoiceMessage: false,
|
isVoiceMessage: false,
|
||||||
|
|
|
@ -358,11 +358,9 @@ public final class MessageSender : NSObject {
|
||||||
tsMessage.update(withSentRecipient: recipient, wasSentByUD: true, transaction: transaction)
|
tsMessage.update(withSentRecipient: recipient, wasSentByUD: true, transaction: transaction)
|
||||||
}
|
}
|
||||||
OWSDisappearingMessagesJob.shared().startAnyExpiration(for: tsMessage, expirationStartedAt: NSDate.millisecondTimestamp(), transaction: transaction)
|
OWSDisappearingMessagesJob.shared().startAnyExpiration(for: tsMessage, expirationStartedAt: NSDate.millisecondTimestamp(), transaction: transaction)
|
||||||
// Sync the message if:
|
// Sync the message if needed
|
||||||
// • it wasn't a self-send
|
|
||||||
// • it was a visible message
|
|
||||||
let userPublicKey = getUserHexEncodedPublicKey()
|
let userPublicKey = getUserHexEncodedPublicKey()
|
||||||
if case .contact(let publicKey) = destination, publicKey != userPublicKey, let message = message as? VisibleMessage {
|
if case .contact(let publicKey) = destination, let message = message as? VisibleMessage {
|
||||||
message.syncTarget = publicKey
|
message.syncTarget = publicKey
|
||||||
// FIXME: Make this a job
|
// FIXME: Make this a job
|
||||||
sendToSnodeDestination(.contact(publicKey: userPublicKey), message: message, using: transaction, isSyncMessage: true).retainUntilComplete()
|
sendToSnodeDestination(.contact(publicKey: userPublicKey), message: message, using: transaction, isSyncMessage: true).retainUntilComplete()
|
||||||
|
|
Loading…
Reference in New Issue