updateMode method

Future<CtrlMessage> updateMode(
  1. String? userId,
  2. String update
)

Update access mode of the current user or of another topic subscriber

Implementation

Future<CtrlMessage> updateMode(String? userId, String update) {
  var user = userId != null && userId != '' ? subscriber(userId) : null;
  var am = user != null
      ? user.acs!.updateGiven(update).getGiven()
      : getAccessMode().updateWant(update).getWant();
  return setMeta(SetParams(sub: TopicSubscription(user: userId, mode: am)));
}