Explorar o código

show fullMessageButton, if message has HTML

cyberta %!s(int64=4) %!d(string=hai) anos
pai
achega
4189f48567

+ 4 - 0
DcCore/DcCore/DC/Wrapper.swift

@@ -1015,6 +1015,10 @@ public class DcMsg {
         return dc_msg_is_setupmessage(messagePointer) == 1
     }
 
+    public var hasHtml: Bool {
+        return dc_msg_has_html(messagePointer) == 1
+    }
+
     public var setupCodeBegin: String {
         guard let cString = dc_msg_get_setupcodebegin(messagePointer) else { return "" }
         let swiftString = String(cString: cString)

+ 3 - 1
deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

@@ -219,7 +219,7 @@ public class BaseMessageCell: UITableViewCell {
 
         topCompactView = false
         bottomCompactView = false
-        isFullMessageButtonHidden = false
+        isFullMessageButtonHidden = true
         
 
         let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(onAvatarTapped))
@@ -297,6 +297,8 @@ public class BaseMessageCell: UITableViewCell {
             avatarView.isHidden = true
         }
 
+        isFullMessageButtonHidden = !msg.hasHtml
+
         messageBackgroundContainer.update(rectCorners: messageStyle,
                                           color: msg.isFromCurrentSender ? DcColors.messagePrimaryColor : DcColors.messageSecondaryColor)