Actual implimentaton will be in android but this is more about general security than actual implimentaton details. I'm making an end-to-end encrypted chat app and I know that in order to send encrypted messages you have to encrypt the message with the receiver's public key and they will decrypt it with their private key.
What I'm stuck on is that once I store this encrypted message on the server, the sender will not be able to read their own sent messages because the messages will require the receiver's private key - which they wont have access to. The result is that inside the chat app the sender wont be able to see the actual contents of any of the messages they send, they would only be able to view messages that are sent to them from other users.
Clearly I'd like users to be able to see the entirety of the conversation history, not just recieved messages. I think what I might be getting at is how do I can I store sent messages so that they can be decrypted by both the sender and receiver? Or if I'm thinking about it incorrectly then what is the correct way to solve this problem?