-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential problem in api.ts #42
Comments
@kfatehi good catch. That should be fixed two things: @demurgos do you have an opinion? @kfatehi for a temporary (or forever) work around instead of listening to the Text event listen to the generic "event" event. It will always emit (even for self events), I use this to grab my own messages as well. |
Otherwise I think it's completely logical to have the app developer filter out self-sent messages like you've suggested. That code should be taken out IMO considering it only makes sense for the contrived example of an echo bot -- it should have not moved into the library itself IMHO. And indeed I am using
|
You are right, this is a problem. The fact that the server acknowledges the reception of the message is an important event. Currently, this code does wrong assumptions as you already noted (and isn't even used by the echo bot). I like the idea of the "sent" event but this would be a custom event. I am not sure how to handle it exactly: should there be a single "sent" event for all the kinds of messages or not ("Sent/Text", "Sent/RichText", etc.). |
So right now we do no filtering on event only on message. Do we want to filter events as well? I agree the FB style would be fairly straightforward. |
The issue with the redundant checks was solved. The main issue still there though, I may take a look at it during the next days. |
In the following snippet you can see that it is assumed that
ev.resource.from.username
is defined, but then, the existence ofev.resource
is checked. So ifev.resource
is definitely there, why check for it? Should the conditional be changed, then, to not assumeev.resource.from.username
is a true object path in every event?For context, I am looking at this because I'm actually interested in self-sent messages. I'm puzzled as to why there is a comment here saying there would be an infinite-loop. I'm using the generic
event
event in order to pick up self-sent messages now as a result, although I'd have preferred theText/RichText
ones.skype-http/src/lib/api.ts
Lines 93 to 101 in 08666d1
The text was updated successfully, but these errors were encountered: