From d91dc5f0456150a312409c2f473e9e2c620e16cf Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 14 May 2019 12:54:13 +1000 Subject: [PATCH] Fix friend request view bug --- Signal/src/Loki/FriendRequestView.swift | 1 + .../ViewControllers/ConversationView/Cells/OWSMessageCell.m | 2 +- SignalServiceKit/src/Loki/Extensions/OWSPrimaryStorage+Loki.h | 4 ++-- .../Extensions/SSKProtoPrekeyBundleMessage+PreKeyBundle.swift | 1 + .../src/Loki/Extensions/TSOutgoingMessage+Loki.swift | 3 ++- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Signal/src/Loki/FriendRequestView.swift b/Signal/src/Loki/FriendRequestView.swift index 6bcb648dd..a8b196702 100644 --- a/Signal/src/Loki/FriendRequestView.swift +++ b/Signal/src/Loki/FriendRequestView.swift @@ -25,6 +25,7 @@ init(kind: Kind) { self.kind = kind super.init(frame: CGRect.zero) + initialize() } @objc convenience init?(rawKind: String) { diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index b0d0d1a2d..9e68b56b4 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN } - (TSThreadFriendRequestState)friendRequestState { - return TSThreadFriendRequestStateRequestSent; + return self.isIncoming ? TSThreadFriendRequestStateRequestReceived : TSThreadFriendRequestStateRequestSent; // return self.message.thread.friendRequestState; } diff --git a/SignalServiceKit/src/Loki/Extensions/OWSPrimaryStorage+Loki.h b/SignalServiceKit/src/Loki/Extensions/OWSPrimaryStorage+Loki.h index 5cc04ab62..ffcee015b 100644 --- a/SignalServiceKit/src/Loki/Extensions/OWSPrimaryStorage+Loki.h +++ b/SignalServiceKit/src/Loki/Extensions/OWSPrimaryStorage+Loki.h @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN Set the `PreKeyBundle` for the given contact. @param bundle The pre key bundle. - @param transaction A YapDatabaseReadWriteTransaction. + @param transaction A `YapDatabaseReadWriteTransaction`. @param pubKey The hex encoded public key of the contact. */ - (void)setPreKeyBundle:(PreKeyBundle *)bundle forContact:(NSString *)pubKey transaction:(YapDatabaseReadWriteTransaction *)transaction; @@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN Remove the `PreKeyBundle` for the given contact. @param pubKey The hex encoded public key of the contact. - @param transaction A YapDatabaseReadWriteTransaction. + @param transaction A `YapDatabaseReadWriteTransaction`. */ - (void)removePreKeyBundleForContact:(NSString *)pubKey transaction:(YapDatabaseReadWriteTransaction *)transaction; diff --git a/SignalServiceKit/src/Loki/Extensions/SSKProtoPrekeyBundleMessage+PreKeyBundle.swift b/SignalServiceKit/src/Loki/Extensions/SSKProtoPrekeyBundleMessage+PreKeyBundle.swift index 67789154e..695658fa7 100644 --- a/SignalServiceKit/src/Loki/Extensions/SSKProtoPrekeyBundleMessage+PreKeyBundle.swift +++ b/SignalServiceKit/src/Loki/Extensions/SSKProtoPrekeyBundleMessage+PreKeyBundle.swift @@ -1,3 +1,4 @@ + @objc public extension SSKProtoPrekeyBundleMessage { private var accountManager: TSAccountManager { diff --git a/SignalServiceKit/src/Loki/Extensions/TSOutgoingMessage+Loki.swift b/SignalServiceKit/src/Loki/Extensions/TSOutgoingMessage+Loki.swift index 824eb82bc..e42513ed0 100644 --- a/SignalServiceKit/src/Loki/Extensions/TSOutgoingMessage+Loki.swift +++ b/SignalServiceKit/src/Loki/Extensions/TSOutgoingMessage+Loki.swift @@ -1,4 +1,5 @@ -public extension TSOutgoingMessage { + +@objc public extension TSOutgoingMessage { /// Loki: This is a message used to establish sessions @objc public static func emptyOutgoingMessage(inThread thread: TSThread) -> TSOutgoingMessage {