[WIP] Message auto-delete and widget

This commit is contained in:
Ali
2021-02-09 22:55:41 +04:00
parent d7538bf131
commit 3880af10ae
38 changed files with 1009 additions and 766 deletions

View File

@@ -54,6 +54,18 @@ public extension WidgetDataPeer.Message {
break
}
}
self.init(text: message.text, content: content, timestamp: message.timestamp)
var author: Author?
if let _ = message.peers[message.id.peerId] as? TelegramGroup {
if let authorPeer = message.author {
author = Author(isMe: false, title: authorPeer.debugDisplayTitle)
}
} else if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .group = channel.info {
if let authorPeer = message.author {
author = Author(isMe: false, title: authorPeer.debugDisplayTitle)
}
}
self.init(author: author, text: message.text, content: content, timestamp: message.timestamp)
}
}