mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-28 18:45:51 -05:00
Allow bouncers to set NETWORK in ISUPPORT
This allows bouncers to customize the name they appear with.
This commit is contained in:
parent
12440691c9
commit
d9f36c82ba
1 changed files with 15 additions and 10 deletions
25
state.js
25
state.js
|
@ -66,18 +66,23 @@ export function getMessageURL(buf, msg) {
|
|||
export function getServerName(server, bouncerNetwork, isBouncer) {
|
||||
let netName = server.isupport.get("NETWORK");
|
||||
|
||||
if (bouncerNetwork) {
|
||||
if (bouncerNetwork.name && bouncerNetwork.name !== bouncerNetwork.host) {
|
||||
// User has picked a custom name for the network, use that
|
||||
return bouncerNetwork.name;
|
||||
}
|
||||
return netName || bouncerNetwork.name || bouncerNetwork.host || "server";
|
||||
}
|
||||
if (isBouncer) {
|
||||
return "bouncer";
|
||||
if (bouncerNetwork && bouncerNetwork.name && bouncerNetwork.name !== bouncerNetwork.host) {
|
||||
// User has picked a custom name for the network, use that
|
||||
return bouncerNetwork.name;
|
||||
}
|
||||
|
||||
return netName || "server";
|
||||
if (netName) {
|
||||
// Server has specified a name
|
||||
return netName;
|
||||
}
|
||||
|
||||
if (bouncerNetwork) {
|
||||
return bouncerNetwork.name || bouncerNetwork.host || "server";
|
||||
} else if (isBouncer) {
|
||||
return "bouncer";
|
||||
} else {
|
||||
return "server";
|
||||
}
|
||||
}
|
||||
|
||||
function updateState(state, updater) {
|
||||
|
|
Loading…
Reference in a new issue