diff --git a/SignalMessaging/utils/ThreadUtil.m b/SignalMessaging/utils/ThreadUtil.m index a1516c539..33b3795c5 100644 --- a/SignalMessaging/utils/ThreadUtil.m +++ b/SignalMessaging/utils/ThreadUtil.m @@ -182,7 +182,7 @@ typedef void (^BuildOutgoingMessageCompletionBlock)(TSOutgoingMessage *savedMess // Loki: If we're not friends then always set the message to a friend request message. // If we're friends then the assumption is that we have the other user's pre key bundle. - NSString *messageClassAsString = (thread.isContactFriend || thread.isGroupThread || thread.isNoteToSelf) ? @"TSOutgoingMessage" : @"LKFriendRequestMessage"; + NSString *messageClassAsString = (thread.isContactFriend || thread.isGroupThread) ? @"TSOutgoingMessage" : @"LKFriendRequestMessage"; Class messageClass = NSClassFromString(messageClassAsString); TSOutgoingMessage *message = diff --git a/SignalServiceKit/src/Loki/Protocol/Meta/SessionMetaProtocol.swift b/SignalServiceKit/src/Loki/Protocol/Meta/SessionMetaProtocol.swift index 068291781..6ab716cba 100644 --- a/SignalServiceKit/src/Loki/Protocol/Meta/SessionMetaProtocol.swift +++ b/SignalServiceKit/src/Loki/Protocol/Meta/SessionMetaProtocol.swift @@ -114,6 +114,7 @@ public final class SessionMetaProtocol : NSObject { @objc(updateDisplayNameIfNeededForHexEncodedPublicKey:using:appendingShortID:in:) public static func updateDisplayNameIfNeeded(for hexEncodedPublicKey: String, using dataMessage: SSKProtoDataMessage, appendingShortID appendShortID: Bool, in transaction: YapDatabaseReadWriteTransaction) { guard let profile = dataMessage.profile, let rawDisplayName = profile.displayName else { return } + guard !rawDisplayName.isEmpty else { return } let displayName: String // TODO: Figure out why we sometimes don't append the short ID if appendShortID { @@ -122,7 +123,6 @@ public final class SessionMetaProtocol : NSObject { } else { displayName = rawDisplayName } - guard !displayName.isEmpty else { return } let profileManager = SSKEnvironment.shared.profileManager profileManager.updateProfileForContact(withID: hexEncodedPublicKey, displayName: displayName, with: transaction) }