Explorar o código

removed table reloading

nayooti %!s(int64=5) %!d(string=hai) anos
pai
achega
118635486f

+ 0 - 7
deltachat-ios/Controller/ChatViewController.swift

@@ -561,7 +561,6 @@ class ChatViewController: MessagesViewController {
         case .photo, .video:
         case .photo, .video:
             let cell = messagesCollectionView.dequeueReusableCell(MediaMessageCell.self, for: indexPath)
             let cell = messagesCollectionView.dequeueReusableCell(MediaMessageCell.self, for: indexPath)
             cell.configure(with: message, at: indexPath, and: messagesCollectionView)
             cell.configure(with: message, at: indexPath, and: messagesCollectionView)
-            cell.asyncDelegate = self
             return cell
             return cell
         case .photoText, .videoText:
         case .photoText, .videoText:
             let cell = messagesCollectionView.dequeueReusableCell(TextMediaMessageCell.self, for: indexPath)
             let cell = messagesCollectionView.dequeueReusableCell(TextMediaMessageCell.self, for: indexPath)
@@ -1505,9 +1504,3 @@ extension MessageCollectionViewCell {
         }
         }
     }
     }
 }
 }
-
-extension ChatViewController: AsyncContentLoadDelegate {
-    func contentDidLoad() {
-        messagesCollectionView.reloadData()
-    }
-}

+ 0 - 8
deltachat-ios/MessageKit/Views/Cells/MediaMessageCell.swift

@@ -22,17 +22,11 @@
  SOFTWARE.
  SOFTWARE.
  */
  */
 
 
-protocol AsyncContentLoadDelegate: class {
-    func contentDidLoad()
-}
-
 import UIKit
 import UIKit
 
 
 /// A subclass of `MessageContentCell` used to display video and audio messages.
 /// A subclass of `MessageContentCell` used to display video and audio messages.
 open class MediaMessageCell: MessageContentCell {
 open class MediaMessageCell: MessageContentCell {
 
 
-    weak var asyncDelegate: AsyncContentLoadDelegate?
-
     /// The play button view to display on video messages.
     /// The play button view to display on video messages.
     open lazy var playButtonView: PlayButtonView = {
     open lazy var playButtonView: PlayButtonView = {
         let playButtonView = PlayButtonView()
         let playButtonView = PlayButtonView()
@@ -66,7 +60,6 @@ open class MediaMessageCell: MessageContentCell {
     open override func prepareForReuse() {
     open override func prepareForReuse() {
         super.prepareForReuse()
         super.prepareForReuse()
         self.imageView.image = nil
         self.imageView.image = nil
-        self.asyncDelegate = nil
     }
     }
 
 
     open override func configure(with message: MessageType, at indexPath: IndexPath, and messagesCollectionView: MessagesCollectionView) {
     open override func configure(with message: MessageType, at indexPath: IndexPath, and messagesCollectionView: MessagesCollectionView) {
@@ -89,7 +82,6 @@ open class MediaMessageCell: MessageContentCell {
                     imageView.loadVideoThumbnail(from: url, placeholderImage: mediaItem.placeholderImage, completionHandler: { [weak self] thumbnail in
                     imageView.loadVideoThumbnail(from: url, placeholderImage: mediaItem.placeholderImage, completionHandler: { [weak self] thumbnail in
                         if let image = thumbnail {
                         if let image = thumbnail {
                             self?.cache(thumbnail: image, key: url.absoluteString)
                             self?.cache(thumbnail: image, key: url.absoluteString)
-                            self?.asyncDelegate?.contentDidLoad()
                         }
                         }
                     })
                     })
                 }
                 }