@@ -56,6 +56,7 @@
#define MAX_ATTACHMENTS_NUMBER 25
#define MAX_ATTEMPTS 3
+#define DEFAULT_MAX_ATTACHMENT_TOTAL_SIZE 1100000
#define SETTINGS_STORE "mms"
#define SETTINGS_GROUP "Settings"
@@ -100,6 +101,7 @@ struct mms_service {
GHashTable *messages;
GKeyFile *settings;
gboolean use_delivery_reports;
+ int max_attach_total_size;
};
enum mms_request_type {
@@ -146,7 +148,22 @@ static void mms_load_settings(struct mms_service
*service)
g_key_file_set_boolean(service->settings,
SETTINGS_GROUP,
"UseDeliveryReports",
service-
>use_delivery_reports);
+ error = NULL;
}
+
+ service->max_attach_total_size =
+ g_key_file_get_integer(service->settings,
SETTINGS_GROUP,
+ "TotalMaxAttachmentSiz
e", &error);
+
+ if (error) {
+ g_error_free(error);
+ service->max_attach_total_size =
DEFAULT_MAX_ATTACHMENT_TOTAL_SIZE;
+ g_key_file_set_integer(service->settings,
SETTINGS_GROUP,
+ "TotalMaxAttachmentSiz