<buttonid="sidebar-toggle"class="icon-button"type="button"title="Toggle Table of Contents"aria-label="Toggle Table of Contents"aria-controls="sidebar">
<ahref="print.html"title="Print this book"aria-label="Print this book">
<iid="print-button"class="fa fa-print"></i>
</a>
</div>
</div>
<divid="search-wrapper"class="hidden">
<formid="searchbar-outer"class="searchbar-outer">
<inputtype="search"name="search"id="searchbar"name="searchbar"placeholder="Search this book ..."aria-controls="searchresults-outer"aria-describedby="searchresults-header">
<p>Hole receiving messages by looking for new items in "user's bin" (place where new messages arrives). Because of how freenet works, we can't just say "Hey! Do I have new messages?", we can specify messages index like: "Hey! Gimme 15th message". Thus we must remember previous message index and to receive the new message we're requesting for 16th message, if we was able to get 15th message.</p>
<p>That's mean, what interlocutor also have to know the last message index in our bin. But <strong>how he can know it, if there's a lot of other users who also sending messages to our bin?</strong> Of course, you can try to receive all messages from the index, you had last remembered, and next index, next, next... until you find the index which does not exist. But it's a freenet, it's take too much time;</p>
<p>The solution is unique Id. User creating and giving his/her unique id to each new interlocutor. And when, if interlocutor sending the message he knows, that last message to us had index <code>$N</code> and sends message with index <code>$N+1</code>, if be more verbose, the new message index he send to us will look like <code>"$(ID)_($N+1)"</code></p>
<h2id="process-of-messaging"><aclass="header"href="#process-of-messaging">Process of messaging</a></h2>
<p>Each user have kind of a bin among freenet network,in which anyone can put message. And for each user this bin is his <code>USK insert</code> key. Each message signed by sender. And user can answer to sender, buy putting message at sender insert key if he know it.</p>
<p>Each user have unique pseudonym for each user whom he communicates. Thos pseudonyms uses by user to identify who is sender end establish message flow.
The "message flow" is important here.</p>
<ul>
<li><inputdisabled=""type="checkbox"/>
Probably, for each pair of each people we will <strong>not only one</strong> unique identifier but... I'm not going to do it in further releases. <em>TODO</em></li>
<p>To receive a new message we have to send <code>ClientGet</code> to our <code>USK request</code> key with URI like <code>/user_id-message_version</code>. As well, the identifier is consists of <code>user_id-message_number</code>
<p>To send a message to a friend we putting it at his <code>USK insert</code> key, with URI like<code>/my_id-$(number_of_messages_to_this_user + 1)</code>. And identifier like <code>user_id-$(number_of_messages_to_this_user + 1)</code>