-
Notifications
You must be signed in to change notification settings - Fork 59
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
HttpPollLoop receives same updates again and again #18
Comments
You have to notify messages as received, otherwise telegram will send again
|
I have implemented messages.receivedMessages(max_id, callback) in the API like so: Messages.prototype.receivedMessages = function (max_id, callback)
{
return utility.callService(api.service.messages.receivedMessages, this.client, this.client._channel, callback, arguments);
}; And in my code like: self = this;
client.startHttpPollLoop(function(data) {});
client.registerOnUpdates(function(data) {
if(data.message) // temporary check if update is updateShortMessage
{
self.client.messages.receivedMessages(data.id, function(err) {console.log(err);});
// create notification when the update holds a message
}
}); I don't get any errors so I assume everything is working fine, but I still get notifications again and again. Edit: In you example application Termgram you also don't have to notify messages as received. Is that because you use HttpPoll directly without HttpPollLoop? |
👍 |
In my client I have
And when someone sends me a message I receive infinite notifications. Do I have to tell the server somehow I ve received the update or is it a bug in the API?
On the telegram api homepage it states:
So i checked if the API does so by calling updates.getDifference. Telegram.link does what it should do, but why do I keep getting the updates then?
The text was updated successfully, but these errors were encountered: