Introduce Client.who
This commit is contained in:
parent
02145b45ad
commit
619f1db08f
2 changed files with 20 additions and 1 deletions
|
@ -914,7 +914,7 @@ export default class App extends Component {
|
||||||
this.switchToChannel = target;
|
this.switchToChannel = target;
|
||||||
client.send({ command: "JOIN", params: [target] });
|
client.send({ command: "JOIN", params: [target] });
|
||||||
} else {
|
} else {
|
||||||
client.send({ command: "WHO", params: [target] });
|
client.who(target);
|
||||||
this.createBuffer(netID, target);
|
this.createBuffer(netID, target);
|
||||||
this.switchBuffer({ network: netID, name: 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) {
|
whois(target) {
|
||||||
var targetCM = this.cm(target);
|
var targetCM = this.cm(target);
|
||||||
var msg = { command: "WHOIS", params: [target] };
|
var msg = { command: "WHOIS", params: [target] };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue