#include "modest-formatter.h"
#include "modest-text-utils.h"
#include "modest-tny-platform-factory.h"
+#include <modest-runtime.h>
typedef struct _ModestFormatterPrivate ModestFormatterPrivate;
struct _ModestFormatterPrivate {
gchar *content_type;
+ gchar *signature;
};
#define MODEST_FORMATTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
MODEST_TYPE_FORMATTER, \
TnyMsg *new_msg = NULL;
gchar *body_text = NULL, *txt = NULL;
ModestFormatterPrivate *priv;
- TnyPlatformFactory *fact;
g_return_val_if_fail (self, NULL);
g_return_val_if_fail (header, NULL);
g_return_val_if_fail (func, NULL);
/* Build new part */
- fact = modest_tny_platform_factory_get_instance ();
- new_msg = tny_platform_factory_new_msg (fact);
+ new_msg = tny_platform_factory_new_msg (modest_runtime_get_platform_factory());
if (body)
body_text = extract_text (self, body);
ModestFormatterPrivate *priv;
TnyPlatformFactory *fact;
- fact = modest_tny_platform_factory_get_instance ();
+ fact = modest_runtime_get_platform_factory ();
/* Build new part */
new_msg = tny_platform_factory_new_msg (fact);
body_part = tny_platform_factory_new_mime_part (fact);
}
ModestFormatter*
-modest_formatter_new (const gchar *content_type)
+modest_formatter_new (const gchar *content_type, const gchar *signature)
{
ModestFormatter *formatter;
ModestFormatterPrivate *priv;
formatter = g_object_new (MODEST_TYPE_FORMATTER, NULL);
priv = MODEST_FORMATTER_GET_PRIVATE (formatter);
priv->content_type = g_strdup (content_type);
+ priv->signature = g_strdup (signature);
return formatter;
}
if (priv->content_type)
g_free (priv->content_type);
+ if (priv->signature)
+ g_free (priv->signature);
+
(*parent_class->finalize) (object);
}
return modest_text_utils_cite (text,
priv->content_type,
+ priv->signature,
tny_header_get_from (header),
tny_header_get_date_sent (header));
}
return modest_text_utils_inline (text,
priv->content_type,
+ priv->signature,
tny_header_get_from (header),
tny_header_get_date_sent (header),
tny_header_get_to (header),
/* TODO: get 80 from the configuration */
return modest_text_utils_quote (text,
priv->content_type,
+ priv->signature,
tny_header_get_from (header),
tny_header_get_date_sent (header),
80);