To build the list of recent discussions, we get the last 50 messages received and sent by the current user. This means that if a user has received a lot of messages in a discussion we might be showing a last message that isn't the right one in other discussions.
E.g. let's say that a user has talked with user A and user B. The conversation with user A is really short and finishes with a message from user A. Right after that starts the conversation with user B, where the current user barely sends message but it receives 50 messages from user B.
When we get the last 50 messages received, all of them are from user B so we get no messages from user A. But when we get the messages sent, we get the messages sent to user A since the current user barely sent messages. So the last message shown in discussion A is from the current user, and it should be from user A.