Fix empty message generation.

Before since we were setting the groupMetaMessage, it was setting the `shouldSave` property to true and thus the message sender was looking for the message in the db.
We now don't set this property so the message should be able to be sent without saving.
pull/16/head
Mikunj 6 years ago
parent 7faa9d333c
commit fb1e27d633

@ -89,7 +89,6 @@ typedef void (^BuildOutgoingMessageCompletionBlock)(TSOutgoingMessage *savedMess
{
TSOutgoingMessage *message = [TSOutgoingMessage createEmptyOutgoingMessageInThread:thread];
[self.dbConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[message saveWithTransaction:transaction];
[self.messageSenderJobQueue addMessage:message transaction:transaction];
}];
return message;

@ -3,16 +3,6 @@
/// Loki: This is a message used to establish sessions
@objc public static func createEmptyOutgoingMessage(inThread thread: TSThread) -> TSOutgoingMessage {
return TSOutgoingMessage(outgoingMessageWithTimestamp: NSDate.ows_millisecondTimeStamp(),
in: thread,
messageBody: "",
attachmentIds: [],
expiresInSeconds: 0,
expireStartedAt: 0,
isVoiceMessage: false,
groupMetaMessage: .unspecified,
quotedMessage: nil,
contactShare: nil,
linkPreview: nil)
return TSOutgoingMessage(in: thread, messageBody: "", attachmentId: nil)
}
}

Loading…
Cancel
Save