You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, while working with your library, i discovered a potential bug inside function isUserOn of the Client class.
@overrideFuture<bool> isUserOn(String name,
...
var handler = (WhoisEvent event) {
if (event.nickname == nickname) {
if (!completer.isCompleted) {
completer.complete(event.away);
}
}
};
...
I think the handler is intercepting the wrong event, it should be IsOnEvent, in fact the call always returns false. Moreover, the check "if(event.nickname == nickname)" is incorrect, because nickname represents the current nickname of our client user, not the nickname of the user we are trying to query (whose nickname is on the "name" parameter of the function).
I fixed the handler like so:
var handler = (IsOnEvent event) {
if (!completer.isCompleted) {
completer.complete(event.users.contains(name));
}
};
Now, it works. Is my reasoning correct or there is something escaping to me? In the first case, I can pull request my fix.``
The text was updated successfully, but these errors were encountered:
Hi, while working with your library, i discovered a potential bug inside function isUserOn of the Client class.
I think the handler is intercepting the wrong event, it should be IsOnEvent, in fact the call always returns false. Moreover, the check "if(event.nickname == nickname)" is incorrect, because nickname represents the current nickname of our client user, not the nickname of the user we are trying to query (whose nickname is on the "name" parameter of the function).
I fixed the handler like so:
Now, it works. Is my reasoning correct or there is something escaping to me? In the first case, I can pull request my fix.``
The text was updated successfully, but these errors were encountered: