Commit graph

201 commits

Author SHA1 Message Date
moyamo 1c0ae79ec2 Fix join room, inform user of all groups, and new participants
In the previous implementation join_room was called on all groups immediately
after the user was authenticated.  When a user joined a group, join_room will be
called again. This was incorrect behaviour and confused spectrum. There was no
truncation error, thus _shortenGroupId and _lengthenGroupId have edited to be a
no-op (and should be removed in the next commit).

The correct behavoiur is to only call join_room in
whatsappbackend.py:handleRoomJoined, however the user may do this before the
groups have been loaded, in which case those requests must be added to a queue.

The bot informs the user of all the groups the user has joined and when the user
is added to a new group.
2015-10-26 19:27:35 +02:00
Steffen Vogel 4c86463be8 Merge pull request #13 from moyamo/wiretag-fix
Pass only expected data to parseFromString
2015-10-09 20:26:27 +02:00
moyamo 744efd154f Use notify as buddies nickname when sending groupchats. 2015-10-09 18:45:17 +02:00
moyamo a5877bc1a9 Try to prevent transwhat from crashing on malformed protobuf 2015-10-09 18:45:17 +02:00
moyamo 29d92b456e Shorten the name of groupchats to overcome truncation bug
The names of groupchats are truncated internally to 22 characters.
This causes many problems with groupchats, since spectrum incorrectly
identifies the chat by the long name.

To overcome this the phoneNumber-unixTime is converted to hexadecimal,
to shorten the groupchat below 22 characters
2015-10-09 18:42:59 +02:00
moyamo ecfa2d7f85 Attempt to fix groupchats 2015-10-09 18:42:59 +02:00
moyamo f1a6b109f7 Regenerate protocol buffers 2015-10-09 18:42:59 +02:00
moyamo 652a9f0463 Pass only expected data to parseFromString
Spectrum2/backend.py:handleDataRead is called when transwhat receives
data from Spectrum. The parameter `data' contains multiple (or pieces
of) WrapperMessages. Instead of passing all the data to
wrapper.ParseFromString. We should only pass a single WrapperMessage.
2015-10-09 18:31:57 +02:00
moyamo f4e85f7689 Try to prevent transwhat from crashing on malformed protobuf 2015-09-21 21:45:18 +02:00
moyamo 7f1c9cd0db Shorten the name of groupchats to overcome truncation bug
The names of groupchats are truncated internally to 22 characters.
This causes many problems with groupchats, since spectrum incorrectly
identifies the chat by the long name.

To overcome this the phoneNumber-unixTime is converted to hexadecimal,
to shorten the groupchat below 22 characters
2015-09-21 20:30:11 +02:00
moyamo 6c12956dd6 Attempt to fix groupchats 2015-09-15 21:29:26 +02:00
moyamo e92d36a240 Regenerate protocol buffers 2015-09-14 19:55:53 +02:00
Steffen Vogel 4497b2c5c9 added link and description to yowsup 2015-09-08 12:39:49 +02:00
Steffen Vogel d8140f2dbb updated link to wiki 2015-09-08 12:37:39 +02:00
Steffen Vogel f64665b45f updated message of the day 2015-09-07 18:08:48 +02:00
Steffen Vogel 291a7647c0 updated contributors 2015-09-07 16:37:59 +02:00
Steffen Vogel 54c61f4fcc updated dependency section of README file 2015-09-07 16:34:13 +02:00
Steffen Vogel 1b505f6857 removed Google contacts import feature 2015-09-07 16:34:01 +02:00
Steffen Vogel 2496809bf1 Merge pull request #11 from moyamo/yowsup2-port
Port to Yowsup 2! Thanks  a lot!
2015-09-07 15:56:26 +02:00
moyamo 646f45434b Crude implementation of groupchat 2015-09-06 14:06:16 +02:00
moyamo 4fd313e516 Download whatsapp profile pictures
Everytime the user requests a VCard the profile pictures are updated.
The sha1hash hash of the picture is calculated and stored in buddy.
2015-09-06 00:14:12 +02:00
moyamo d2efa0dd7b Fix status message 2015-09-05 22:22:30 +02:00
moyamo 4c365e3f81 Add receiveing of images, videos and sound files
When a whatsapp buddy sends an image, video or sound to the spectrum
user, the spectrum user will receive a URL that links to the media.

FileTranfer in spectrum is not working, apparently. Thus media cannot be
sent yet.
2015-09-05 22:05:34 +02:00
moyamo a6971ad889 Add workaround to prevent double messages
For some reason spectrum occasionally sends to identical messages to
a buddy, one to the bare jid and one to /bot. This causes duplicate
messages. Since it is unlikely a user wants to send the same message
twice, we should just ignore the second message.

This is only a work around, a proper fix should be implemented.
2015-09-05 11:39:34 +02:00
moyamo e43aeedd9d Add presence and chatstate
* Chatstate typing and typing stop is sent and received
 * Presence is received and presence is sent when user types
2015-09-03 20:04:29 +02:00
moyamo 67c5a7c951 Add presence updates and looping asyncore.loop()
Add functions to update presence and status

Make asyncore.loop() timeout after some time and call the functions in
the YowStack.__detachedQueue.
2015-09-02 17:04:49 +02:00
moyamo 48313c5475 Minor fixes 2015-08-30 22:18:03 +02:00
moyamo 47d52ae22c Use new-style classes and Session should call super.__init__ 2015-08-30 21:07:31 +02:00
moyamo 254465301b Make Session use YowsupApp instead of SpectrumLayer 2015-08-30 20:54:42 +02:00
moyamo 8cc3c85145 Add a yowsup wrapper to simplify the session.py code 2015-08-30 20:08:41 +02:00
moyamo c7afff2cf9 Add more protocol layers to the yowstack 2015-08-30 19:16:53 +02:00
moyamo 59754848a7 Enable Axolotl encryption as it is mandatory. 2015-08-29 22:01:44 +02:00
moyamo 2f73ed1a10 Send Acks and Receipts on receiving a message 2015-08-29 20:50:07 +02:00
moyamo f2cadb7492 Reconnect when disconnected from whatsapp 2015-06-21 21:24:36 +02:00
moyamo ba54217377 Send logs to logfile 2015-06-21 21:15:52 +02:00
moyamo f871ed664b Add PresenceProtocolEntity to YowStack 2015-06-21 19:05:28 +02:00
moyamo f0a19d1b6c Handle presence sent from whatsapp 2015-06-21 19:02:39 +02:00
moyamo af0150866d Add groups protocol layer 2015-06-21 18:20:09 +02:00
moyamo 85c320e24c Send presence requests 2015-06-21 17:16:04 +02:00
moyamo 8b6a12c798 Add YowIqProtocolLayer to prevent connection from timing out 2015-06-21 17:02:58 +02:00
moyamo 31bbab2ab1 Remove default layers, The logging layer causes problems 2015-06-21 16:59:09 +02:00
moyamo ebed803984 Use YowStackBuilder and the default stack 2015-06-21 16:44:20 +02:00
moyamo 926aa9a6c9 Send typing state updates 2015-06-21 16:31:01 +02:00
moyamo 6b1b714d3c Remove the domain from the buddy name before message is sent 2015-06-21 16:16:26 +02:00
moyamo 0c17a497ee Pass session into SpectrumLayer so that session specific things can be called 2015-06-21 16:11:43 +02:00
moyamo ce1bf5d35b Fix typo 2015-06-21 16:01:23 +02:00
moyamo 68f9ca43ea Add ability to receive whatsapp messages 2015-06-21 15:59:11 +02:00
moyamo 0fd33d38bb Add ability to send a message 2015-06-21 15:32:58 +02:00
moyamo e94aa383bf Remove redundent debug logs 2015-06-21 15:20:22 +02:00
moyamo 0ecc89d270 Catch TypeError thrown when password incorrectly formatted 2015-06-21 15:09:56 +02:00