From b25a704039eda01ab990f4b12d2bc5c577d763b2 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 12 Nov 2018 10:42:37 -0600 Subject: [PATCH] Fix: Compose thread picker doesn't show self --- SignalServiceKit/src/Contacts/SignalRecipient.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SignalServiceKit/src/Contacts/SignalRecipient.m b/SignalServiceKit/src/Contacts/SignalRecipient.m index 01d2225e0..6f2c576c0 100644 --- a/SignalServiceKit/src/Contacts/SignalRecipient.m +++ b/SignalServiceKit/src/Contacts/SignalRecipient.m @@ -88,6 +88,15 @@ NS_ASSUME_NONNULL_BEGIN _devices = [NSOrderedSet new]; } + // Since we use device count to determine whether a user is registered or not, + // ensure the local user always has at least *this* device. + if (![_devices containsObject:@(OWSDevicePrimaryDeviceId)]) { + if ([self.uniqueId isEqualToString:self.tsAccountManager.localNumber]) { + DDLogInfo(@"Adding primary device to self recipient."); + [self addDevices:[NSSet setWithObject:@(OWSDevicePrimaryDeviceId)]]; + } + } + return self; }