whatscli
whatscli copied to clipboard
Whatsapp multi-device support
Whatsapp recently provided a "Multi-device" feature, so we can use whatsapp - https://faq.whatsapp.com/general/download-and-installation/about-multi-device-beta/?lang=en
But whatscli currently can't connect when user is using this Multi-device feature, since it requires scanning QR code two times (as per my observation till now). Currently after scanning once whatscli crashes/stays but won't show another qr code, and reopening doesn't help much everytime one qr code.
I don't think this is supported in the upstream go-whatsapp library yet: https://github.com/Rhymen/go-whatsapp See this issue: https://github.com/Rhymen/go-whatsapp/issues/601
Maybe use this? go-whatsapp dropped the issue
https://github.com/tulir/whatsmeow
Maybe use this? go-whatsapp dropped the issue
https://github.com/tulir/whatsmeow
That looks very good, doesn't seem to be complete yet though. Thanks for the link. I won't get around to do the changes any time soon so if anyone wants to have a whack..
any plan to add this feature?
any plan to add this feature?
Not more extensively than whats written here. You can send a PR if you want.
Just to add here: https://github.com/Rhymen/go-whatsapp/issues/622 seems it will be deprecated in favor of https://github.com/tulir/whatsmeow
Yeah, I saw that, I guess thats the best way forward. It will mean a lot of changes to whatscli as well but thats also a chance to clean up the message database part. But maybe tulir has other plans as well, he's got a nice matrix client for the command line, maybe he'll integrate whatsapp support, that would make whatscli obsolete then.
I was thinking maybe the best is to write whatsmeow support for weechat but not sure how hard it is.
All those webapps use too much ram =/
I was thinking maybe the best is to write whatsmeow support for weechat but not sure how hard it is. Yeah, I was looking into using weechat back when I wrote whatscli. Adding perl or python based scripts is easy, adding native plugins less so. With golang in the mix things probably won't get easier.
All those webapps use too much ram =/ Agreed. Plus god knows if my laptop is mining dogecoin or whatever for Mark Z while its open 🙄
I'm currently looking into using whatsmeow in whatscli, it seems to be reasonable effort and a good chance to clean the ugly in whatscli. I hope I'll find enough time in the next days.
Initial work has begun in the whatsmeow branch - things seem to be basically working, theres still work to be done to implement the old commands and support extended messages though.
Initial work has begun in the whatsmeow branch - things seem to be basically working, theres still work to be done to implement the old commands and support extended messages though.
please let us know when it's safe to test it
Well you can try it, it shouldn't break anything in your current install. It will create two databases in the current folder (not in the config/settings folder yet).
The main remaining issues are:
- Only login/send commands work
- Message count/notification completely missing
- Only basic text messages are received
- Nothing is tested extensively so theres probably bugs
Initial work has begun in the whatsmeow branch
Thanks for that @normen!
- Only basic text messages are received
As of e249b112b69f8683bb1f9ddc9fda3387fab12ed6, I do receive all basic text messages at login time but I don't receive any new message after it, is there currently a way to reupdate the message panel?
I'm executing the app with go run .
Nah not really apart from logging out, deleting the database and logging in again.
any updates on the whatsmeow-branch , does it support multi-device?
I am willing trying to help on code, whats need to be done? Can we try set a TODO list @normen, so interessed people can try to help?
I am willing trying to help on code, whats need to be done? Can we try set a TODO list @normen, so interessed people can try to help?
The main thing that needs to be done is storing received message info in a way that allows later recreating whatsmeows messages so extended info can be downloaded (e.g. Images etc). Currently we're storing messages in a backend-agnostic way. For downloading messages whatsmeow expects its own message "objects" and I didn't dig into whatsmeow too deep yet so I'm not sure how to best get from our data about the messages back to whatsmeows. In this thread I basically state whats missing, you'd have to dig into the code (and whatsmeow) anyway to get somewhere. Maybe look around in the code and ask me if anything is unclear.
Theres also the general structure overview in the README for a general idea of what code does what: https://github.com/normen/whatscli/tree/whatsmeow#structure-overview
Its a bit outdated given that the backends are now completely separated from the session manager.
Is the whatsmeow branch usable right now?
I am willing trying to help on code, whats need to be done? Can we try set a TODO list @normen, so interessed people can try to help?
The main thing that needs to be done is storing received message info in a way that allows later recreating whatsmeows messages so extended info can be downloaded (e.g. Images etc). Currently we're storing messages in a backend-agnostic way. For downloading messages whatsmeow expects its own message "objects" and I didn't dig into whatsmeow too deep yet so I'm not sure how to best get from our data about the messages back to whatsmeows. In this thread I basically state whats missing, you'd have to dig into the code (and whatsmeow) anyway to get somewhere. Maybe look around in the code and ask me if anything is unclear.
what about we use the lime protocol for that?
https://limeprotocol.org/
Hm, it would fit but it sounds like its a bit overblown for this use case, also whatsmeow already keeps its own database with all that info, its just about having the right pointers in "our" database to grab it again later.
Ofc this layer of abstraction isn't strictly necessary but if I had implemented it properly in the first version of whatscli then the whatsmeow version would already be running now 😄
@normen How can we debug the process while running it with go run .
?
Depends on your dev setup, I am using vim and debug the oldschool way, by using a lot of console output :)
In case you didn't follow the discussion, I think its best to rely completely on whatsmeows database and remove the abstraction, basically only keeping the UI part of whatscli. That way we'd be completely dependent on whatsmeow but we should be able to get results much quicker I suppose.
By "rely completely on whatsmeows..." you mean we should delete the "messages" folder completly and re-write it as whatsmeows implementation?
I am not used to GO but I already read some of the code, the Whatscli UI is created almost at the main.go file, correctly?
So we must rely only on the "backends folder with whatsmeow implementation and rewrite the whole message application?
Basically, yes. So this would simply be a whatsmeow frontend going along with its idiosyncrasies.
Normen, I'll try to study to whatsmeow API and see if I can start something!
I guess this is the Go Horse solution, if I had any sucess contribuing to this I think we can discuss better abstractions to the project.
Thanks for the chating.