File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,37 @@ open class IMMessage {
243243 }
244244}
245245
246+ extension IMMessage {
247+
248+ public func padding( unsafeFlutterObject: Any ) {
249+ guard let data = unsafeFlutterObject as? [ String : Any ] else {
250+ return
251+ }
252+ if let conversationId = data [ " conversationId " ] as? String {
253+ self . conversationID = conversationId
254+ }
255+ if let messageId = data [ " id " ] as? String {
256+ self . ID = messageId
257+ }
258+ if let from = data [ " from " ] as? String {
259+ self . fromClientID = from
260+ }
261+ if let timestamp = data [ " timestamp " ] as? Int {
262+ self . sentTimestamp = Int64 ( timestamp)
263+ }
264+ if let ackAt = data [ " ackAt " ] as? Int {
265+ self . deliveredTimestamp = Int64 ( ackAt)
266+ }
267+ if let readAt = data [ " readAt " ] as? Int {
268+ self . readTimestamp = Int64 ( readAt)
269+ }
270+ if let _ = self . ID,
271+ let _ = self . sentTimestamp {
272+ self . underlyingStatus = . sent
273+ }
274+ }
275+ }
276+
246277var IMCategorizedMessageTypeMap : [ Int : IMCategorizedMessage . Type ] = [
247278 IMCategorizedMessage . ReservedType. none. rawValue: IMCategorizedMessage . self,
248279 IMCategorizedMessage . ReservedType. text. rawValue: IMTextMessage . self,
You can’t perform that action at this time.
0 commit comments