1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 10:19:16 +02:00
deltachat-core/docs/html/structmrchat__t.html
B. Petersen 1bea2d3db7 doxygen
2017-11-23 17:37:17 +01:00

379 lines
21 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Delta Chat Core C-API: mrchat_t Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="user.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Delta Chat Core C-API
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structmrchat__t-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mrchat_t Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>An object representing a single chat in memory.
<a href="structmrchat__t.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="mrchat_8h_source.html">mrchat.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3b1befb4542c1bad915f2175c7c2a2b9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#a3b1befb4542c1bad915f2175c7c2a2b9">mrchat_unref</a> (<a class="el" href="structmrchat__t.html">mrchat_t</a> *chat)</td></tr>
<tr class="memdesc:a3b1befb4542c1bad915f2175c7c2a2b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free a chat object. <a href="#a3b1befb4542c1bad915f2175c7c2a2b9">More...</a><br /></td></tr>
<tr class="separator:a3b1befb4542c1bad915f2175c7c2a2b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af23f2fd022f9978f7eed5ed46f3d9fbb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#af23f2fd022f9978f7eed5ed46f3d9fbb">mrchat_is_unpromoted</a> (<a class="el" href="structmrchat__t.html">mrchat_t</a> *chat)</td></tr>
<tr class="memdesc:af23f2fd022f9978f7eed5ed46f3d9fbb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a chat is still unpromoted. <a href="#af23f2fd022f9978f7eed5ed46f3d9fbb">More...</a><br /></td></tr>
<tr class="separator:af23f2fd022f9978f7eed5ed46f3d9fbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12bad02bef1fb6c8003f41c72d94f54b"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#a12bad02bef1fb6c8003f41c72d94f54b">mrchat_get_profile_image</a> (<a class="el" href="structmrchat__t.html">mrchat_t</a> *chat)</td></tr>
<tr class="memdesc:a12bad02bef1fb6c8003f41c72d94f54b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the chat's profile image. <a href="#a12bad02bef1fb6c8003f41c72d94f54b">More...</a><br /></td></tr>
<tr class="separator:a12bad02bef1fb6c8003f41c72d94f54b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1e9920618c9f6cb8ad66d5bb6962a08"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#ae1e9920618c9f6cb8ad66d5bb6962a08">mrchat_get_subtitle</a> (<a class="el" href="structmrchat__t.html">mrchat_t</a> *chat)</td></tr>
<tr class="memdesc:ae1e9920618c9f6cb8ad66d5bb6962a08"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a subtitle for a chat. <a href="#ae1e9920618c9f6cb8ad66d5bb6962a08">More...</a><br /></td></tr>
<tr class="separator:ae1e9920618c9f6cb8ad66d5bb6962a08"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a1591431716413350eaffce0b588e4911"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#a1591431716413350eaffce0b588e4911">m_id</a></td></tr>
<tr class="memdesc:a1591431716413350eaffce0b588e4911"><td class="mdescLeft">&#160;</td><td class="mdescRight">Chat ID under which the chat is filed in the database. <a href="#a1591431716413350eaffce0b588e4911">More...</a><br /></td></tr>
<tr class="separator:a1591431716413350eaffce0b588e4911"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a568c4e6fb9633ffe9a76428db16e0201"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#a568c4e6fb9633ffe9a76428db16e0201">m_type</a></td></tr>
<tr class="memdesc:a568c4e6fb9633ffe9a76428db16e0201"><td class="mdescLeft">&#160;</td><td class="mdescRight">Chat type. <a href="#a568c4e6fb9633ffe9a76428db16e0201">More...</a><br /></td></tr>
<tr class="separator:a568c4e6fb9633ffe9a76428db16e0201"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbd344d8d361a1a4d14bfc9b5dc57140"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#abbd344d8d361a1a4d14bfc9b5dc57140">m_name</a></td></tr>
<tr class="memdesc:abbd344d8d361a1a4d14bfc9b5dc57140"><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the chat. <a href="#abbd344d8d361a1a4d14bfc9b5dc57140">More...</a><br /></td></tr>
<tr class="separator:abbd344d8d361a1a4d14bfc9b5dc57140"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a565101f53278f5ab1ff58317ffc9555c"><td class="memItemLeft" align="right" valign="top">time_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#a565101f53278f5ab1ff58317ffc9555c">m_draft_timestamp</a></td></tr>
<tr class="memdesc:a565101f53278f5ab1ff58317ffc9555c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timestamp of the draft. <a href="#a565101f53278f5ab1ff58317ffc9555c">More...</a><br /></td></tr>
<tr class="separator:a565101f53278f5ab1ff58317ffc9555c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe916f48ac83c2ca6476312eae084cfa"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#abe916f48ac83c2ca6476312eae084cfa">m_draft_text</a></td></tr>
<tr class="memdesc:abe916f48ac83c2ca6476312eae084cfa"><td class="mdescLeft">&#160;</td><td class="mdescRight">The draft text. <a href="#abe916f48ac83c2ca6476312eae084cfa">More...</a><br /></td></tr>
<tr class="separator:abe916f48ac83c2ca6476312eae084cfa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf3e1a34f567e168bc0597f9a544a50d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmrmailbox__t.html">mrmailbox_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#abf3e1a34f567e168bc0597f9a544a50d">m_mailbox</a></td></tr>
<tr class="memdesc:abf3e1a34f567e168bc0597f9a544a50d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The mailbox object the chat belongs to. <a href="#abf3e1a34f567e168bc0597f9a544a50d">More...</a><br /></td></tr>
<tr class="separator:abf3e1a34f567e168bc0597f9a544a50d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b28b343ceb290d4a613d0e5a7d528bc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrchat__t.html#a5b28b343ceb290d4a613d0e5a7d528bc">m_archived</a></td></tr>
<tr class="memdesc:a5b28b343ceb290d4a613d0e5a7d528bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flag for the archived state. <a href="#a5b28b343ceb290d4a613d0e5a7d528bc">More...</a><br /></td></tr>
<tr class="separator:a5b28b343ceb290d4a613d0e5a7d528bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An object representing a single chat in memory. </p>
<p>Chat objects are created using eg. <a class="el" href="structmrmailbox__t.html#ad106b9c23b3a559b524a37bb5504e096" title="Get chat object by a chat ID. ">mrmailbox_get_chat()</a> and are not updated on database changes; if you want an update, you have to recreate the object. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3b1befb4542c1bad915f2175c7c2a2b9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void mrchat_unref </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structmrchat__t.html">mrchat_t</a> *&#160;</td>
<td class="paramname"><em>chat</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Free a chat object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">chat</td><td>Chat object are returned eg. by <a class="el" href="structmrmailbox__t.html#ad106b9c23b3a559b524a37bb5504e096" title="Get chat object by a chat ID. ">mrmailbox_get_chat()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="af23f2fd022f9978f7eed5ed46f3d9fbb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mrchat_is_unpromoted </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structmrchat__t.html">mrchat_t</a> *&#160;</td>
<td class="paramname"><em>chat</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if a chat is still unpromoted. </p>
<p>Chats are unpromoted until the first message is sent. With unpromoted chats, members can be sent, settings can be modified without the need of special status messages being sent.</p>
<p>After the creation with <a class="el" href="structmrmailbox__t.html#a47156db87107ec208d6637f460d897a8" title="Create a new group chat. ">mrmailbox_create_group_chat()</a> the chat is usuall unpromoted until the first call to mrmailbox_send_msg() or <a class="el" href="structmrmailbox__t.html#a3f9ac5fb9ff2dcbaafdddb5d955ac39b" title="Send a simple text message a given chat. ">mrmailbox_send_text_msg()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">chat</td><td>The chat object.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1=chat is still unpromoted, no message was ever send to the chat, 0=chat is not unpromoted, messages were send and/or received </dd></dl>
</div>
</div>
<a class="anchor" id="a12bad02bef1fb6c8003f41c72d94f54b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char * mrchat_get_profile_image </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structmrchat__t.html">mrchat_t</a> *&#160;</td>
<td class="paramname"><em>chat</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the chat's profile image. </p>
<p>The profile image is set using <a class="el" href="structmrmailbox__t.html#a08c527170681c949ddd6931a004fdd5f" title="Set group profile image. ">mrmailbox_set_chat_profile_image()</a> for groups. For normal chats, the profile image is set using mrmailbox_set_contact_profile_image() (not yet implemented).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">chat</td><td>The chat object.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Path and file if the profile image, if any. NULL otherwise. Must be free()'d after usage. </dd></dl>
</div>
</div>
<a class="anchor" id="ae1e9920618c9f6cb8ad66d5bb6962a08"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char * mrchat_get_subtitle </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structmrchat__t.html">mrchat_t</a> *&#160;</td>
<td class="paramname"><em>chat</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get a subtitle for a chat. </p>
<p>The subtitle is eg. the email-address or the number of group members.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">chat</td><td>The chat object to calulate the subtitle for.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Subtitle as a string. Must be free()'d after usage. </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a1591431716413350eaffce0b588e4911"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t mrchat_t::m_id</td>
</tr>
</table>
</div><div class="memdoc">
<p>Chat ID under which the chat is filed in the database. </p>
<p>Special IDs:</p><ul>
<li>MR_CHAT_ID_DEADDROP (1) - Messages send from unknown/unwanted users to us, chats_contacts is not set up. This group may be shown normally.</li>
<li>MR_CHAT_ID_STARRED (5) - Virtual chat containing all starred messages-</li>
<li>MR_CHAT_ID_ARCHIVED_LINK (6) - A link at the end of the chatlist, if present the UI should show the button "Archived chats"-</li>
</ul>
<p>"Normal" chat IDs are larger than these special IDs (larger than MR_CHAT_ID_LAST_SPECIAL). </p>
</div>
</div>
<a class="anchor" id="a568c4e6fb9633ffe9a76428db16e0201"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mrchat_t::m_type</td>
</tr>
</table>
</div><div class="memdoc">
<p>Chat type. </p>
<ul>
<li>MR_CHAT_TYPE_NORMAL (100) - a normal chat is a chat with a single contact, chats_contacts contains one record for the user, MR_CONTACT_ID_SELF (see <a class="el" href="structmrcontact__t.html#ab2ee31297c327e04ed14673adbd49716" title="The contact ID. ">mrcontact_t::m_id</a>) is not added.</li>
<li>MR_CHAT_TYPE_GROUP (120) - a group chat, chats_contacts conain all group members, incl. MR_CONTACT_ID_SELF</li>
</ul>
<p>If the chat type is not set, it is MR_CHAT_TYPE_UNDEFINED (0). </p>
</div>
</div>
<a class="anchor" id="abbd344d8d361a1a4d14bfc9b5dc57140"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* mrchat_t::m_name</td>
</tr>
</table>
</div><div class="memdoc">
<p>Name of the chat. </p>
<p>For one-to-one chats, this is the name of the contact. For group chats, this is the name given eg. to <a class="el" href="structmrmailbox__t.html#a47156db87107ec208d6637f460d897a8" title="Create a new group chat. ">mrmailbox_create_group_chat()</a> or received by a group-creation message.</p>
<p>To change the name, use <a class="el" href="structmrmailbox__t.html#a8772e9bb55b02299f65ebd8bcc682bb1" title="Set group name. ">mrmailbox_set_chat_name()</a></p>
<p>NULL if unset. </p>
</div>
</div>
<a class="anchor" id="a565101f53278f5ab1ff58317ffc9555c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">time_t mrchat_t::m_draft_timestamp</td>
</tr>
</table>
</div><div class="memdoc">
<p>Timestamp of the draft. </p>
<p>The draft itself is placed in <a class="el" href="structmrchat__t.html#abe916f48ac83c2ca6476312eae084cfa" title="The draft text. ">mrchat_t::m_draft_text</a>. To save a draft for a chat, use <a class="el" href="structmrmailbox__t.html#af50446c1a5e504d27fe29de9e3b8edc3" title="Save a draft for a chat. ">mrmailbox_set_draft()</a></p>
<p>0 if there is no draft. </p>
</div>
</div>
<a class="anchor" id="abe916f48ac83c2ca6476312eae084cfa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* mrchat_t::m_draft_text</td>
</tr>
</table>
</div><div class="memdoc">
<p>The draft text. </p>
<p>The timetamp of the draft is placed in <a class="el" href="structmrchat__t.html#a565101f53278f5ab1ff58317ffc9555c" title="Timestamp of the draft. ">mrchat_t::m_draft_timestamp</a>. To save a draft for a chat, use <a class="el" href="structmrmailbox__t.html#af50446c1a5e504d27fe29de9e3b8edc3" title="Save a draft for a chat. ">mrmailbox_set_draft()</a></p>
<p>NULL if there is no draft. </p>
</div>
</div>
<a class="anchor" id="abf3e1a34f567e168bc0597f9a544a50d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structmrmailbox__t.html">mrmailbox_t</a>* mrchat_t::m_mailbox</td>
</tr>
</table>
</div><div class="memdoc">
<p>The mailbox object the chat belongs to. </p>
<p>Never NULL. </p>
</div>
</div>
<a class="anchor" id="a5b28b343ceb290d4a613d0e5a7d528bc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mrchat_t::m_archived</td>
</tr>
</table>
</div><div class="memdoc">
<p>Flag for the archived state. </p>
<p>0=normal chat, not archived, not sticky.</p>
<p>1=chat archived</p>
<p>2=chat sticky (reserved for future use, if you do not support this value, just treat the chat as a normal one)</p>
<p>To archive or unarchive chats, use <a class="el" href="structmrmailbox__t.html#a8e04e43dacbe3128afd71e1d6c1b0911" title="Archive or unarchive a chat. ">mrmailbox_archive_chat()</a>. If chats are archived, this should be shown in the UI by a little icon or text, eg. the search will also return archived chats. </p>
</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>/home/bpetersen/projects/deltachat-core/src/<a class="el" href="mrchat_8h_source.html">mrchat.h</a></li>
<li>/home/bpetersen/projects/deltachat-core/src/mrchat.c</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>