From 82ffacff6dc1ef1c4384a000ac1f829615b36922 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Wed, 20 May 2020 11:45:05 +1000 Subject: [PATCH] clean --- .../src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift | 2 -- .../src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift b/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift index 7b7e58d3c..20451221c 100644 --- a/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift +++ b/SignalServiceKit/src/Loki/Protocol/Multi Device/MultiDeviceProtocol.swift @@ -154,8 +154,6 @@ public final class MultiDeviceProtocol : NSObject { @objc(getAutoGeneratedMultiDeviceFRMessageForHexEncodedPublicKey:in:) public static func getAutoGeneratedMultiDeviceFRMessage(for hexEncodedPublicKey: String, in transaction: YapDatabaseReadWriteTransaction) -> FriendRequestMessage { let thread = TSContactThread.getOrCreateThread(withContactId: hexEncodedPublicKey, transaction: transaction) - thread.shouldThreadBeVisible = true - thread.save(with: transaction) let result = FriendRequestMessage(timestamp: NSDate.ows_millisecondTimeStamp(), thread: thread, body: "Please accept to enable messages to be synced across devices") result.skipSave = true // TODO: Why is this necessary again? return result diff --git a/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift b/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift index 308fc5519..5574c8463 100644 --- a/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift +++ b/SignalServiceKit/src/Loki/Protocol/Sync Messages/SyncMessagesProtocol.swift @@ -188,6 +188,9 @@ public final class SyncMessagesProtocol : NSObject { storage.setFriendRequestStatus(.friends, for: hexEncodedPublicKey, transaction: transaction) default: break } + let thread = TSContactThread.getOrCreateThread(withContactId: hexEncodedPublicKey, transaction: transaction) + thread.shouldThreadBeVisible = true + thread.save(with: transaction) } }