This commit does a few things:
1) Add replies to messages, which are calculated at query time using a
join
2) Add a BlockContact api call that takes care of deleting messages from
a user, deleting the chat, and re-compute the denormalized values. As it
needs to run in a transaction, the method that it relies on take a
transaction as an optional parameter.
3) Change ID scheme for chats/contacts so that it's consistent across
messages/contacts
This is not compatible as I have modified a migration, but it's not a
problem as data compatibility can be broken
Adds to api calls, Contacts() not paginated and SaveContact()
DeviceInfo and SystemTags have been stored as a blob to simplify
querying, although at some point we might want to query system tags (for
example to fetch all the blocked/added by us/added by them contacts),
but not a use case for now.
This commits adds two API calls:
SaveChat
GetChats
The first one behaves like an upsert.
The second takes two parameters, from, to and returns chats in reverse
order by timestamp.
Members and MembershipUpdates have been stored as blob of data to
simplify the querying (we never query them separately).