addChannel method

String addChannel(
  1. String spaceId,
  2. String name,
  3. Map<String, String> access
)

Adds a text channel to spaceId that the principals of access see with their level, and its main thread; returns the channel ID.

Implementation

String addChannel(String spaceId, String name, Map<String, String> access) {
  final id = nextId();
  channels[id] = FakeChannel({
    'id': id,
    'space_id': spaceId,
    'kind': 'text',
    'name': name,
    'topic': '',
    'sort_key': 'a${channels.length}',
    'operator': _inheritOperator(spaceId),
    'read_only': false,
    'version': 1,
    'settings_version': 1,
    'created_at': stamp(),
  }, Map.of(access));
  return id;
}