Support @+draft/channel-context

See: https://github.com/ircv3/ircv3-specifications/pull/498
This commit is contained in:
delthas 2022-04-28 20:17:02 +02:00 committed by Simon Ser
parent f6ba40046f
commit b9693d53ec

View File

@ -744,10 +744,15 @@ export default class App extends Component {
if (client.isMyNick(target)) { if (client.isMyNick(target)) {
if (client.cm(msg.prefix.name) === client.cm(client.serverPrefix.name)) { if (client.cm(msg.prefix.name) === client.cm(client.serverPrefix.name)) {
target = SERVER_BUFFER; target = SERVER_BUFFER;
} else {
let context = msg.tags['+draft/channel-context'];
if (context && client.isChannel(context) && State.getBuffer(this.state, { server: serverID, name: context })) {
target = context;
} else { } else {
target = msg.prefix.name; target = msg.prefix.name;
} }
} }
}
if (msg.command === "NOTICE" && !State.getBuffer(this.state, { server: serverID, name: target })) { if (msg.command === "NOTICE" && !State.getBuffer(this.state, { server: serverID, name: target })) {
// Don't open a new buffer if this is just a NOTICE // Don't open a new buffer if this is just a NOTICE
target = SERVER_BUFFER; target = SERVER_BUFFER;