Fix incorrect GIF message bubble sizing (#1300)

TSAnimatedAdapter is used when rendering GIFs. TSAnimatedAdapter
inherits from JSQMediaItem but does not provide a custom implementation
of the hash method. The default implementation of hash in JSQMediaItem
results in all messages of a given interaction type (incoming,
outgoing) sharing a cached bubble size. For this reason, JSQMediaItem
subclasses are required to implement hash (see
https://github.com/jessesquires/JSQMessagesViewController/issues/631).

This commit fixes issue #1275 by implementing hash in TSAnimatedAdapter
the same way TSPhotoAdapter does.
pull/1/head
Adam Stiles 9 years ago committed by Michael Kirk
parent 6120bd9e8e
commit 52861a6ef5

@ -56,6 +56,13 @@
_cachedImageView = nil;
}
#pragma mark - NSObject
- (NSUInteger)hash
{
return super.hash ^ self.image.hash;
}
#pragma mark - JSQMessageMediaData protocol
- (UIView *)mediaView {

Loading…
Cancel
Save