mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Note to Self.
This commit is contained in:
parent
1d13a02927
commit
fc8fbebd97
3 changed files with 46 additions and 7 deletions
|
@ -1258,9 +1258,10 @@ typedef enum : NSUInteger {
|
|||
} else {
|
||||
OWSAssertDebug(self.thread.contactIdentifier);
|
||||
|
||||
if ([self.thread.contactIdentifier isEqualToString:self.tsAccountManager.localNumber]) {
|
||||
BOOL isNoteToSelf = [self.thread.contactIdentifier isEqualToString:self.tsAccountManager.localNumber];
|
||||
if (isNoteToSelf) {
|
||||
name = [[NSAttributedString alloc]
|
||||
initWithString:NSLocalizedString(@"NOTE_TO_SELF", "Label for 1:1 conversation with yourself.")
|
||||
initWithString:NSLocalizedString(@"NOTE_TO_SELF", @"Label for 1:1 conversation with yourself.")
|
||||
attributes:@{
|
||||
NSFontAttributeName : self.headerView.titlePrimaryFont,
|
||||
}];
|
||||
|
|
|
@ -53,6 +53,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return SSKEnvironment.shared.typingIndicators;
|
||||
}
|
||||
|
||||
- (TSAccountManager *)tsAccountManager
|
||||
{
|
||||
OWSAssertDebug(SSKEnvironment.shared.tsAccountManager);
|
||||
|
||||
return SSKEnvironment.shared.tsAccountManager;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier
|
||||
|
@ -510,9 +517,18 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
name = [[NSAttributedString alloc] initWithString:thread.name];
|
||||
}
|
||||
} else {
|
||||
name = [self.contactsManager attributedContactOrProfileNameForPhoneIdentifier:thread.contactIdentifier
|
||||
primaryFont:self.nameFont
|
||||
secondaryFont:self.nameSecondaryFont];
|
||||
BOOL isNoteToSelf = [self.thread.contactIdentifier isEqualToString:self.tsAccountManager.localNumber];
|
||||
if (isNoteToSelf) {
|
||||
name = [[NSAttributedString alloc]
|
||||
initWithString:NSLocalizedString(@"NOTE_TO_SELF", @"Label for 1:1 conversation with yourself.")
|
||||
attributes:@{
|
||||
NSFontAttributeName : self.nameFont,
|
||||
}];
|
||||
} else {
|
||||
name = [self.contactsManager attributedContactOrProfileNameForPhoneIdentifier:thread.contactIdentifier
|
||||
primaryFont:self.nameFont
|
||||
secondaryFont:self.nameSecondaryFont];
|
||||
}
|
||||
}
|
||||
|
||||
self.nameLabel.attributedText = name;
|
||||
|
|
|
@ -61,6 +61,13 @@ const CGFloat kContactCellAvatarTextMargin = 12;
|
|||
return SSKEnvironment.shared.primaryStorage;
|
||||
}
|
||||
|
||||
- (TSAccountManager *)tsAccountManager
|
||||
{
|
||||
OWSAssertDebug(SSKEnvironment.shared.tsAccountManager);
|
||||
|
||||
return SSKEnvironment.shared.tsAccountManager;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)configure
|
||||
|
@ -133,8 +140,17 @@ const CGFloat kContactCellAvatarTextMargin = 12;
|
|||
self.thread = [TSContactThread getThreadWithContactId:recipientId transaction:transaction];
|
||||
}];
|
||||
|
||||
self.nameLabel.attributedText =
|
||||
[self.contactsManager formattedFullNameForRecipientId:recipientId font:self.nameLabel.font];
|
||||
BOOL isNoteToSelf = [recipientId isEqualToString:self.tsAccountManager.localNumber];
|
||||
if (isNoteToSelf) {
|
||||
self.nameLabel.attributedText = [[NSAttributedString alloc]
|
||||
initWithString:NSLocalizedString(@"NOTE_TO_SELF", @"Label for 1:1 conversation with yourself.")
|
||||
attributes:@{
|
||||
NSFontAttributeName : self.nameLabel.font,
|
||||
}];
|
||||
} else {
|
||||
self.nameLabel.attributedText =
|
||||
[self.contactsManager formattedFullNameForRecipientId:recipientId font:self.nameLabel.font];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(otherUsersProfileDidChange:)
|
||||
|
@ -165,6 +181,12 @@ const CGFloat kContactCellAvatarTextMargin = 12;
|
|||
threadName = [MessageStrings newGroupDefaultTitle];
|
||||
}
|
||||
|
||||
BOOL isNoteToSelf
|
||||
= (!thread.isGroupThread && [thread.contactIdentifier isEqualToString:self.tsAccountManager.localNumber]);
|
||||
if (isNoteToSelf) {
|
||||
threadName = NSLocalizedString(@"NOTE_TO_SELF", @"Label for 1:1 conversation with yourself.");
|
||||
}
|
||||
|
||||
NSAttributedString *attributedText =
|
||||
[[NSAttributedString alloc] initWithString:threadName
|
||||
attributes:@{
|
||||
|
|
Loading…
Reference in a new issue