Commit 80b4689a authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

fix: save message

This patch add fixes:
- add direction when saving contact interaction
- continue iterate throw conversations rather then exit when one of
conversation is empty or could not be created

Change-Id: I16355921f94b14312d8b5b0717897c9fa833e61a
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent a8d38897
......@@ -321,7 +321,8 @@ final class InteractionDataHelper {
body <- item.body,
type <- item.type,
status <- item.status,
daemonId <- item.daemonID)
daemonId <- item.daemonID,
incoming <- item.incoming)
do {
let rows = try dataBase.scalar(querySelect.count)
if rows == 0 {
......
......@@ -303,7 +303,7 @@ class DBManager {
for conversationID in conversationsID {
guard let participants = try self.getParticipantsForConversation(conversationID: conversationID),
!participants.isEmpty else {
throw DBBridgingError.getConversationFailed
continue
}
guard let participant =
self.filterParticipantsFor(account: accountProfile.id,
......@@ -311,7 +311,7 @@ class DBManager {
throw DBBridgingError.getConversationFailed
}
guard let participantProfile = try self.profileHepler.selectProfile(profileId: participant) else {
throw DBBridgingError.getConversationFailed
continue
}
let conversationModel = ConversationModel(withRecipientRingId: participantProfile.uri,
accountId: accountID, accountUri: accountUri)
......@@ -321,7 +321,7 @@ class DBManager {
.selectInteractionsForConversationWithAccount(conversationID: conversationID,
accountProfileID: accountProfile.id),
!interactions.isEmpty else {
throw DBBridgingError.getConversationFailed
continue
}
for interaction in interactions {
var author = accountProfile.uri
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment