mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-24 16:28:05 -05:00
Add support for bot mode
References: https://ircv3.net/specs/extensions/bot-mode
This commit is contained in:
parent
8507500d74
commit
6b04cb1417
3 changed files with 12 additions and 0 deletions
|
@ -189,6 +189,10 @@ export default function BufferHeader(props) {
|
||||||
let desc = "This user is a server operator, they have administrator privileges.";
|
let desc = "This user is a server operator, they have administrator privileges.";
|
||||||
details.push(html`<abbr title=${desc}>server operator</abbr>`);
|
details.push(html`<abbr title=${desc}>server operator</abbr>`);
|
||||||
}
|
}
|
||||||
|
if (props.user.bot) {
|
||||||
|
let desc = "This user is an automated bot.";
|
||||||
|
details.push(html`<abbr title=${desc}>bot</abbr>`);
|
||||||
|
}
|
||||||
details = details.map((item, i) => {
|
details = details.map((item, i) => {
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
return item;
|
return item;
|
||||||
|
|
|
@ -474,6 +474,10 @@ export class Isupport {
|
||||||
}
|
}
|
||||||
return chanModes;
|
return chanModes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bot() {
|
||||||
|
return this.raw.get("BOT");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CaseMapping = {
|
export const CaseMapping = {
|
||||||
|
|
4
state.js
4
state.js
|
@ -454,6 +454,10 @@ export const State = {
|
||||||
if (who.flags !== undefined) {
|
if (who.flags !== undefined) {
|
||||||
who.away = who.flags.indexOf("G") >= 0; // H for here, G for gone
|
who.away = who.flags.indexOf("G") >= 0; // H for here, G for gone
|
||||||
who.operator = who.flags.indexOf("*") >= 0;
|
who.operator = who.flags.indexOf("*") >= 0;
|
||||||
|
let botFlag = client.isupport.bot();
|
||||||
|
if (botFlag) {
|
||||||
|
who.bot = who.flags.indexOf(botFlag) >= 0;
|
||||||
|
}
|
||||||
delete who.flags;
|
delete who.flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue