"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setDefaultChannelAvatar = exports.setDefaultVideoChannel = void 0;
const tslib_1 = require("tslib");
function setDefaultVideoChannel(servers) {
    const tasks = [];
    for (const server of servers) {
        const p = server.users.getMyInfo()
            .then(user => { server.store.channel = user.videoChannels[0]; });
        tasks.push(p);
    }
    return Promise.all(tasks);
}
exports.setDefaultVideoChannel = setDefaultVideoChannel;
function setDefaultChannelAvatar(serversArg, channelName = 'root_channel') {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const servers = Array.isArray(serversArg)
            ? serversArg
            : [serversArg];
        for (const server of servers) {
            yield server.channels.updateImage({ channelName, fixture: 'avatar.png', type: 'avatar' });
        }
    });
}
exports.setDefaultChannelAvatar = setDefaultChannelAvatar;
//# sourceMappingURL=channels.js.map