|
|
|
|
@ -329,8 +329,11 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
[self setNavigationTitle];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Reload all cells.
|
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
|
if (self.isGroupConversation) {
|
|
|
|
|
// Reload all cells if this is a group conversation,
|
|
|
|
|
// since we may need to update the sender names on the messages.
|
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -633,10 +636,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
- (void)resetContentAndLayout
|
|
|
|
|
{
|
|
|
|
|
// Avoid layout corrupt issues and out-of-date message subtitles.
|
|
|
|
|
[self.collectionView.collectionViewLayout
|
|
|
|
|
invalidateLayoutWithContext:[JSQMessagesCollectionViewFlowLayoutInvalidationContext context]];
|
|
|
|
|
[self.collectionView.collectionViewLayout invalidateLayout];
|
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
|
|
|
|
|
|
// TODO: Should we evacuate cached cell sizes here?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1369,7 +1370,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
|
|
|
|
|
#pragma mark - Dynamic Text
|
|
|
|
|
|
|
|
|
|
// TODO: Fix this.
|
|
|
|
|
/**
|
|
|
|
|
Called whenever the user manually changes the dynamic type options inside Settings.
|
|
|
|
|
|
|
|
|
|
@ -1377,9 +1377,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
*/
|
|
|
|
|
- (void)didChangePreferredContentSize:(NSNotification *)notification
|
|
|
|
|
{
|
|
|
|
|
// [self.collectionView.collectionViewLayout setMessageBubbleFont:[UIFont ows_dynamicTypeBodyFont]];
|
|
|
|
|
DDLogInfo(@"%@ didChangePreferredContentSize", self.tag);
|
|
|
|
|
|
|
|
|
|
// Evacuate cached cell sizes.
|
|
|
|
|
for (ConversationViewItem *viewItem in self.viewItems) {
|
|
|
|
|
[viewItem clearCachedLayoutState];
|
|
|
|
|
}
|
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
|
// [self reloadInputToolbarSizeIfNeeded];
|
|
|
|
|
[self.inputToolbar updateFontSizes];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Actions
|
|
|
|
|
@ -2792,6 +2797,11 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
// may need to extend the mapping's contents to reflect the current
|
|
|
|
|
// range.
|
|
|
|
|
[self updateMessageMappingRangeOptions:MessagesRangeSizeMode_Normal];
|
|
|
|
|
// Calling resetContentAndLayout is a bit expensive.
|
|
|
|
|
// Since by definition this won't affect any cells in the previous
|
|
|
|
|
// range, it should be sufficient to call invalidateLayout.
|
|
|
|
|
//
|
|
|
|
|
// TODO: Investigate whether we can just call invalidateLayout.
|
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -3579,7 +3589,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
[groupMemberIds addObject:[TSAccountManager localNumber]];
|
|
|
|
|
groupModel.groupMemberIds = [NSMutableArray arrayWithArray:[groupMemberIds allObjects]];
|
|
|
|
|
[self updateGroupModelTo:groupModel successCompletion:nil];
|
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)popAllConversationSettingsViews
|
|
|
|
|
@ -3668,20 +3677,12 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|
|
|
|
[self toggleDefaultKeyboard];
|
|
|
|
|
}
|
|
|
|
|
[self clearDraft];
|
|
|
|
|
[self finishSendingMessage];
|
|
|
|
|
[self.inputToolbar clearTextMessage];
|
|
|
|
|
if (didAddToProfileWhitelist) {
|
|
|
|
|
[self ensureDynamicInteractions];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)finishSendingMessage
|
|
|
|
|
{
|
|
|
|
|
[self.inputToolbar clearTextMessage];
|
|
|
|
|
[self.collectionView.collectionViewLayout
|
|
|
|
|
invalidateLayoutWithContext:[JSQMessagesCollectionViewFlowLayoutInvalidationContext context]];
|
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)voiceMemoGestureDidStart
|
|
|
|
|
{
|
|
|
|
|
OWSAssert([NSThread isMainThread]);
|
|
|
|
|
|