Skip to content

Commit

Permalink
fix semantics regarding avatarPlaceholderImage and avatarHighlightedI…
Browse files Browse the repository at this point in the history
…mage. close jessesquires#624
  • Loading branch information
jessesquires committed Nov 24, 2014
1 parent 81488d5 commit 512d2a9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions JSQMessagesViewController/Controllers/JSQMessagesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,16 @@ - (UICollectionViewCell *)collectionView:(JSQMessagesCollectionView *)collection
if (needsAvatar) {
avatarImageDataSource = [collectionView.dataSource collectionView:collectionView avatarImageDataForItemAtIndexPath:indexPath];
if (avatarImageDataSource != nil) {
cell.avatarImageView.image = [avatarImageDataSource avatarImage] ?: [avatarImageDataSource avatarPlaceholderImage];
cell.avatarImageView.highlightedImage = [avatarImageDataSource avatarHighlightedImage];

UIImage *avatarImage = [avatarImageDataSource avatarImage];
if (avatarImage == nil) {
cell.avatarImageView.image = [avatarImageDataSource avatarPlaceholderImage];
cell.avatarImageView.highlightedImage = nil;
}
else {
cell.avatarImageView.image = avatarImage;
cell.avatarImageView.highlightedImage = [avatarImageDataSource avatarHighlightedImage];
}
}
}

Expand Down

0 comments on commit 512d2a9

Please sign in to comment.