mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 04:23:13 +00:00
a54a726e93
Co-Authored-By: Max Leiter <hello@maxleiter.com>
26 lines
603 B
JavaScript
26 lines
603 B
JavaScript
"use strict";
|
|
|
|
const $ = require("jquery");
|
|
|
|
exports.input = function(args) {
|
|
console.log(args);
|
|
const channel = args[0];
|
|
const utils = require("../utils");
|
|
const socket = require("../socket");
|
|
const {vueApp} = require("../vue");
|
|
|
|
if (channel) {
|
|
const chan = utils.findCurrentNetworkChan(channel);
|
|
|
|
if (chan) {
|
|
$(`#sidebar .chan[data-id="${chan.id}"]`).trigger("click");
|
|
}
|
|
} else if (vueApp.activeChannel.channel.type === "channel") {
|
|
socket.emit("input", {
|
|
target: vueApp.activeChannel.channel.id,
|
|
text: `/join ${vueApp.activeChannel.channel.name}`,
|
|
});
|
|
|
|
return true;
|
|
}
|
|
};
|