Determine if a channel is internal.
Source
bool isInternal() {
String cName = channelName();
if (!cName.startsWith('sofia/')) {
throw new ArgumentError('only sofia channels are supported. Got: $cName');
}
String profile = cName.split('/')[1];
if (profile == 'internal') {
return true;
} else if (profile == 'external') {
return false;
}
throw new ArgumentError(
'Failed to detect profile in channel name \'$cName\'.');
}