|
|
|
@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
@property (nonatomic) OWSMessageBubbleView *messageBubbleView;
|
|
|
|
|
@property (nonatomic) NSLayoutConstraint *messageBubbleViewBottomConstraint;
|
|
|
|
|
@property (nonatomic) AvatarImageView *avatarView;
|
|
|
|
|
@property (nonatomic) UIImageView *moderatorIconView;
|
|
|
|
|
@property (nonatomic, nullable) LKFriendRequestView *friendRequestView;
|
|
|
|
|
@property (nonatomic, nullable) UIImageView *sendFailureBadgeView;
|
|
|
|
|
|
|
|
|
@ -61,6 +62,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
[self.avatarView autoSetDimension:ALDimensionWidth toSize:self.avatarSize];
|
|
|
|
|
[self.avatarView autoSetDimension:ALDimensionHeight toSize:self.avatarSize];
|
|
|
|
|
|
|
|
|
|
self.moderatorIconView = [[UIImageView alloc] init];
|
|
|
|
|
[self.moderatorIconView autoSetDimension:ALDimensionWidth toSize:20.f];
|
|
|
|
|
[self.moderatorIconView autoSetDimension:ALDimensionHeight toSize:20.f];
|
|
|
|
|
self.moderatorIconView.hidden = YES;
|
|
|
|
|
|
|
|
|
|
self.messageBubbleViewBottomConstraint = [self.messageBubbleView autoPinBottomToSuperviewMarginWithInset:0];
|
|
|
|
|
|
|
|
|
|
self.contentView.userInteractionEnabled = YES;
|
|
|
|
@ -227,6 +233,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
[self.messageBubbleView autoPinLeadingToTrailingEdgeOfView:self.avatarView offset:8],
|
|
|
|
|
[self.messageBubbleView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.avatarView],
|
|
|
|
|
]];
|
|
|
|
|
|
|
|
|
|
[self.viewConstraints addObjectsFromArray:@[
|
|
|
|
|
[self.moderatorIconView autoPinEdge:ALEdgeTrailing toEdge:ALEdgeTrailing ofView:self.avatarView],
|
|
|
|
|
[self.moderatorIconView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.avatarView withOffset:3.5]
|
|
|
|
|
]];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -285,6 +296,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
diameter:self.avatarSize] build];
|
|
|
|
|
self.avatarView.image = authorAvatarImage;
|
|
|
|
|
[self.contentView addSubview:self.avatarView];
|
|
|
|
|
|
|
|
|
|
if (self.viewItem.isGroupThread && !self.viewItem.isRSSFeed) {
|
|
|
|
|
BOOL isModerator = [LKGroupChatAPI isUserModerator:incomingMessage.authorId forGroup:LKGroupChatAPI.publicChatServerID onServer:LKGroupChatAPI.publicChatServer];
|
|
|
|
|
UIImage *moderatorIcon = [UIImage imageNamed:@"Crown"];
|
|
|
|
|
self.moderatorIconView.image = moderatorIcon;
|
|
|
|
|
self.moderatorIconView.hidden = !isModerator;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[self.contentView addSubview:self.moderatorIconView];
|
|
|
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
|
|
|
selector:@selector(otherUsersProfileDidChange:)
|
|
|
|
@ -385,6 +405,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
self.avatarView.image = nil;
|
|
|
|
|
[self.avatarView removeFromSuperview];
|
|
|
|
|
|
|
|
|
|
self.moderatorIconView.image = nil;
|
|
|
|
|
[self.moderatorIconView removeFromSuperview];
|
|
|
|
|
|
|
|
|
|
[self.sendFailureBadgeView removeFromSuperview];
|
|
|
|
|
self.sendFailureBadgeView = nil;
|
|
|
|
|
|
|
|
|
|