gchar *procmsg_get_message_file_path(MsgInfo *msginfo)
{
- gchar *path, *file;
+ gchar *file;
g_return_val_if_fail(msginfo != NULL, NULL);
if (msginfo->plaintext_file)
file = g_strdup(msginfo->plaintext_file);
else {
- path = folder_item_get_path(msginfo->folder);
- file = g_strconcat(path, G_DIR_SEPARATOR_S,
- itos(msginfo->msgnum), NULL);
- g_free(path);
+ file = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
}
return file;
else
tokens = g_strsplit(fwdmessageid, "\x7f", 0);
item = folder_find_item_from_identifier(tokens[0]);
- if (item != NULL) {
+
+ /* check if queued message has valid folder and message id */
+ if (item != NULL && tokens[2] != NULL) {
MsgInfo *msginfo;
msginfo = folder_item_get_msginfo(item, atoi(tokens[1]));
-
- /*!< note that if the message has no msgid (maybe it was invalid),
- * we also refuse to do something with the reply to flag */
+
+ /* check if referring message exists and has a message id */
if ((msginfo != NULL) &&
(msginfo->msgid != NULL) &&
(strcmp(msginfo->msgid, tokens[2]) != 0)) {