mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-12 23:43:42 +01:00
Introduce Client.who
This commit is contained in:
parent
02145b45ad
commit
619f1db08f
@ -914,7 +914,7 @@ export default class App extends Component {
|
||||
this.switchToChannel = target;
|
||||
client.send({ command: "JOIN", params: [target] });
|
||||
} else {
|
||||
client.send({ command: "WHO", params: [target] });
|
||||
client.who(target);
|
||||
this.createBuffer(netID, target);
|
||||
this.switchBuffer({ network: netID, name: target });
|
||||
}
|
||||
|
@ -293,6 +293,25 @@ export default class Client extends EventTarget {
|
||||
}
|
||||
}
|
||||
|
||||
who(mask) {
|
||||
var msg = { command: "WHO", params: [mask] };
|
||||
var l = [];
|
||||
return this.roundtrip(msg, (event) => {
|
||||
var msg = event.detail.message;
|
||||
switch (msg.command) {
|
||||
case irc.RPL_WHOREPLY:
|
||||
// TODO: match with mask
|
||||
l.push(msg);
|
||||
break;
|
||||
case irc.RPL_ENDOFWHO:
|
||||
if (msg.params[1] === mask) {
|
||||
return l;
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
whois(target) {
|
||||
var targetCM = this.cm(target);
|
||||
var msg = { command: "WHOIS", params: [target] };
|
||||
|
Loading…
x
Reference in New Issue
Block a user