Truxton message participant create

From truxwiki.com
Jump to navigation Jump to search

This creates a message participant object.

Syntax

uint64_t truxton_message_participant_create( uint64_t truxton_handle );

Parameters

truxton_handle

The Truxton instance this address will belong. This handle comes from calling truxton_create().

Return value

A handle to a message participant object.

Sample

void process_participant_result(uint64_t truxton, PGresult * result, int row_number)
{
    uint64_t participant_handle = truxton_message_participant_create(truxton);

    truxton_message_participant_set_id(participant_handle, ::PQgetvalue(result, row_number, 0));
    truxton_message_participant_set_media_id(participant_handle, ::PQgetvalue(result, row_number, 1));
    truxton_message_participant_set_file_id(participant_handle, ::PQgetvalue(result, row_number, 2));
    truxton_message_participant_set_message_address_id(participant_handle, ::PQgetvalue(result, row_number, 3));
    truxton_message_participant_set_message_id(participant_handle, ::PQgetvalue(result, row_number, 4));
    truxton_message_participant_set_type(participant_handle, atoi(result, row_number, 5));
    truxton_message_participant_set_account(participant_handle, ::PQgetvalue(result, row_number, 7));
    truxton_message_participant_set_server(participant_handle, ::PQgetvalue(result, row_number, 8));
    truxton_message_participant_set_name(participant_handle, ::PQgetvalue(result, row_number, 9));

    dump(participant_handle);

    truxton_message_participant_destroy(participant_handle);
}