Buddy.py would try to subscribe to presence before the user had logged
in to whatsapp. A loginQueue was added, so that functions could be
deferred to login.
Before messages sent to groups the user had not joined were lost. Now
the message is sent via the bot to the user. The bot suggests that the
user join the group and also relays the contents of the message.
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.
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
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.
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