mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-06 12:00:11 +02:00
add functions to replace the former direct structure access
This commit is contained in:
parent
adb7ea8b29
commit
352ddc1121
8 changed files with 86 additions and 7 deletions
19
src/mrmsg.c
19
src/mrmsg.c
|
@ -150,6 +150,25 @@ uint32_t mrmsg_get_from_id(mrmsg_t* msg)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the ID of chat the message belongs to.
|
||||
* To get details about the chat, pass the returned ID to mrmailbox_get_chat().
|
||||
*
|
||||
* @memberof mrmsg_t
|
||||
*
|
||||
* @param msg The message object.
|
||||
*
|
||||
* @return the ID of the chat the message belongs to, 0 on errors.
|
||||
*/
|
||||
uint32_t mrmsg_get_chat_id(mrmsg_t* msg)
|
||||
{
|
||||
if( msg == NULL || msg->m_magic != MR_MSG_MAGIC ) {
|
||||
return 0;
|
||||
}
|
||||
return msg->m_chat_id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the type of the message.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue