67P/hyperchannel

View on GitHub
app/routes/channel.js

Summary

Maintainability
A
0 mins
Test Coverage
import BaseChannel from 'hyperchannel/routes/base_channel';

export default class ChannelRoute extends BaseChannel {

  createChannelOrUserChannel (account, channelId) {
    let channel;
    switch(account.protocol) {
      case 'IRC':
        channel = this.coms.createChannel(account, '#'+channelId.match(/^(.+)@/)[1]);
        break;
      case 'XMPP':
        channel = this.coms.createChannel(account, channelId);
        break;
    }
    return channel;
  }

}