From: Alfons Hoogervorst Date: Tue, 29 Jul 2003 08:27:28 +0000 (+0000) Subject: * src/procmsg.[ch] X-Git-Tag: rel_0_9_4~38 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=82bfbddb07914b86b9a03845636822c09dffa544 * 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.) --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 0447d8bf3..faa4aa412 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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 diff --git a/configure.ac b/configure.ac index 4ff5b1523..a418e4ab4 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/messageview.c b/src/messageview.c index 24028cf45..b7bc73981 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -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); } diff --git a/src/procheader.c b/src/procheader.c index d2a05cc17..e008e0585 100644 --- a/src/procheader.c +++ b/src/procheader.c @@ -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: diff --git a/src/procmsg.c b/src/procmsg.c index 19cd88783..958024287 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -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); diff --git a/src/procmsg.h b/src/procmsg.h index 245308711..650b82d6f 100644 --- a/src/procmsg.h +++ b/src/procmsg.h @@ -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"