-
-static gchar *
-modest_ui_quote_msg(const TnyMsgIface *src, const gchar *from, time_t sent_date)
-{
- GList *parts;
- TnyMsgMimePartIface *part;
- TnyStreamIface* stream;
- TnyTextBufferStream *dest;
- TnyMsgMimePartIface *body = NULL;
- GtkTextBuffer *buf;
- gint limit = 76; /* TODO: make configurable */
- gchar *quoted;
-
- buf = gtk_text_buffer_new(NULL);
- dest = tny_text_buffer_stream_new(buf);
-
- /* is the warning in this line due to a bug in tinymail? */
- parts = (GList*) tny_msg_iface_get_parts (src);
-
- while (parts) {
- /* TODO: maybe we'd like to quote more than one part? */
- TnyMsgMimePartIface *part =
- TNY_MSG_MIME_PART_IFACE(parts->data);
- if (tny_msg_mime_part_iface_content_type_is (part, "text/plain")) {
- body = part;
- break;
- }
- parts = parts->next;
- }
- if (!body) {
- return NULL;
- }
- buf = gtk_text_buffer_new (NULL);
- stream = TNY_STREAM_IFACE(tny_text_buffer_stream_new (buf));
-
- tny_stream_iface_reset (stream);
- tny_msg_mime_part_iface_decode_to_stream (body, stream);
- tny_stream_iface_reset (stream);
-
- quoted = modest_text_utils_quote (buf, from, sent_date, limit);
-
- g_object_unref(stream);
- g_object_unref(buf);
- return quoted;
-}
-