Kaynağa Gözat

Merge pull request #202 from deltachat/fix-timestamp

do not show timestamp if unknown
björn petersen 5 yıl önce
ebeveyn
işleme
470fabd2dd

+ 2 - 2
deltachat-ios/DC/Wrapper.swift

@@ -747,8 +747,8 @@ class DcLot {
         return swiftString
     }
 
-    var timestamp: Int {
-        return Int(dc_lot_get_timestamp(dcLotPointer))
+    var timestamp: Int64 {
+        return Int64(dc_lot_get_timestamp(dcLotPointer))
     }
 
     var state: Int {

+ 4 - 3
deltachat-ios/View/ContactCell.swift

@@ -209,10 +209,11 @@ class ContactCell: UITableViewCell {
         deliveryStatusIndicator.image = indicatorImage
     }
 
-    func setTimeLabel(_ timestamp: Int?) {
-        if let timestamp = timestamp {
+    func setTimeLabel(_ timestamp: Int64?) {
+        let timestamp = timestamp ?? 0
+        if timestamp != 0 {
             timeLabel.isHidden = false
-            timeLabel.text = DateUtils.getBriefRelativeTimeSpanString(timeStamp: timestamp)
+            timeLabel.text = DateUtils.getBriefRelativeTimeSpanString(timeStamp: Int(timestamp))
         } else {
             timeLabel.isHidden = true
             timeLabel.text = nil