Updated to use LokiProfile proto.

pull/26/head
Mikunj 6 years ago
parent ea0134ad61
commit cda1c51b3c

@ -1106,12 +1106,10 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt
id<ProfileManagerProtocol> profileManager = SSKEnvironment.shared.profileManager;
NSString *displayName = profileManager.localProfileName;
if (displayName != nil) {
SSKProtoDataMessageContactBuilder *profileBuilder = [SSKProtoDataMessageContact builder];
SSKProtoDataMessageContactNameBuilder *nameBuilder = [SSKProtoDataMessageContactName builder];
[nameBuilder setDisplayName:displayName];
SSKProtoDataMessageContactName *name = [nameBuilder buildIgnoringErrors];
[profileBuilder setName:name];
SSKProtoDataMessageContact *profile = [profileBuilder buildIgnoringErrors];
SSKProtoDataMessageLokiProfileBuilder *profileBuilder = [SSKProtoDataMessageLokiProfile builder];
[profileBuilder setDisplayName:displayName];
SSKProtoDataMessageLokiProfile *profile = [profileBuilder buildIgnoringErrors];
[builder setProfile:profile];
}

@ -1445,7 +1445,7 @@ NS_ASSUME_NONNULL_BEGIN
serverTimestamp:serverTimestamp
wasReceivedByUD:wasReceivedByUD];
NSString *displayName = dataMessage.profile.name.displayName;
NSString *displayName = dataMessage.profile.displayName;
[self.profileManager setDisplayNameForContactWithID:thread.contactIdentifier to:displayName with:transaction];
if (envelope.isPtpMessage) { incomingMessage.isP2P = YES; }

Loading…
Cancel
Save