* src/procmsg.[ch]
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Tue, 29 Jul 2003 08:27:28 +0000 (08:27 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Tue, 29 Jul 2003 08:27:28 +0000 (08:27 +0000)
* src/messageview.c
* src/procheader.c
rewrite return receipt request work a little bit (the former
implementation presumably depended too much on the UI setting
flags). (we're losing the old pending flag.)

ChangeLog.claws
configure.ac
src/messageview.c
src/procheader.c
src/procmsg.c
src/procmsg.h

index 0447d8bf343c5411e1520d86331076f287fb08b5..faa4aa4125a62349f2b24c8361c30fcfe1c12e70 100644 (file)
@@ -1,3 +1,12 @@
+2003-07-28 [alfons]    0.9.3claws69
+
+       * src/procmsg.[ch]
+       * src/messageview.c
+       * src/procheader.c
+               rewrite return receipt request work a little bit (the former 
+               implementation presumably depended too much on the UI setting
+               flags). (we're losing the old pending flag.) 
+
 2003-07-28 [christoph] 0.9.3claws68
 
        * src/folder.c
index 4ff5b152347d1cb7f733de8aadc774eecc6dfe9e..a418e4ab4c467962e3755d711ab485b0e78b3b5e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=68
+EXTRA_VERSION=69
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 24028cf45323b15ea5697a9866a532a0fa408209..b7bc73981e3f37336c217e1a063edb5d1adb868f 100644 (file)
@@ -710,7 +710,9 @@ void messageview_show(MessageView *messageview, MsgInfo *msginfo,
                procmime_mimeinfo_free_all(mimeinfo);
        }
 
-       if (MSG_IS_RETRCPT_PENDING(messageview->msginfo->flags))
+       if ((messageview->msginfo->dispositionnotificationto || 
+            messageview->msginfo->returnreceiptto) &&
+           !MSG_IS_RETRCPT_SENT(messageview->msginfo->flags))
                return_receipt_show(messageview->noticeview, messageview->msginfo);
        else 
                noticeview_hide(messageview->noticeview);
@@ -1076,7 +1078,7 @@ static void return_receipt_send_clicked(NoticeView *noticeview, MsgInfo *msginfo
        tmpmsginfo->msgnum = msginfo->msgnum;
 
        if (disposition_notification_send(tmpmsginfo) >= 0) {
-               procmsg_msginfo_unset_flags(msginfo, MSG_RETRCPT_PENDING, 0);
+               procmsg_msginfo_set_flags(msginfo, MSG_RETRCPT_SENT, 0);
                noticeview_hide(noticeview);
        }               
 
index d2a05cc17f8ac75d8b3fb71acdfd8bd59df7879e..e008e0585d956b487b5b0ee543e25639a40158b5 100644 (file)
@@ -665,12 +665,10 @@ MsgInfo *procheader_parse_stream(FILE *fp, MsgFlags flags, gboolean full,
                case H_DISPOSITION_NOTIFICATION_TO:
                        if (msginfo->dispositionnotificationto) break;
                        msginfo->dispositionnotificationto = g_strdup(hp);
-                       MSG_SET_PERM_FLAGS(msginfo->flags, MSG_RETRCPT_PENDING);        
                        break;
                case H_RETURN_RECEIPT_TO:
                        if (msginfo->returnreceiptto) break;
                        msginfo->returnreceiptto = g_strdup(hp);
-                       MSG_SET_PERM_FLAGS(msginfo->flags, MSG_RETRCPT_PENDING);        
                        break;
 #ifdef ALLOW_HEADER_HINT                       
                case H_STATUS:
index 19cd8878329f2cd47b9584dca98504ca51e9a851..958024287ed02d952134e1cbc6bebfeb77a9f638 100644 (file)
@@ -730,7 +730,7 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file,
                            gboolean is_queued)
 {
        gint num;
-       MsgInfo *msginfo;
+       MsgInfo *msginfo, *tmp_msginfo;
 
        debug_print("saving sent message...\n");
 
@@ -762,10 +762,17 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file,
                }
                return -1;
        }
-       msginfo = folder_item_get_msginfo(outbox, num);
+       msginfo = folder_item_get_msginfo(outbox, num);         /* refcnt++ */
+       tmp_msginfo = procmsg_msginfo_get_full_info(msginfo);   /* refcnt++ */ 
        if (msginfo != NULL) {
-           procmsg_msginfo_unset_flags(msginfo, ~0, 0);
-           procmsg_msginfo_free(msginfo);
+               procmsg_msginfo_unset_flags(msginfo, ~0, 0);
+               procmsg_msginfo_free(msginfo);                  /* refcnt-- */
+               /* tmp_msginfo == msginfo */
+               if (tmp_msginfo && (msginfo->dispositionnotificationto || 
+                   msginfo->returnreceiptto)) {
+                       procmsg_msginfo_set_flags(msginfo, MSG_RETRCPT_SENT, 0); 
+                       procmsg_msginfo_free(msginfo);          /* refcnt-- */
+               }       
        }
        folder_item_update(outbox, TRUE);
 
index 245308711ffea4603d13b3c9b824376d79abdd92..650b82d6f6162d1ce51f99d5670a584ecf22c9ef 100644 (file)
@@ -71,7 +71,8 @@ typedef GSList MsgNumberList;
 
 #define MSG_IGNORE_THREAD      (1U << 10)   /* ignore threads */
 #define MSG_LOCKED             (1U << 11)   /* msg is locked  */
-#define MSG_RETRCPT_PENDING    (1U << 12)   /* return receipt pending */
+#define MSG_RETRCPT_SENT       (1U << 12)   /* new one */ 
+                                               
 /* RESERVED */
 #define        MSG_RESERVED_CLAWS      (1U << 30)   /* for sylpheed-claws */
 #define        MSG_RESERVED            (1U << 31)
@@ -138,6 +139,7 @@ typedef guint32 MsgTmpFlags;
 #define MSG_IS_REALLY_DELETED(msg)     (((msg).perm_flags & MSG_REALLY_DELETED) != 0)
 #define MSG_IS_IGNORE_THREAD(msg)      (((msg).perm_flags & MSG_IGNORE_THREAD) != 0)
 #define MSG_IS_RETRCPT_PENDING(msg)    (((msg).perm_flags & MSG_RETRCPT_PENDING) != 0)
+#define MSG_IS_RETRCPT_SENT(msg)       (((msg).perm_flags & MSG_RETRCPT_SENT) != 0)
 
 #define MSGINFO_UPDATE_HOOKLIST "msginfo_update"
 #define MAIL_FILTERING_HOOKLIST "mail_filtering_hooklist"