Truxton communication get file id

From truxwiki.com
Jump to navigation Jump to search

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 );
   }
}