Difference between revisions of "Truxton message participant get combined id"
Jump to navigation
Jump to search
(Created page with "This retrieves the combined identifier for the message participant. The "combined id" is an integer value derived from normalized account and server. It allows you to easily q...") |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
This retrieves the combined identifier for the message participant. | This retrieves the combined identifier for the message participant. | ||
| − | |||
| − | |||
=Syntax= | =Syntax= | ||
| Line 11: | Line 9: | ||
==<code>participant_handle</code>== | ==<code>participant_handle</code>== | ||
This handle comes from calling <code>[[truxton_message_participant_create]]()</code>. | This handle comes from calling <code>[[truxton_message_participant_create]]()</code>. | ||
| + | |||
| + | =Return value= | ||
| + | The "combined id" is an integer value derived from normalized account and server. | ||
| + | It allows you to easily query the database for messages associated with an address in the form of "abc@xyz.com" | ||
=Sample= | =Sample= | ||
| Line 37: | Line 39: | ||
truxton_message_participant_get_media_id( participant_handle, string_value, sizeof(string_value) ); | truxton_message_participant_get_media_id( participant_handle, string_value, sizeof(string_value) ); | ||
printf( "Media ID: %s\n", string_value ); | printf( "Media ID: %s\n", string_value ); | ||
| − | |||
| − | |||
| − | |||
truxton_message_participant_get_message_address_id( participant_handle, string_value, sizeof(string_value) ); | truxton_message_participant_get_message_address_id( participant_handle, string_value, sizeof(string_value) ); | ||
| Line 57: | Line 56: | ||
} | } | ||
</source> | </source> | ||
| + | |||
| + | The <code>PRIu64</code> in the sample code above is a standard way of [https://en.wikipedia.org/wiki/C_data_types#Printf_and_scanf_format_specifiers formatting] a 64-bit unsigned integer in C. | ||
| + | Over the years, different compilers on different operating systems used different format specifiers for things, these <code>PRI</code> macros, along with some tricky string concatenation the compilers perform for you, allow you to maintain a single code base without a bunch of macro magic. | ||
Latest revision as of 06:59, 19 February 2026
This retrieves the combined identifier for the message participant.
Syntax
uint64_t truxton_message_participant_get_combined_id( uint64_t participant_handle );
Parameters
participant_handle
This handle comes from calling truxton_message_participant_create().
Return value
The "combined id" is an integer value derived from normalized account and server. It allows you to easily query the database for messages associated with an address in the form of "abc@xyz.com"
Sample
void dump(uint64_t participant_handle)
{
char string_value[512];
uint64_t integer = 0;
truxton_message_participant_get_id( participant_handle, string_value, sizeof(string_value) );
printf( "ID: %s\n", string_value );
integer_value = truxton_message_participant_get_combined_id( participant_handle );
printf( "Combined ID: %" PRIu64 "\n", integer_value );
truxton_message_participant_get_combined_guid( participant_handle, string_value, sizeof(string_value) );
printf( "Combined GUID: %s\n", string_value );
truxton_message_participant_get_account( participant_handle, string_value, sizeof(string_value) );
printf( "Account: %s\n", string_value );
truxton_message_participant_get_file_id( participant_handle, string_value, sizeof(string_value) );
printf( "File ID: %s\n", string_value );
truxton_message_participant_get_media_id( participant_handle, string_value, sizeof(string_value) );
printf( "Media ID: %s\n", string_value );
truxton_message_participant_get_message_address_id( participant_handle, string_value, sizeof(string_value) );
printf( "Message Address ID: %s\n", string_value );
truxton_message_participant_get_message_id( participant_handle, string_value, sizeof(string_value) );
printf( "Message ID: %s\n", string_value );
truxton_message_participant_get_server( participant_handle, string_value, sizeof(string_value) );
printf( "Server: %s\n", string_value );
truxton_message_participant_get_name( participant_handle, string_value, sizeof(string_value) );
printf( "Name: %s\n", string_value );
integer_value = truxton_message_participant_get_type( participant_handle );
printf( "Type: %" PRIu64 "\n", integer_value );
}
The PRIu64 in the sample code above is a standard way of formatting a 64-bit unsigned integer in C.
Over the years, different compilers on different operating systems used different format specifiers for things, these PRI macros, along with some tricky string concatenation the compilers perform for you, allow you to maintain a single code base without a bunch of macro magic.