mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-05 02:29:28 +02:00
doxygen
This commit is contained in:
parent
88df6e6521
commit
cd9a1ee5b9
29 changed files with 291 additions and 273 deletions
|
@ -86,7 +86,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|||
<div class="fragment"><div class="line"><a class="code" href="structmrmailbox__t.html">mrmailbox_t</a>* mailbox = <a class="code" href="structmrmailbox__t.html#a32825e3e0a1b16679580704a4b43db1a">mrmailbox_new</a>(my_delta_handler, NULL, NULL);</div><div class="line"></div><div class="line"><a class="code" href="structmrmailbox__t.html#a19b3e9f5209bc326fc77f3944522e8ad">mrmailbox_set_config</a>(mailbox, <span class="stringliteral">"addr"</span>, <span class="stringliteral">"alice@delta.chat"</span>); <span class="comment">// use some real test credentials here</span></div><div class="line"><a class="code" href="structmrmailbox__t.html#a19b3e9f5209bc326fc77f3944522e8ad">mrmailbox_set_config</a>(mailbox, <span class="stringliteral">"mail_pw"</span>, <span class="stringliteral">"***"</span>);</div><div class="line"></div><div class="line"><a class="code" href="structmrmailbox__t.html#a42ca741cc08785585f1dc74d515be5ef">mrmailbox_configure_and_connect</a>(mailbox);</div></div><!-- fragment --><p><a class="el" href="structmrmailbox__t.html#a42ca741cc08785585f1dc74d515be5ef" title="Configure and connect a mailbox. ">mrmailbox_configure_and_connect()</a> may take a while and saves the result in the database. On subsequent starts, you can call <a class="el" href="structmrmailbox__t.html#a67eef5ffc3369b8ad09326471b0a266f" title="Connect to the mailbox using the configured settings. ">mrmailbox_connect()</a> instead if <a class="el" href="structmrmailbox__t.html#aa6e325e49ecccfc96276db6c327dba94" title="Check if the mailbox is already configured. ">mrmailbox_is_configured()</a> returns true.</p>
|
||||
<p>However, now you can send your first message:</p>
|
||||
<div class="fragment"><div class="line">uint32_t contact_id = <a class="code" href="structmrmailbox__t.html#aa089e97e7ca1add16c10d5cc0e902824">mrmailbox_create_contact</a>(mailbox, NULL, <span class="stringliteral">"bob@delta.chat"</span>); <span class="comment">// use a real testing address here</span></div><div class="line">uint32_t chat_id = <a class="code" href="structmrmailbox__t.html#a1386ec2c091b936b65b25b50a302173d">mrmailbox_create_chat_by_contact_id</a>(mailbox, contact_id);</div><div class="line"></div><div class="line"><a class="code" href="structmrmailbox__t.html#a3f9ac5fb9ff2dcbaafdddb5d955ac39b">mrmailbox_send_text_msg</a>(mailbox, chat_id, <span class="stringliteral">"Hi, here is my first message!"</span>);</div></div><!-- fragment --><p>Now, go to the testing address (bob) and you should have received a normal email. Answer this email in any email program with "Got it!" and you will get the message from delta as follows:</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="structmrarray__t.html">mrarray_t</a>* msglist = <a class="code" href="structmrmailbox__t.html#af5ac7f527aef58f8e834f3bd740acd46">mrmailbox_get_chat_msgs</a>(mailbox, chat_id, 0, 0);</div><div class="line"><span class="keywordflow">for</span>( <span class="keywordtype">size_t</span> i = 0; i < <a class="code" href="structmrarray__t.html#a73f6d954ed1b97bbceb3cf7d8e1aeec8">mrarray_get_cnt</a>(msglist); i++ )</div><div class="line">{</div><div class="line"> uint32_t msg_id = <a class="code" href="structmrarray__t.html#a40b1e875ba256b6ccbbe65f58bbc01ec">mrarray_get_id</a>(msglist, i);</div><div class="line"> <a class="code" href="structmrmsg__t.html">mrmsg_t</a>* msg = <a class="code" href="structmrmailbox__t.html#a9ef144244e7d86ba82ce3257abf14f13">mrmailbox_get_msg</a>(mailbox, msg_id);</div><div class="line"></div><div class="line"> printf(<span class="stringliteral">"message %i: %s\n"</span>, i+1, msg->m_text);</div><div class="line">}</div></div><!-- fragment --><p>This will output the following two lines:</p>
|
||||
<div class="fragment"><div class="line"><a class="code" href="structmrarray__t.html">mrarray_t</a>* msglist = <a class="code" href="structmrmailbox__t.html#af5ac7f527aef58f8e834f3bd740acd46">mrmailbox_get_chat_msgs</a>(mailbox, chat_id, 0, 0);</div><div class="line"><span class="keywordflow">for</span>( <span class="keywordtype">size_t</span> i = 0; i < <a class="code" href="structmrarray__t.html#a73f6d954ed1b97bbceb3cf7d8e1aeec8">mrarray_get_cnt</a>(msglist); i++ )</div><div class="line">{</div><div class="line"> uint32_t msg_id = <a class="code" href="structmrarray__t.html#a40b1e875ba256b6ccbbe65f58bbc01ec">mrarray_get_id</a>(msglist, i);</div><div class="line"> <a class="code" href="structmrmsg__t.html">mrmsg_t</a>* msg = <a class="code" href="structmrmailbox__t.html#a9ef144244e7d86ba82ce3257abf14f13">mrmailbox_get_msg</a>(mailbox, msg_id);</div><div class="line"> <span class="keywordtype">char</span>* text = <a class="code" href="structmrmsg__t.html#ae549e58d9ae2f73ad76bd27636b43982">mrmsg_get_text</a>(msg);</div><div class="line"></div><div class="line"> printf(<span class="stringliteral">"message %i: %s\n"</span>, i+1, text);</div><div class="line"></div><div class="line"> free(text);</div><div class="line"> <a class="code" href="structmrmsg__t.html#aa33212e41efff643aa7290753f3d9b02">mrmsg_unref</a>(msg);</div><div class="line">}</div><div class="line"><a class="code" href="structmrarray__t.html#a1400b5e42c682326e809723f02739a8e">mrarray_unref</a>(msglist);</div></div><!-- fragment --><p>This will output the following two lines:</p>
|
||||
<div class="fragment"><div class="line">Message 1: Hi, here is my first message!</div><div class="line">Message 2: Got it!</div></div><!-- fragment --><p>I think, you got the idea. For further reading, please dive into the <a class="el" href="structmrmailbox__t.html" title="An object representing a single mailbox. ">mrmailbox_t</a> class.</p>
|
||||
<h2>Further hints</h2>
|
||||
<p>Here are some additional, unsorted hints that may be useful. If you need any further assistance, please do not hesitate to contact us at <a href="#" onclick="location.href='mai'+'lto:'+'r10'+'s@'+'b44'+'t.'+'com'; return false;">r10s@<span style="display: none;">.nosp@m.</span>b44t<span style="display: none;">.nosp@m.</span>.com</a>.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue