axel-angel / whatsapp-email-bridge

WhatsApp <-> Email (two-way bridge) in Python (supports IMAP/SMTP)
Other
51 stars 24 forks source link

Set online state while bridge is running #5

Closed skimpel closed 9 years ago

skimpel commented 9 years ago

Is there a simple way to maintain online state, while sctript is running ?

axel-angel commented 9 years ago

Are you talking about the "presence", people seeing you're online? The presence should stay online as long as the script is running, what's happening on your side?

skimpel commented 9 years ago

I checked again and the online state is not maintained !

axel-angel commented 9 years ago

That's true, I can confirm this on the android and iphone versions. I'll try to find what's missing or if it's a bug from yowsup.

axel-angel commented 9 years ago

I don't see yet how to address this problem. It should be easy to fix (one flag somewhere). That's a good question to ask on the yowsup github I think.

axel-angel commented 9 years ago

This is fixed in the new commit.

goenie commented 9 years ago

Tested the new commit. But after a short time online "3minutes" the Whatsapp account went offline again. When i sent new messages , there is no respond. edit-- Restarted and now the account is longer online

axel-angel commented 9 years ago

Make sure you are also using the latest version of yowsup. On my side, the script is running and I'm appearing online for >24 hours. Give it a try.

goenie commented 9 years ago

It was online for 3hours and then it went offline. Found out i had yowsup 0.2 installed thru pip. Removed the package and installed Yowsup v2.3.123. Started email bridge and hoping for the best. --edit 4 minutes later it went offline. --edit few minutes later again offline

skimpel commented 9 years ago

I tried the new version. For me online state is maintained correctly ! So last real problem : whatsapp upload fails with everything i tried ... any help would be appreciated !

axel-angel commented 9 years ago

Cool. Upload is in the other issue as I said and it's not fixed yet, that's right.

I'll close this one if goenie says it's fixed.

goenie commented 9 years ago

Thanks, I will test until i drop. Just registered a new phone number, did a full update of the server and started the bridge for now its 20minutes online Also setting up this week a fresh virtual machine and use dsl line instead of my cable to see if i can keep it online. i drop a new comment if i know more.

goenie commented 9 years ago

Registered a phone new number, used the same server and software. online status worked fine for more then 17 hours, i gues that is good and fixed. But then i rebooted modem to see if the online status picked up. It did not. Repeated it and same result. I hope there is a way to bypass that. If not, i can crontab - pkill python and start by crontab.

axel-angel commented 9 years ago

What do you mean: you restarted your modem while the program was running? In that case there is nothing we can do easily because: (1) if NAT is used, then the TCP connection will hang (until TCP timeout) (2) there is no obvious way to detect disconnection/IP change in the application layer.

This is not really related to this issue but a general issue with any application using TCP. The best we could do is try to detect disconnection and force reconnection.

goenie commented 9 years ago

I get it. Issue is fixed. Thanks for the help

axel-angel commented 9 years ago

I've just edited my comment. The cronjob is the easiest, once per hour or something.

Closing then.