diff --git a/Vector/Views/RoomBubbleList/Encryption/RoomOutgoingEncryptedTextMsgWithPaginationTitleBubbleCell.m b/Vector/Views/RoomBubbleList/Encryption/RoomOutgoingEncryptedTextMsgWithPaginationTitleBubbleCell.m index ba8a284d7..814a5fead 100644 --- a/Vector/Views/RoomBubbleList/Encryption/RoomOutgoingEncryptedTextMsgWithPaginationTitleBubbleCell.m +++ b/Vector/Views/RoomBubbleList/Encryption/RoomOutgoingEncryptedTextMsgWithPaginationTitleBubbleCell.m @@ -40,31 +40,7 @@ if (bubbleData) { // Set the right device info icon in front of each event - - // Ensure that older subviews are removed - // They should be (they are removed when the cell is not anymore used). - // But, it seems that is not always true. - NSArray* views = [self.encryptionStatusContainerView subviews]; - for(UIView* view in views) - { - [view removeFromSuperview]; - } - - for (MXKRoomBubbleComponent *component in bubbleData.bubbleComponents) - { - UIImage *icon = [RoomEncryptedDataBubbleCell encryptionIconForEvent:component.event andSession:bubbleData.mxSession]; - UIImageView *encryptStatusImageView = [[UIImageView alloc] initWithImage:icon]; - - CGRect frame = encryptStatusImageView.frame; - frame.origin.y = component.position.y + 3; - encryptStatusImageView.frame = frame; - - CGPoint center = encryptStatusImageView.center; - center.x = self.encryptionStatusContainerView.frame.size.width / 2; - encryptStatusImageView.center = center; - - [self.encryptionStatusContainerView addSubview:encryptStatusImageView]; - } + [RoomEncryptedDataBubbleCell addEncryptionStatusFromBubbleData:bubbleData inContainerView:self.encryptionStatusContainerView]; } }