mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-13 07:48:37 +01:00
Treat server broadcasts as highlights
This commit is contained in:
parent
095006e961
commit
bc05fd5c11
@ -349,7 +349,9 @@ export default class App extends Component {
|
|||||||
addMessage(serverID, bufName, msg) {
|
addMessage(serverID, bufName, msg) {
|
||||||
let client = this.clients.get(serverID);
|
let client = this.clients.get(serverID);
|
||||||
|
|
||||||
msg.isHighlight = irc.isHighlight(msg, client.nick, client.cm);
|
// Treat server-wide broadcasts as highlights. They're sent by server
|
||||||
|
// operators and can contain important information.
|
||||||
|
msg.isHighlight = irc.isHighlight(msg, client.nick, client.cm) || irc.isServerBroadcast(msg);
|
||||||
|
|
||||||
if (!msg.tags) {
|
if (!msg.tags) {
|
||||||
msg.tags = {};
|
msg.tags = {};
|
||||||
|
@ -288,6 +288,13 @@ export function isHighlight(msg, nick, cm) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isServerBroadcast(msg) {
|
||||||
|
if (msg.command != "PRIVMSG" && msg.command != "NOTICE") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return msg.params[0].startsWith("$");
|
||||||
|
}
|
||||||
|
|
||||||
export function isError(cmd) {
|
export function isError(cmd) {
|
||||||
if (cmd >= "400" && cmd <= "568") {
|
if (cmd >= "400" && cmd <= "568") {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user