Method code for $channel_ui.channel_members()

[Turn on line numbering]
arg channel, @full;
var q, members, name, who, line;

members = [];
[(full ?= 0)] = full;
if (full) {
    line = "All members of channel " + channel + " ('*'=listening, '!'=not connected):";
    who = $user_db.user_dbrefs();
} else {
    line = "Connected members of channel " + channel + " ('*'=listening):";
    who = $user_db.connected();
}
for q in (who) {
    if (!valid(q))
        continue;
    if (q.channel_member(channel)) {
        if (q.connected())
            name = " " + q.name();
        else
            name = "!" + q.name();
        if (q.listen_channel(channel))
            members += ["*" + name];
        else
            members += [" " + name];
    }
}
return [line] + members.vcolumnize(4, .linelen() - 4).prefix("    ") + ["---"];

// Created 24-Jul-1996 as a part of ColdCore, see: @help Credit

Tlon