We were using an integer for the message id when we were sending a
message. This id was incremented with each message sent.
Reading the matrix server documentation I've discovered that this id
should be unique:
> Clients should generate an ID unique across requests with the same
> access token; it will be used by the server to ensure idempotency of
So this was a problem. I think that this is because some messages never
got sent to the server and we don't get any error back.
To fix that now we generate an unique id for each message using the room
id, the message body and the message date, we concatenate that and make
an md5 sum, so this should be unique.