Add encryption badge

This commit is contained in:
ismailgulek
2020-09-15 12:13:30 +03:00
parent 92ff249436
commit 509fe021d5
4 changed files with 30 additions and 0 deletions
@@ -85,6 +85,23 @@ final class RoomCreationEventsModalViewModel: RoomCreationEventsModalViewModelTy
avatarImageView.image = avatarImage
}
}
func setEncryptionIcon(in imageView: UIImageView) {
guard let summary = session.roomSummary(withRoomId: roomState.roomId) else {
imageView.image = nil
imageView.isHidden = true
return
}
if (summary.isEncrypted)
{
imageView.isHidden = false
imageView.image = EncryptionTrustLevelBadgeImageHelper.roomBadgeImage(for: summary.roomEncryptionTrustLevel())
}
else
{
imageView.isHidden = true
}
}
// MARK: - Setup