Skip to content

How to handle the recipients structure #119

@tt376

Description

@tt376

Thank you for developing many wonderful libraries.

I used the "libpff_message_get_recipients" function to get the recipients structure from the message.
When I tried to get detailed information from recipients, all functions related to recipients were deprecated.
I wrote the code below to enumerate the recipients, but is this redundant writing recommended?
Why is the recipients function deprecated?

libpff_item_t* recipients = NULL;
libpff_message_get_recipients(sub_message, &recipients, NULL);
int number_of_recipient;
libpff_item_get_number_of_record_sets(recipients, &number_of_recipient, NULL);
for (int i = 0; i < number_of_recipient; i++)
{
	libpff_record_set_t* recipient_record_set = NULL;
	libpff_item_get_record_set_by_index(recipients, i, &recipient_record_set, NULL);

	libpff_record_entry_t* recipient_name_record_entry = NULL;
	libpff_record_set_get_entry_by_type(recipient_record_set, LIBPFF_ENTRY_TYPE_RECIPIENT_DISPLAY_NAME, 0, &recipient_name_record_entry,LIBPFF_ENTRY_VALUE_FLAG_MATCH_ANY_VALUE_TYPE, NULL);

	uint8_t recipient_name[128];
	libpff_record_entry_get_data_as_utf8_string(recipient_name_record_entry, recipient_name, 128, NULL);
	cout << DataConverter::utf8_to_multi_winapi(string(reinterpret_cast<char*>(recipient_name), 128)) << endl;
	(Omitted memory release)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions