Bläddra i källkod

fix links in messages containing images, videos or files (#607)

cyberta 5 år sedan
förälder
incheckning
761ccd1ca9
1 ändrade filer med 9 tillägg och 5 borttagningar
  1. 9 5
      deltachat-ios/MessageKit/Views/Cells/TextMediaMessageCell.swift

+ 9 - 5
deltachat-ios/MessageKit/Views/Cells/TextMediaMessageCell.swift

@@ -175,10 +175,14 @@ open class TextMediaMessageCell: MessageContentCell {
         }
     }
 
-      /// Used to handle the cell's contentView's tap gesture.
-      /// Return false when the contentView does not need to handle the gesture.
-      open override func cellContentView(canHandle touchPoint: CGPoint) -> Bool {
-          return messageLabel.handleGesture(touchPoint)
-      }
+    /// Used to handle the cell's contentView's tap gesture.
+    /// Return false when the contentView does not need to handle the gesture.
+    open override func cellContentView(canHandle touchPoint: CGPoint) -> Bool {
+        if !imageView.isHidden {
+            let touchPointWithoutImageHeight = CGPoint(x: touchPoint.x, y: touchPoint.y - imageView.frame.height)
+            return messageLabel.handleGesture(touchPointWithoutImageHeight)
+        }
+        return messageLabel.handleGesture(touchPoint)
+    }
 
 }