-
Notifications
You must be signed in to change notification settings - Fork 600
Conversation
Wow this is great, thanks. Can we mark-as-delivered automatically? Generally I'd say that that and change_thread_image could have been in a separate PR though. I left a couple questions in the code, but it generally looks like it could work. In the meantime, if anyone else who is excited about this functionality wants to pull the branch and try it out, that's always helpful for a big change like this. Thanks! |
Sure. We also could add an option for auto marking messages as seen. And yes, messages are exactly the same. |
Also it would be helpful to merge #628 because of ForcedFetch. |
I'd suggest changing tabs to spaces, to match rest of the code. |
@Schmavery Would you like me to remove markAsDelivered and change_thread_image from this PR and do another one after this is merged? |
I don't really mind change_thread_image staying but lets pull out markAsDelivered for now if you don't mind -- I think we should start trying to do that and markAsRead automatically and I don't want that to block this PR Thanks for adding the docs! I left just a couple more comments and then I think we should be good to merge -- looks like several people in the other thread are successfully able to use this code so great job :) Also, I left a comment on #628 -- I'm not against merging something like this if it helps, but that particular PR is unfortunately out of date and a bit hard to review. |
Thank you! I'm glad I could help. PR #628 has a good way to handle GraphQL requests that way most requets are in one place. I'm also thinking about refactoring parseDelta so we could add more events in the future easily. But I'll leave that for another PR. Thanks! |
Could you please take a look at the latest changes? |
@lequanglam what was in that message? was it normal text? emoji? sticker? picture? that would probably help |
@ravkr i can't check what messages is throwing that error (cuz there's a LOT of messages going in and out), but i hooked up some error logging, hopefully it will catch what messages is messing up. địt mẹ facebook |
found, it was ForcedFetch that cause issues. |
src/listenMqtt.js
Outdated
var presence = { | ||
type: "presence", | ||
userID: userID, | ||
timestamp: data["l"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen this field in any of my orca_presence messages, but there's one called "c" that's still a mistery to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm trying to figure out what that is for. I'll update if I found something.
@lequanglam It's fixed in the last commit. Please update. Edit: The error I fixed is different from yours. I'll push a commit as soon as I can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me, @7osCraft please let me know when you're ready to merge it (from reading the comments it looks like you're still fixing one or two bugs?)
Fixed ForcedFetch issues and converted presence timestamps from seconds to milliseconds. |
Thanks :) |
@thanhdatpd Sure. Thanks! |
Added support for MQTT with the existing events and messages.
Also added support for marking a message as delivered because I think that causes facebook to temporarly block accounts.
Also added a "change_thread_image" event triggered when a group image is changed.
To listen with mqtt simply change
api.listen
toapi.listenMqtt