Difference between revisions of "Truxton communication get file id"
Jump to navigation
Jump to search
(Created page with "This will retrieve the identifier of the file the message came from. It corresponds to the <code>[FileID]</code> column of the <code>[Message]</code> table. =Syntax= <source...") |
(→Sample) |
||
| Line 28: | Line 28: | ||
if ( strcmp( id, "00000000-0000-0000-0000-000000000000" ) != 0 ) | if ( strcmp( id, "00000000-0000-0000-0000-000000000000" ) != 0 ) | ||
{ | { | ||
| − | truxton_file_get_id | + | truxton_file_get_id( parent_file, id, sizeof(id) ); |
truxton_communication_set_file_id( communication, id ); | truxton_communication_set_file_id( communication, id ); | ||
} | } | ||
} | } | ||
</source> | </source> | ||
Latest revision as of 16:59, 16 May 2023
This will retrieve the identifier of the file the message came from.
It corresponds to the [FileID] column of the [Message] table.
Syntax
void truxton_communication_get_file_id( uint64_t communication_handle, char * buffer, size_t buffer_size );
Parameters
communication_handle
The handle returned by calling truxton_communication_create.
buffer
The buffer to write the identifier to.
buffer_size
The number of bytes that can be written to buffer.
Sample
void optionally_set_message_file( uint64_t communication, uint64_t parent_file )
{
char id[40];
truxton_communication_get_file_id( communication, id, sizeof(id) );
if ( strcmp( id, "00000000-0000-0000-0000-000000000000" ) != 0 )
{
truxton_file_get_id( parent_file, id, sizeof(id) );
truxton_communication_set_file_id( communication, id );
}
}