lib/irc: add formatURL
This commit is contained in:
parent
57809be989
commit
57f64e9cc2
4 changed files with 18 additions and 16 deletions
11
lib/irc.js
11
lib/irc.js
|
@ -839,6 +839,17 @@ export function parseURL(str) {
|
|||
return { host, enttype, entity };
|
||||
}
|
||||
|
||||
export function formatURL({ host, enttype, entity } = {}) {
|
||||
host = host || "";
|
||||
entity = entity || "";
|
||||
|
||||
let s = "irc://" + host + "/" + encodeURIComponent(entity);
|
||||
if (enttype) {
|
||||
s += ",is" + enttype;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
export class CapRegistry {
|
||||
available = new Map();
|
||||
enabled = new Set();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue