Merge branch 'release/2.32.0'
This commit is contained in:
commit
eb96eec94a
|
@ -52,6 +52,7 @@ def main():
|
||||||
'2.29.0.11',
|
'2.29.0.11',
|
||||||
'2.30.0.0',
|
'2.30.0.0',
|
||||||
'2.30.0.1',
|
'2.30.0.1',
|
||||||
|
'2.30.2.0',
|
||||||
'3.0',
|
'3.0',
|
||||||
'3.0.1',
|
'3.0.1',
|
||||||
'3.0.2',
|
'3.0.2',
|
||||||
|
|
|
@ -4142,6 +4142,7 @@ typedef enum : NSUInteger {
|
||||||
|
|
||||||
[self updateLastVisibleTimestamp];
|
[self updateLastVisibleTimestamp];
|
||||||
self.conversationStyle.viewWidth = self.collectionView.width;
|
self.conversationStyle.viewWidth = self.collectionView.width;
|
||||||
|
[self.collectionView.collectionViewLayout invalidateLayout];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - View Items
|
#pragma mark - View Items
|
||||||
|
|
|
@ -504,14 +504,16 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
||||||
UIImage *avatarImage = (localProfileAvatarImage
|
UIImage *avatarImage = (localProfileAvatarImage
|
||||||
?: [[[OWSContactAvatarBuilder alloc] initForLocalUserWithDiameter:kAvatarSize] buildDefaultImage]);
|
?: [[[OWSContactAvatarBuilder alloc] initForLocalUserWithDiameter:kAvatarSize] buildDefaultImage]);
|
||||||
OWSAssertDebug(avatarImage);
|
OWSAssertDebug(avatarImage);
|
||||||
AvatarImageView *avatarView = [[AvatarImageView alloc] initWithImage:avatarImage];
|
|
||||||
[avatarView autoSetDimension:ALDimensionWidth toSize:kAvatarSize];
|
UIButton *avatarButton = [AvatarImageButton buttonWithType:UIButtonTypeCustom];
|
||||||
[avatarView autoSetDimension:ALDimensionHeight toSize:kAvatarSize];
|
[avatarButton addTarget:self
|
||||||
avatarView.userInteractionEnabled = YES;
|
action:@selector(settingsButtonPressed:)
|
||||||
[avatarView
|
forControlEvents:UIControlEventTouchUpInside];
|
||||||
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
|
[avatarButton setImage:avatarImage forState:UIControlStateNormal];
|
||||||
action:@selector(settingsButtonPressed:)]];
|
[avatarButton autoSetDimension:ALDimensionWidth toSize:kAvatarSize];
|
||||||
settingsButton = [[UIBarButtonItem alloc] initWithCustomView:avatarView];
|
[avatarButton autoSetDimension:ALDimensionHeight toSize:kAvatarSize];
|
||||||
|
|
||||||
|
settingsButton = [[UIBarButtonItem alloc] initWithCustomView:avatarButton];
|
||||||
} else {
|
} else {
|
||||||
// iOS 9 and 10 have a bug around layout of custom views in UIBarButtonItem,
|
// iOS 9 and 10 have a bug around layout of custom views in UIBarButtonItem,
|
||||||
// so we just use a simple icon.
|
// so we just use a simple icon.
|
||||||
|
|
|
@ -178,3 +178,59 @@ public class ConversationAvatarImageView: AvatarImageView {
|
||||||
self.image = OWSAvatarBuilder.buildImage(thread: thread, diameter: diameter)
|
self.image = OWSAvatarBuilder.buildImage(thread: thread, diameter: diameter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public class AvatarImageButton: UIButton {
|
||||||
|
private let shadowLayer = CAShapeLayer()
|
||||||
|
|
||||||
|
// MARK: - Button Overrides
|
||||||
|
|
||||||
|
override public func layoutSubviews() {
|
||||||
|
super.layoutSubviews()
|
||||||
|
|
||||||
|
layer.cornerRadius = frame.size.width / 2
|
||||||
|
|
||||||
|
// Inner shadow.
|
||||||
|
// This should usually not be visible; it is used to distinguish
|
||||||
|
// profile pics from the background if they are similar.
|
||||||
|
shadowLayer.frame = bounds
|
||||||
|
shadowLayer.masksToBounds = true
|
||||||
|
let shadowBounds = bounds
|
||||||
|
let shadowPath = UIBezierPath(ovalIn: shadowBounds)
|
||||||
|
// This can be any value large enough to cast a sufficiently large shadow.
|
||||||
|
let shadowInset: CGFloat = -3
|
||||||
|
shadowPath.append(UIBezierPath(rect: shadowBounds.insetBy(dx: shadowInset, dy: shadowInset)))
|
||||||
|
// This can be any color since the fill should be clipped.
|
||||||
|
shadowLayer.fillColor = UIColor.black.cgColor
|
||||||
|
shadowLayer.path = shadowPath.cgPath
|
||||||
|
shadowLayer.fillRule = kCAFillRuleEvenOdd
|
||||||
|
shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor
|
||||||
|
shadowLayer.shadowRadius = 0.5
|
||||||
|
shadowLayer.shadowOpacity = 0.15
|
||||||
|
shadowLayer.shadowOffset = .zero
|
||||||
|
}
|
||||||
|
|
||||||
|
override public func setImage(_ image: UIImage?, for state: UIControlState) {
|
||||||
|
ensureViewConfigured()
|
||||||
|
super.setImage(image, for: state)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: Private
|
||||||
|
|
||||||
|
var hasBeenConfigured = false
|
||||||
|
func ensureViewConfigured() {
|
||||||
|
guard !hasBeenConfigured else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
hasBeenConfigured = true
|
||||||
|
|
||||||
|
autoPinToSquareAspectRatio()
|
||||||
|
|
||||||
|
layer.minificationFilter = kCAFilterTrilinear
|
||||||
|
layer.magnificationFilter = kCAFilterTrilinear
|
||||||
|
layer.masksToBounds = true
|
||||||
|
layer.addSublayer(shadowLayer)
|
||||||
|
|
||||||
|
contentMode = .scaleToFill
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
|
||||||
OWSFailDebug(@"Missing path for attachment.");
|
OWSFailDebug(@"Missing path for attachment.");
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
OWSLogInfo(@"Writing attachment to file: %@", filePath);
|
OWSLogDebug(@"Writing attachment to file: %@", filePath);
|
||||||
return [data writeToFile:filePath options:0 error:error];
|
return [data writeToFile:filePath options:0 error:error];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
|
||||||
OWSFailDebug(@"Missing path for attachment.");
|
OWSFailDebug(@"Missing path for attachment.");
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
OWSLogInfo(@"Writing attachment to file: %@", filePath);
|
OWSLogDebug(@"Writing attachment to file: %@", filePath);
|
||||||
return [dataSource writeToPath:filePath];
|
return [dataSource writeToPath:filePath];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,10 @@ public class TypingIndicatorsImpl: NSObject, TypingIndicators {
|
||||||
public func typingRecipientId(forThread thread: TSThread) -> String? {
|
public func typingRecipientId(forThread thread: TSThread) -> String? {
|
||||||
AssertIsOnMainThread()
|
AssertIsOnMainThread()
|
||||||
|
|
||||||
|
guard areTypingIndicatorsEnabled() else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var firstRecipientId: String?
|
var firstRecipientId: String?
|
||||||
var firstTimestamp: UInt64?
|
var firstTimestamp: UInt64?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue