|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
#import "Environment.h"
|
|
|
|
|
#import "FingerprintViewController.h"
|
|
|
|
|
#import "NewGroupViewController.h"
|
|
|
|
|
#import "OWSAnyTouchGestureRecognizer.h"
|
|
|
|
|
#import "OWSAvatarBuilder.h"
|
|
|
|
|
#import "OWSBlockingManager.h"
|
|
|
|
|
#import "OWSContactsManager.h"
|
|
|
|
@ -42,6 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
@property (nonatomic, readonly) OWSMessageSender *messageSender;
|
|
|
|
|
@property (nonatomic, readonly) OWSBlockingManager *blockingManager;
|
|
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) UIImageView *avatarView;
|
|
|
|
|
@property (nonatomic, readonly) UILabel *disappearingMessagesDurationLabel;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
@ -500,6 +502,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
OWSAssert(avatar);
|
|
|
|
|
const CGFloat kAvatarSize = 68.f;
|
|
|
|
|
UIImageView *avatarView = [[UIImageView alloc] initWithImage:avatar];
|
|
|
|
|
_avatarView = avatarView;
|
|
|
|
|
avatarView.layer.borderColor = UIColor.clearColor.CGColor;
|
|
|
|
|
avatarView.layer.masksToBounds = YES;
|
|
|
|
|
avatarView.layer.cornerRadius = kAvatarSize / 2.0f;
|
|
|
|
@ -543,9 +546,39 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
[threadTitleLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[firstSectionHeader
|
|
|
|
|
addGestureRecognizer:[[OWSAnyTouchGestureRecognizer alloc] initWithTarget:self
|
|
|
|
|
action:@selector(conversationNameTouched:)]];
|
|
|
|
|
firstSectionHeader.userInteractionEnabled = YES;
|
|
|
|
|
for (UIView *subview in firstSectionHeader.subviews) {
|
|
|
|
|
subview.userInteractionEnabled = NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return firstSectionHeader;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)conversationNameTouched:(UIGestureRecognizer *)sender
|
|
|
|
|
{
|
|
|
|
|
if (sender.state == UIGestureRecognizerStateBegan || sender.state == UIGestureRecognizerStateRecognized) {
|
|
|
|
|
if (self.isGroupThread) {
|
|
|
|
|
NewGroupViewController *newGroupViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:NULL]
|
|
|
|
|
instantiateViewControllerWithIdentifier:@"NewGroupViewController"];
|
|
|
|
|
[newGroupViewController configWithThread:(TSGroupThread *)self.thread];
|
|
|
|
|
|
|
|
|
|
CGPoint location = [sender locationInView:self.avatarView];
|
|
|
|
|
if (CGRectContainsPoint(self.avatarView.bounds, location)) {
|
|
|
|
|
newGroupViewController.shouldEditAvatarOnAppear = YES;
|
|
|
|
|
} else {
|
|
|
|
|
newGroupViewController.shouldEditGroupNameOnAppear = YES;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[self.navigationController pushViewController:newGroupViewController animated:YES];
|
|
|
|
|
} else {
|
|
|
|
|
// TODO: Edit 1:1 contact.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIImageView *)viewForIconWithName:(NSString *)iconName
|
|
|
|
|
{
|
|
|
|
|
UIImage *icon = [UIImage imageNamed:iconName];
|
|
|
|
|