Afaik 0xchat does this by creating ephemeral keys that are then stored to be able to decrypt old messages. If any of the keys are leaked, then only a subset of the messages can be decrypted (I'm not sure how many, might be just one). But then this also goes the other way: if you don't have access to those keys anymore, then your DMs are gone. I guess it's just a matter of tradeoffs.