File:private-messaging-brainstorming-flow.png

Source:

title: Private Messaging participant alice participant bob participant pm.bob participant pm.alice

alice->bob: 1. hey I have message 123xyz for you.\nwhere should I send it? bob-->alice: send it to pm.bob plz alice->pm.bob: 2. I have message 123xyz for bob! pm.bob-->alice: okay, I will give you a token to send it.\nwhat server handles your messages? alice-->pm.bob: you can talk to pm.alice pm.bob->pm.alice: 3. Hey there, I heard alice wants to\nsend message 123xyz to bob.\nIs this true? pm.alice-->pm.bob: yes! pm.bob->pm.alice: 4. You can deliver message 123xyz to pm.bob\nif you include token xxxxxxxxxxx pm.alice->bob: 5. hey bob, can pm.bob\nreceive messages for you? bob-->pm.alice: yeah! pm.alice->pm.bob: 6. Here is message 123xyz\nand token xxxxxxxxxxxx!

https://bramp.github.io/js-sequence-diagrams/