Procházet zdrojové kódy

show subject in html-view, if available

B. Petersen před 4 roky
rodič
revize
e0f61db712

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

@@ -875,6 +875,13 @@ public class DcMsg {
         }
     }
 
+    public var subject: String {
+        guard let cString = dc_msg_get_subject(messagePointer) else { return "" }
+        let swiftString = String(cString: cString)
+        dc_str_unref(cString)
+        return swiftString
+    }
+
     public var quoteText: String? {
         guard let cString = dc_msg_get_quoted_text(messagePointer) else { return nil }
         let swiftString = String(cString: cString)

+ 7 - 1
deltachat-ios/Controller/FullMessageViewController.swift

@@ -42,7 +42,13 @@ class FullMessageViewController: WebViewViewController {
 
     override func viewDidLoad() {
         super.viewDidLoad()
-        self.title = String.localized("chat_input_placeholder")
+
+        var title = DcMsg(id: messageId).subject
+        if title.isEmpty {
+            title = String.localized("chat_input_placeholder")
+        }
+        self.title = title;
+
         self.navigationItem.rightBarButtonItem = loadButton
     }