const { ipcRenderer } = require('electron') const { Channel } = require('./types') const $ = require('jquery') const got = require('got') const URL = require('url') const msg = require('./messages.js') const ANY_CHANNEL = 0 const VOICE_KIND = 1 const TEXT_KIND = 2 exports.ANY_CHANNEL = ANY_CHANNEL exports.VOICE_KIND = VOICE_KIND exports.TEXT_KIND = TEXT_KIND /** * Channel button id's have the format of ${hostname}:${channel['name']} * Helper function that literally just pushes out some bs to the DOM * * @param {String} server.hostname * @param {u16} server.port * @param {String} server.protocol * * @param {u64} user.id * @param {String} user.jwt * * @param {u64} channel.id * @param {String} channel.name * @param {String} channel.description * @param {i32} channel.kind */ function push(server, user, channel) { let remote = URL.parse(server.url) let chan_id = `${remote.hostname}:${channel['name']}` $('#channels-list').append( $('
  • ').append( $('

    ').append( $('