-/**
- * modest_mail_operation_create_reply_mail:
- * @msg: a valid #TnyMsg instance
- * @reply_type: the format of the new message
- * @reply_mode: the mode of reply, to the sender only, to a mail list or to all
- *
- * creates a new message to reply to an existing one
- *
- * Returns: Returns: a new #TnyMsg, or NULL in case of error
- **/
-TnyMsg*
-modest_mail_operation_create_reply_mail (TnyMsg *msg,
- const gchar *from,
- ModestMailOperationReplyType reply_type,
- ModestMailOperationReplyMode reply_mode)
-{
- TnyMsg *new_msg;
- TnyHeader *new_header, *header;
-
- new_msg = create_reply_forward_mail (msg, from, TRUE, reply_type);
-
- /* Fill the header */
- header = tny_msg_get_header (msg);
- new_header = tny_msg_get_header (new_msg);
- tny_header_set_to (new_header, tny_header_get_from (header));
-
- switch (reply_mode) {
- gchar *new_cc = NULL;
- const gchar *cc = NULL, *bcc = NULL;
- GString *tmp = NULL;
-
- case MODEST_MAIL_OPERATION_REPLY_MODE_SENDER:
- /* Do not fill neither cc nor bcc */
- break;
- case MODEST_MAIL_OPERATION_REPLY_MODE_LIST:
- /* TODO */
- break;
- case MODEST_MAIL_OPERATION_REPLY_MODE_ALL:
- /* Concatenate to, cc and bcc */
- cc = tny_header_get_cc (header);
- bcc = tny_header_get_bcc (header);
-
- tmp = g_string_new (tny_header_get_to (header));
- if (cc) g_string_append_printf (tmp, ",%s",cc);
- if (bcc) g_string_append_printf (tmp, ",%s",bcc);
-
- /* Remove my own address from the cc list */
- new_cc = (gchar *)
- modest_text_utils_remove_address ((const gchar *) tmp->str,
- (const gchar *) from);
- /* FIXME: remove also the mails from the new To: */
- tny_header_set_cc (new_header, new_cc);
-
- /* Clean */
- g_string_free (tmp, TRUE);
- g_free (new_cc);
- break;