processMetaSub method

void processMetaSub(
  1. List<TopicSubscription> subscriptions
)

Called by Tinode when meta.sub is received or in response to received

Implementation

void processMetaSub(List<TopicSubscription> subscriptions) {
  for (var sub in subscriptions) {
    TopicSubscription user;
    if (sub.deleted == null) {
      // If this is a change to user's own permissions, update them in topic too.
      // Desc will update 'me' topic.
      if (_tinodeService.isMe(sub.user!) && sub.acs != null) {
        processMetaDesc(TopicDescription(
          updated: sub.updated ?? DateTime.now(),
          touched: sub.updated,
          acs: sub.acs,
        ));
      }
      user = _updateCachedUser(sub.user!, sub)!;
    } else {
      _users.remove(sub.user);
      user = sub;
    }

    onMetaSub.add(user);
  }
}