Difference between revisions of "Truxton message set media id"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "Sets the identifier of the media in the message. This corresponds to the <code>MediaID</code> column of the <code> File</code> table. =Syntax= <syntaxhighligh...")
 
Line 1: Line 1:
 
Sets the identifier of the media in the message.
 
Sets the identifier of the media in the message.
This corresponds to the <code>MediaID</code> column of the <code>[[File Table | File]]</code> table.
+
This corresponds to the <code>[MediaID]</code> column of the <code><nowiki>[</nowiki>[[File Table|File]]<nowiki>]</nowiki></code> table as well as the <code>{ID]</code> column of the <code>[Media]</code> table.
  
 
=Syntax=
 
=Syntax=
Line 19: Line 19:
  
 
=Sample=
 
=Sample=
<syntaxhighlight lang="C" highlight="7">
+
<source lang="C" highlight="7">
 
void set_parent(uint64_t message, uint64_t file)
 
void set_parent(uint64_t message, uint64_t file)
 
{
 
{
Line 28: Line 28:
 
   truxton_message_set_media_id( message, id );
 
   truxton_message_set_media_id( message, id );
 
}
 
}
</syntaxhighlight>
+
</source>

Revision as of 15:47, 22 October 2020

Sets the identifier of the media in the message. This corresponds to the [MediaID] column of the [File] table as well as the {ID] column of the [Media] table.

Syntax

void truxton_message_set_media_id( uint64_t message_handle, char * id );

Parameters

message_handle

The handle created by the truxton_message_create call.

id

The string representation of a GUID.

Remarks

This identifier should be a value from the ID column of the File table in the database.

Sample

void set_parent(uint64_t message, uint64_t file)
{
   char id[40];

   truxton_file_get_media_id(file, id, sizeof(id));

   truxton_message_set_media_id( message, id );
}