What do means this icon?

this small circle at bottom right as in this pic: https://imgur.com/XP556HN

It means the contact is online.
but you have a delay from 10 minutes , this is because the DHT.

and if while my friend is disconnected but the dot still remains who will keep the message sent to him?

@jamiboy It’s stored directly on the DHT. It works the same way your initial messages (requests for a conversation, plus your IP address) work. Your message is encrypted to the recipient’s key first, then it’s stored on the DHT using a simple put(key, value). The value is your encrypted message, and the key is determined base on the recipient’s public key, so that they know where to look for incoming messages.

DHT’s are hard to understand without a lot of reading and thinking (for me at least). This blog post tries to explain it: https://enconn.fr/blog/p2p-internals-dht/
(also the video at the bottom is great).

However, a simple answer to your question: It’s stored on some random person’s computer, but it’s fully end-to-end-encrypted, and once both devices are online, your messages go straight to them without using the DHT.

1 Like

good, and do you know how long is the Alice message stored on DHT before to being received from Bob? 1 day? 1 month? And what if Bob don’t connect anymore or unistall Jami?

All values are only stored for about 10 minutes on the DHT. It is an ephemeral network that can change all the time rather than a permanent storage network.

If Bob doesn’t connect before about 10 minutes, the message will be gone from the DHT, and next time Bob comes online Alice’s client will send him the message again. If Bob never connects then the message will never be delivered.

However The DHT library Jami uses ( opendht ) supports push notifications. This is a different topic, but it allows you to get better connectivity from mobile devices without leaving the app running all the time.

So in this case, Bob will appear online even though his Jami client is not running in the foreground, and if Alice sends him a message, than the dhtproxy will send a wakeup event to his phone and Jami will download the message. This requires enabling push notifications in the app settings, and it relies on a dhtproxy server. Messages are still E2EE, of course.

1 Like

this is unclear to me: for how long time (minutes/hours/days) does the Alice client attempt to resend the message to Bob?

The Alice client only attempts to send the message when Bob’s “presence” is detected (meaning Bob is online and has announced his presence on the DHT).

Alice’s client will not repeatedly try to send the message while Bob is offline, but it will keep the message on Alice’s drive. If Bob connects to the network within a week, Alice’s client will resend the message to him.

Of course, if you don’t want this behavior, you can just delete the message.

where do you read this value?

I asked a developer on the IRC channel (#jami on Freenode) :slight_smile:

I don’t know where it is in the code.