fromMessage static method

TopicSubscription fromMessage(
  1. Map<String, dynamic> msg
)

Implementation

static TopicSubscription fromMessage(Map<String, dynamic> msg) {
  return TopicSubscription(
    user: msg['user'],
    updated: msg['updated'] != null ? DateTime.parse(msg['updated']) : null,
    touched: msg['touched'] != null ? DateTime.parse(msg['touched']) : null,
    deleted: msg['deleted'] != null ? DateTime.parse(msg['deleted']) : null,
    created: msg['created'] != null ? DateTime.parse(msg['created']) : null,
    acs: msg['acs'] != null ? AccessMode(msg['acs']) : null,
    read: msg['read'],
    recv: msg['recv'],
    clear: msg['clear'],
    public: msg['public'],
    private: msg['private'],
    online: msg['online'],
    topic: msg['topic'],
    seq: msg['seq'],
    seen: msg['seen'] != null ? Seen.fromMessages(msg['seen']) : null,
    noForwarding: msg['noForwarding'] ?? false,
    mode: msg['mode'],
  );
}