summaryrefslogtreecommitdiff
path: root/libmu_cpp/message.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libmu_cpp/message.cc')
-rw-r--r--libmu_cpp/message.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/libmu_cpp/message.cc b/libmu_cpp/message.cc
index 21f3ec6d1..a02360051 100644
--- a/libmu_cpp/message.cc
+++ b/libmu_cpp/message.cc
@@ -224,8 +224,25 @@ Message :: get_attachment_name ()
char *c_name;
std::string name;
- /* FIXME: CS/Lang info is ignored */
- int status = mu_message_aget_attachment_name (msg, &c_name, NULL);
+ int status = mu_message_aget_decoded_attachment_name (msg, NULL, &c_name,
+ NULL);
+ if (status)
+ throw Exception ("Message::get_attachment_name", status);
+ if (c_name) {
+ name = c_name;
+ free (c_name);
+ }
+ return name;
+}
+
+std::string
+Message :: get_attachment_name (const std::string& charset, char *lang)
+{
+ char *c_name;
+ std::string name;
+
+ int status = mu_message_aget_decoded_attachment_name (msg, charset.c_str (),
+ &c_name, &lang);
if (status)
throw Exception ("Message::get_attachment_name", status);
if (c_name) {

Return to:

Send suggestions and report system problems to the System administrator.