Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle the recipients structure #119

Open
tt376 opened this issue Aug 28, 2023 · 0 comments
Open

How to handle the recipients structure #119

tt376 opened this issue Aug 28, 2023 · 0 comments

Comments

@tt376
Copy link

tt376 commented Aug 28, 2023

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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant