2005-01-24 [paul] 1.0.0cvs12.1
[claws.git] / src / messageview.c
index c7cb84d3382989961862354917e579e7b392a6ef..b10c53858645aedc89211c1373f48683fd43b6d8 100644 (file)
@@ -643,7 +643,7 @@ static gint disposition_notification_send(MsgInfo *msginfo)
        fprintf(fp, "Subject: Disposition notification: %s\n", buf);
 
        /* Message ID */
-       generate_msgid(account->address, buf, sizeof buf);
+       generate_msgid(buf, sizeof(buf));
        fprintf(fp, "Message-ID: <%s>\n", buf);
 
        if (fclose(fp) == EOF) {
@@ -735,6 +735,8 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
        if (messageview->msginfo != msginfo) {
                procmsg_msginfo_free(messageview->msginfo);
                messageview->msginfo = procmsg_msginfo_get_full_info(msginfo);
+               if (!messageview->msginfo)
+                       messageview->msginfo = procmsg_msginfo_copy(msginfo);
        }
        headerview_show(messageview->headerview, messageview->msginfo);
 
@@ -961,7 +963,7 @@ void messageview_save_as(MessageView *messageview)
 {
        gchar *filename = NULL;
        MsgInfo *msginfo;
-       gchar *src, *dest;
+       gchar *src, *dest, *tmp;
 
        if (!messageview->msginfo) return;
        msginfo = messageview->msginfo;
@@ -983,9 +985,11 @@ void messageview_save_as(MessageView *messageview)
 
        src = procmsg_get_message_file(msginfo);
        if (copy_file(src, dest, TRUE) < 0) {
-               alertpanel_error(_("Can't save the file `%s'."),
-                                g_basename(dest));
+               tmp =  g_path_get_basename(dest);
+               alertpanel_error(_("Can't save the file `%s'."), tmp);
+               g_free(tmp);
        }
+       g_free(dest);
        g_free(src);
 }
 
@@ -1052,7 +1056,7 @@ static void return_receipt_show(NoticeView *noticeview, MsgInfo *msginfo)
        noticeview_set_text(noticeview, _("This message asks for a return receipt."));
        noticeview_set_button_text(noticeview, _("Send receipt"));
        noticeview_set_button_press_callback(noticeview,
-                                            GTK_SIGNAL_FUNC(return_receipt_send_clicked),
+                                            G_CALLBACK(return_receipt_send_clicked),
                                             (gpointer) msginfo);
        noticeview_show(noticeview);
 }
@@ -1136,11 +1140,11 @@ static void partial_recv_show(NoticeView *noticeview, MsgInfo *msginfo)
        g_free(text);
        noticeview_set_button_text(noticeview, button1);
        noticeview_set_button_press_callback(noticeview,
-                    GTK_SIGNAL_FUNC(button1_cb), (gpointer) msginfo);
+                    G_CALLBACK(button1_cb), (gpointer) msginfo);
 
        noticeview_set_2ndbutton_text(noticeview, button2);
        noticeview_set_2ndbutton_press_callback(noticeview,
-                    GTK_SIGNAL_FUNC(button2_cb), (gpointer) msginfo);
+                    G_CALLBACK(button2_cb), (gpointer) msginfo);
 
        noticeview_show(noticeview);
 }
@@ -1551,7 +1555,7 @@ void messageview_set_menu_sensitive(MessageView *messageview)
        GtkItemFactory *ifactory;
        GtkWidget *menuitem;
 
-       if (!messageview && !messageview->new_window) 
+       if (!messageview || !messageview->new_window) 
                return;
        /* do some smart things */
        if (!messageview->menubar) return;