mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Rename an OWSContactsManager method
From nameStringForPhoneIdentifier To displayNameForPhoneIdentifier * Add nullability descriptions * Fix the mock object to adhere to new nullability rules // FREEBIE
This commit is contained in:
parent
34ffce89f5
commit
7125028159
7 changed files with 15 additions and 15 deletions
|
@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- (NSString *)name
|
||||
{
|
||||
return [[TextSecureKitEnv sharedEnv].contactsManager nameStringForPhoneIdentifier:self.contactIdentifier];
|
||||
return [[TextSecureKitEnv sharedEnv].contactsManager displayNameForPhoneIdentifier:self.contactIdentifier];
|
||||
}
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
|
|
|
@ -192,7 +192,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
if ([message isKindOfClass:[TSIncomingMessage class]]) {
|
||||
TSIncomingMessage *incomingMessage = (TSIncomingMessage *)message;
|
||||
NSString *contactName = [contactsManager nameStringForPhoneIdentifier:incomingMessage.authorId];
|
||||
NSString *contactName = [contactsManager displayNameForPhoneIdentifier:incomingMessage.authorId];
|
||||
|
||||
[[[OWSDisappearingConfigurationUpdateInfoMessage alloc] initWithTimestamp:message.timestamp
|
||||
thread:message.thread
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
if ([membersWhoLeft count] > 0) {
|
||||
NSArray *oldMembersNames = [[membersWhoLeft allObjects] map:^NSString*(NSString* item) {
|
||||
return [contactsManager nameStringForPhoneIdentifier:item];
|
||||
return [contactsManager displayNameForPhoneIdentifier:item];
|
||||
}];
|
||||
updatedGroupInfoString = [updatedGroupInfoString
|
||||
stringByAppendingString:[NSString
|
||||
|
@ -91,7 +91,7 @@
|
|||
|
||||
if ([membersWhoJoined count] > 0) {
|
||||
NSArray *newMembersNames = [[membersWhoJoined allObjects] map:^NSString*(NSString* item) {
|
||||
return [contactsManager nameStringForPhoneIdentifier:item];
|
||||
return [contactsManager displayNameForPhoneIdentifier:item];
|
||||
}];
|
||||
updatedGroupInfoString = [updatedGroupInfoString
|
||||
stringByAppendingString:[NSString stringWithFormat:NSLocalizedString(@"GROUP_MEMBER_JOINED", @""),
|
||||
|
|
|
@ -453,7 +453,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
durationSeconds:OWSDisappearingMessagesConfigurationDefaultExpirationDuration];
|
||||
}
|
||||
[disappearingMessagesConfiguration save];
|
||||
NSString *name = [self.contactsManager nameStringForPhoneIdentifier:envelope.source];
|
||||
NSString *name = [self.contactsManager displayNameForPhoneIdentifier:envelope.source];
|
||||
OWSDisappearingConfigurationUpdateInfoMessage *message =
|
||||
[[OWSDisappearingConfigurationUpdateInfoMessage alloc] initWithTimestamp:envelope.timestamp
|
||||
thread:thread
|
||||
|
@ -502,7 +502,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
break;
|
||||
}
|
||||
case OWSSignalServiceProtosGroupContextTypeQuit: {
|
||||
NSString *nameString = [self.contactsManager nameStringForPhoneIdentifier:envelope.source];
|
||||
NSString *nameString = [self.contactsManager displayNameForPhoneIdentifier:envelope.source];
|
||||
|
||||
NSString *updateGroupInfo =
|
||||
[NSString stringWithFormat:NSLocalizedString(@"GROUP_MEMBER_LEFT", @""), nameString];
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
@protocol ContactsManagerProtocol <NSObject>
|
||||
|
||||
- (NSString *)nameStringForPhoneIdentifier:(NSString *)phoneNumber;
|
||||
- (NSArray<Contact *> *)signalContacts;
|
||||
+ (BOOL)name:(NSString *)nameString matchesQuery:(NSString *)queryString;
|
||||
- (NSString * _Nonnull)displayNameForPhoneIdentifier:(NSString * _Nullable)phoneNumber;
|
||||
- (NSArray<Contact *> * _Nonnull)signalContacts;
|
||||
+ (BOOL)name:(NSString * _Nonnull)nameString matchesQuery:(NSString * _Nonnull)queryString;
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
- (UIImage *)imageForPhoneIdentifier:(NSString *)phoneNumber;
|
||||
- (UIImage * _Nullable)imageForPhoneIdentifier:(NSString * _Nullable)phoneNumber;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
|
|
@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
- (OWSFingerprint *)fingerprintWithTheirSignalId:(NSString *)theirSignalId theirIdentityKey:(NSData *)theirIdentityKey
|
||||
{
|
||||
NSString *theirName = [self.contactsManager nameStringForPhoneIdentifier:theirSignalId];
|
||||
NSString *theirName = [self.contactsManager displayNameForPhoneIdentifier:theirSignalId];
|
||||
|
||||
NSString *mySignalId = [self.storageManager localNumber];
|
||||
NSData *myIdentityKey = [self.storageManager identityKeyPair].publicKey;
|
||||
|
|
|
@ -9,22 +9,22 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@implementation OWSFakeContactsManager
|
||||
|
||||
- (NSString *)nameStringForPhoneIdentifier:(NSString *)phoneNumber
|
||||
- (NSString * _Nonnull)displayNameForPhoneIdentifier:(NSString * _Nullable)phoneNumber
|
||||
{
|
||||
return @"Fake name";
|
||||
}
|
||||
|
||||
- (NSArray<Contact *> *)signalContacts
|
||||
- (NSArray<Contact *> * _Nonnull)signalContacts
|
||||
{
|
||||
return @[];
|
||||
}
|
||||
|
||||
+ (BOOL)name:(NSString *)nameString matchesQuery:(NSString *)queryString
|
||||
+ (BOOL)name:(NSString * _Nonnull)nameString matchesQuery:(NSString * _Nonnull)queryString
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (nullable UIImage *)imageForPhoneIdentifier:(NSString *)phoneNumber
|
||||
- (UIImage * _Nullable)imageForPhoneIdentifier:(NSString * _Nullable)phoneNumber
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue