mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
Add support for IRCv3 setname
This commit is contained in:
parent
92535fae24
commit
12a38ace90
3 changed files with 22 additions and 1 deletions
12
commands.js
12
commands.js
|
@ -144,6 +144,18 @@ export default {
|
||||||
app.reconnect();
|
app.reconnect();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"setname": {
|
||||||
|
usage: "<realname>",
|
||||||
|
description: "Change current realname",
|
||||||
|
execute: (app, args) => {
|
||||||
|
var newRealname = args.join(" ");
|
||||||
|
var client = getActiveClient(app);
|
||||||
|
if (!client.enabledCaps["setname"]) {
|
||||||
|
throw new Error("Server doesn't support changing the realname");
|
||||||
|
}
|
||||||
|
client.send({ command: "SETNAME", params: [newRealname] });
|
||||||
|
},
|
||||||
|
},
|
||||||
"topic": {
|
"topic": {
|
||||||
usage: "<topic>",
|
usage: "<topic>",
|
||||||
description: "Change the topic of the current channel",
|
description: "Change the topic of the current channel",
|
||||||
|
|
|
@ -725,6 +725,12 @@ export default class App extends Component {
|
||||||
});
|
});
|
||||||
affectedBuffers.forEach((name) => this.addMessage(netID, name, msg));
|
affectedBuffers.forEach((name) => this.addMessage(netID, name, msg));
|
||||||
break;
|
break;
|
||||||
|
case "SETNAME":
|
||||||
|
this.setBufferState({ network: netID, name: msg.prefix.name }, (buf) => {
|
||||||
|
var who = { ...buf.who, realname: msg.params[0] };
|
||||||
|
return { who }
|
||||||
|
});
|
||||||
|
break;
|
||||||
case "TOPIC":
|
case "TOPIC":
|
||||||
var channel = msg.params[0];
|
var channel = msg.params[0];
|
||||||
var topic = msg.params[1];
|
var topic = msg.params[1];
|
||||||
|
|
|
@ -5,11 +5,14 @@ import * as irc from "./irc.js";
|
||||||
const permanentCaps = [
|
const permanentCaps = [
|
||||||
"away-notify",
|
"away-notify",
|
||||||
"batch",
|
"batch",
|
||||||
"draft/chathistory",
|
|
||||||
"echo-message",
|
"echo-message",
|
||||||
"message-tags",
|
"message-tags",
|
||||||
"multi-prefix",
|
"multi-prefix",
|
||||||
"server-time",
|
"server-time",
|
||||||
|
"setname",
|
||||||
|
|
||||||
|
"draft/chathistory",
|
||||||
|
|
||||||
"soju.im/bouncer-networks",
|
"soju.im/bouncer-networks",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue