adds a channel, but must have authenication
513344
def delete_channel(self, channel, pwd_hash):
        
        if channel.pwd_hash == pwd_hash:
            self.channels.remove(channel)
            lg.record_process('comms.py', 'Removed channel ' + channel.name)

            return True
        else:
            lg.record_process('comms.py', 'ERROR - Cant delete : wrong hash for  ' + channel.name)
            return False
861909
def add_channels(self, channels):
        
        chans = [
            SockChannel(chan, res, self._generate_result)
            for chan, res in channels.items()
        ]
        self.api.channels.extend(chans)
        self.api.connect_channels(chans)
333792
function(channel, subscription, context, once) {
      if (!channels[channel]) channels[channel] = [];
      channels[channel].push({fn: subscription, context: context || this, once: once});
    }
274215
def do_add_auth(self, params):
        
        self._zk.add_auth(params.scheme, params.credential)
593632
function newChannel() {
  let chan = new Channel();
  let result = chan.send.bind(chan);
  result._inst = chan;
  return result;
}
532471
def create_channel(self, channel):
        

        data = {'channels': channel}
        return super(ApiInterfaceRequest, self).post('api/v3/channel/', data)
792760
def io_add_watch(*args, **kwargs):
    """"""
    channel, priority, condition, func, user_data = _io_add_watch_get_args(*args, **kwargs)
    return GLib.io_add_watch(channel, priority, condition, func, *user_data)
572170
def add_client(self, user_id=None):
        
        if user_id is None:
            # generate a random uuid if it's an unauthenticated client
            self.channel = 'public'
            user_id = uuid.uuid1().hex
        else:
            self.channel = 'private'
        
        self.id = user_id
        self.channels[self.channel][self.id] = self
        print 'Client connected to the %s channel.' % self.channel
864329
def Channel(channel)
      return channel if channel.is_a?(Channel)
      bot.channel_list.find_ensured(channel)
    end
384636
def _add_channel_names(client, e):
        

        chan = IRCstr(e.channel)
        names = set([IRCstr(n) for n in e.name_list])
        client.channels[chan] = SeshetChannel(chan, names)
164512
def channels_kick(self, room_id, user_id, **kwargs):
        """"""
        return self.__call_api_post('channels.kick', roomId=room_id, userId=user_id, kwargs=kwargs)
985245
private void addChannel(Channel chan) {
        if (channelList == null) {
            channelList = new Channel[1];
            channelList[0] = chan;
        } else {
            Channel[] oldList = channelList;
            channelList = new Channel[oldList.length + 1];
            System.arraycopy(oldList, 0, channelList, 0, oldList.length);
            channelList[oldList.length] = chan;
        }
    }
561602
def show_channel(self, channel, owner):
        '''
        '''
        url = '%s/channels/%s/%s' % (self.domain, owner, channel)

        res = self.session.get(url)
        self._check_response(res, [200])
        return res.json()
909097
private void putChannel(final StoredClientChannel channel, boolean updateWallet) {
        lock.lock();
        try {
            mapChannels.put(channel.id, channel);
            channelTimeoutHandler.schedule(new TimerTask() {
                @Override
                public void run() {
                    try {
                        TransactionBroadcaster announcePeerGroup = getAnnouncePeerGroup();
                        removeChannel(channel);
                        announcePeerGroup.broadcastTransaction(channel.contract);
                        announcePeerGroup.broadcastTransaction(channel.refund);
                    } catch (Exception e) {
                        // Something went wrong closing the channel - we catch
                        // here or else we take down the whole Timer.
                        log.error("Auto-closing channel failed", e);
                    }
                }
                // Add the difference between real time and Utils.now() so that test-cases can use a mock clock.
            }, new Date(channel.expiryTimeSeconds() * 1000 + (System.currentTimeMillis() - Utils.currentTimeMillis())));
        } finally {
            lock.unlock();
        }
        if (updateWallet)
            updatedChannel(channel);
    }
922168
function importAuthCodes(channel, codes, settings) {
    var authDir, outFile, outFileBak;

    channel.registry.importClients(codes);

    authDir = settings.authDir;
    if (settings.dumpCodes !== false) {
        outFile = settings.outFile || 'codes.imported.csv';
        if (!path.isAbsolute(outFile)) {
            outFile = path.join(settings.authDir, outFile);
        }
        outFileBak = outFile + '.bak';

        fs.rename(outFile, outFileBak, function() {
            var NDDB, db;
            NDDB = require('NDDB').NDDB;
            db = new NDDB();
            db.importDB(codes);
            // Async function. Throws errors.
            db.save(outFile);
        });
    }

    // Not needed anymore.
    delete settings.authDir;
}
24164
def channels_add_all(self, room_id, **kwargs):
        """"""
        return self.__call_api_post('channels.addAll', roomId=room_id, kwargs=kwargs)
1354072
def update_channel(self, channel):
        

        data = {'channels': channel}
        return super(ApiInterfaceRequest, self).put('api/v3/channel/', data)