mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-10 10:16:41 +02:00
a9b3c77da3
Beforehand it only showed the dialog when quitting via the contextmenu. This also adds the possibility for the server to ask for dialogs.
24 lines
500 B
JavaScript
24 lines
500 B
JavaScript
"use strict";
|
|
|
|
exports.commands = ["quit"];
|
|
exports.allowDisconnected = true;
|
|
|
|
exports.input = function (network, chan, cmd, args) {
|
|
const client = this;
|
|
|
|
client.emit("confirm-dialog", {
|
|
title: "Remove network",
|
|
text: `Are you sure you want to quit and remove <b>${network.name}</b>? This cannot be undone.`,
|
|
button: "Remove network",
|
|
emit: {
|
|
target: "network:quit",
|
|
data: {
|
|
uuid: network.uuid,
|
|
quiteMessage: args[0] ? args.join(" ") : null,
|
|
},
|
|
},
|
|
});
|
|
|
|
return true;
|
|
};
|