Include public key with display names

This commit is contained in:
Niels Andriesse 2019-09-12 11:22:42 +10:00
parent fc1c48f282
commit 295bc57a99
1 changed files with 7 additions and 2 deletions

View File

@ -1468,8 +1468,13 @@ NS_ASSUME_NONNULL_BEGIN
serverTimestamp:serverTimestamp
wasReceivedByUD:wasReceivedByUD];
NSString *displayName = dataMessage.profile.displayName;
[self.profileManager setDisplayNameForContactWithID:thread.contactIdentifier to:displayName with:transaction];
NSString *rawDisplayName = dataMessage.profile.displayName;
if (rawDisplayName != nil && rawDisplayName.length > 0) {
NSString *displayName = [NSString stringWithFormat:@"%@ (...%@)", rawDisplayName, [incomingMessage.authorId substringFromIndex:incomingMessage.authorId.length - 8]];
[self.profileManager setDisplayNameForContactWithID:thread.contactIdentifier to:displayName with:transaction];
} else {
[self.profileManager setDisplayNameForContactWithID:thread.contactIdentifier to:nil with:transaction];
}
if (envelope.isPtpMessage) { incomingMessage.isP2P = YES; }