+2006-03-16 [colin] 2.0.0cvs141
+
+ * src/procmsg.h
+ * src/procmsg.c
+ * src/folder.c
+ Fix POSTPROCESSING hook
+ Patch by H. Merijn Brand
+
+ * src/procmime.c
+ * src/procmime.h
+ Parse Content-Location
+
+ * src/toolbar.c
+ * src/messageview.c
+ * src/messageview.h
+ Don't crash when a top-level MessageView has
+ been closed on us. Same problematic than
+ yesterday's quicksearch issue.
+
2006-03-15 [colin] 2.0.0cvs140
* src/gtk/quicksearch.c
( cvs diff -u -r 1.5.2.20 -r 1.5.2.21 src/prefs_spelling.c; ) > 2.0.0cvs138.patchset
( cvs diff -u -r 1.17.2.21 -r 1.17.2.22 src/alertpanel.c; ) > 2.0.0cvs139.patchset
( cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/gtk/quicksearch.c; cvs diff -u -r 1.395.2.181 -r 1.395.2.182 src/summaryview.c; ) > 2.0.0cvs140.patchset
+( cvs diff -u -r 1.150.2.57 -r 1.150.2.58 src/procmsg.c; cvs diff -u -r 1.60.2.26 -r 1.60.2.27 src/procmsg.h; cvs diff -u -r 1.213.2.85 -r 1.213.2.86 src/folder.c; cvs diff -u -r 1.49.2.74 -r 1.49.2.75 src/procmime.c; cvs diff -u -r 1.17.2.14 -r 1.17.2.15 src/procmime.h; cvs diff -u -r 1.43.2.41 -r 1.43.2.42 src/toolbar.c; cvs diff -u -r 1.94.2.80 -r 1.94.2.81 src/messageview.c; cvs diff -u -r 1.19.2.7 -r 1.19.2.8 src/messageview.h; ) > 2.0.0cvs141.patchset
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=140
+EXTRA_VERSION=141
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
== POP3_PARTIAL_DLOAD_DLOAD) {
partial_mark_for_download(newmsginfo);
}
+ if (!MSG_IS_POSTFILTERED (msginfo->flags)) {
+ procmsg_msginfo_set_flags ( msginfo, MSG_POSTFILTERED, 0);
+ procmsg_msginfo_set_flags (newmsginfo, MSG_POSTFILTERED, 0);
+ hooks_invoke (MAIL_POSTFILTERING_HOOKLIST, newmsginfo);
+ }
procmsg_msginfo_free(newmsginfo);
debug_print("destroy messageview\n");
messageview_list = g_list_remove(messageview_list, messageview);
- hooks_unregister_hook(MSGINFO_UPDATE_HOOKLIST,
+ if (!messageview->deferred_destroy) {
+ hooks_unregister_hook(MSGINFO_UPDATE_HOOKLIST,
messageview->msginfo_update_callback_id);
+ }
+
+ if (messageview->updating) {
+ debug_print("uh oh, better not touch that now\n");
+ messageview->deferred_destroy = TRUE;
+ gtk_widget_hide(messageview->window);
+ return;
+ }
headerview_destroy(messageview->headerview);
mimeview_destroy(messageview->mimeview);
gboolean all_headers;
gint msginfo_update_callback_id;
+ gboolean updating;
+ gboolean deferred_destroy;
};
MessageView *messageview_create (MainWindow *mainwin);
g_free(mimeinfo->subtype);
g_free(mimeinfo->description);
g_free(mimeinfo->id);
+ g_free(mimeinfo->location);
g_hash_table_foreach_remove(mimeinfo->typeparameters,
procmime_mimeinfo_parameters_destroy, NULL);
return g_strdup_printf("%s/%s", type_str, subtype);
}
-int procmime_parse_mimepart(MimeInfo *parent,
+static int procmime_parse_mimepart(MimeInfo *parent,
gchar *content_type,
gchar *content_encoding,
gchar *content_description,
gchar *content_id,
gchar *content_disposition,
+ gchar *content_location,
const gchar *filename,
guint offset,
guint length);
NULL, TRUE},
{"Content-Disposition:",
NULL, TRUE},
+ {"Content-Location:",
+ NULL, TRUE},
{"MIME-Version:",
NULL, TRUE},
{NULL, NULL, FALSE}};
g_free(hentry[4].body);
hentry[4].body = tmp;
}
+ if (hentry[5].body != NULL) {
+ tmp = conv_unmime_header(hentry[5].body, NULL);
+ g_free(hentry[5].body);
+ hentry[5].body = tmp;
+ }
content_start = ftell(fp);
fclose(fp);
procmime_parse_mimepart(mimeinfo,
hentry[0].body, hentry[1].body,
hentry[2].body, hentry[3].body,
- hentry[4].body,
+ hentry[4].body, hentry[5].body,
mimeinfo->data.filename, content_start,
mimeinfo->length - (content_start - mimeinfo->offset));
NULL, TRUE},
{"Content-Disposition:",
NULL, TRUE},
+ {"Content-Location:",
+ NULL, TRUE},
{NULL, NULL, FALSE}};
gchar *p, *tmp;
gchar *boundary;
result = procmime_parse_mimepart(mimeinfo,
hentry[0].body, hentry[1].body,
hentry[2].body, hentry[3].body,
- hentry[4].body,
+ hentry[4].body, hentry[5].body,
mimeinfo->data.filename, lastoffset,
(ftell(fp) - strlen(buf)) - lastoffset - 1);
}
g_free(hentry[4].body);
hentry[4].body = tmp;
}
+ if (hentry[5].body != NULL) {
+ tmp = conv_unmime_header(hentry[5].body, NULL);
+ g_free(hentry[5].body);
+ hentry[5].body = tmp;
+ }
lastoffset = ftell(fp);
}
}
return;
}
-int procmime_parse_mimepart(MimeInfo *parent,
+static int procmime_parse_mimepart(MimeInfo *parent,
gchar *content_type,
gchar *content_encoding,
gchar *content_description,
gchar *content_id,
gchar *content_disposition,
+ gchar *content_location,
const gchar *filename,
guint offset,
guint length)
else
mimeinfo->id = NULL;
+ if (content_location != NULL)
+ mimeinfo->location = g_strdup(content_location);
+ else
+ mimeinfo->location = NULL;
+
if (content_disposition != NULL)
procmime_parse_content_disposition(content_disposition, mimeinfo);
else
if (mimeinfo->id != NULL)
fprintf(fp, "Content-ID: %s\n", mimeinfo->id);
+ if (mimeinfo->location != NULL)
+ fprintf(fp, "Content-Location: %s\n", mimeinfo->location);
+
if (mimeinfo->disposition != DISPOSITIONTYPE_UNKNOWN) {
ParametersData *pdata = g_new0(ParametersData, 1);
gchar *buf = NULL;
g_ascii_strncasecmp(buf, "Content-Transfer-Encoding:", 26) == 0 ||
g_ascii_strncasecmp(buf, "Content-Description:", 20) == 0 ||
g_ascii_strncasecmp(buf, "Content-ID:", 11) == 0 ||
+ g_ascii_strncasecmp(buf, "Content-Location:", 17) == 0 ||
g_ascii_strncasecmp(buf, "Content-Disposition:", 20) == 0) {
skip = TRUE;
continue;
/* Content-ID */
gchar *id;
+ /* Content-Location */
+ gchar *location;
+
guint offset;
guint length;
mail_filtering_data.msginfo = msginfo;
if (hooks_invoke(MAIL_FILTERING_HOOKLIST, &mail_filtering_data)) {
- hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
return TRUE;
}
/* filter if enabled in prefs or move to inbox if not */
if((filtering_rules != NULL) &&
filter_message_by_msginfo(filtering_rules, msginfo)) {
- hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
return TRUE;
}
- hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
return FALSE;
}
#define MSG_DELETED (1U << 3)
#define MSG_REPLIED (1U << 4)
#define MSG_FORWARDED (1U << 5)
+#define MSG_POSTFILTERED (1U << 14)
#define MSG_CLABEL_SBIT (7) /* start bit of color label */
#define MAKE_MSG_CLABEL(h, m, l) (((h) << (MSG_CLABEL_SBIT + 2)) | \
#define MSG_IS_REPLIED(msg) (((msg).perm_flags & MSG_REPLIED) != 0)
#define MSG_IS_LOCKED(msg) (((msg).perm_flags & MSG_LOCKED) != 0)
#define MSG_IS_FORWARDED(msg) (((msg).perm_flags & MSG_FORWARDED) != 0)
+#define MSG_IS_POSTFILTERED(msg) (((msg).perm_flags & MSG_POSTFILTERED) != 0)
#define MSG_GET_COLORLABEL(msg) (((msg).perm_flags & MSG_CLABEL_FLAG_MASK))
#define MSG_GET_COLORLABEL_VALUE(msg) (MSG_GET_COLORLABEL(msg) >> MSG_CLABEL_SBIT)
case TOOLBAR_MSGVIEW:
msgview = (MessageView*)toolbar_item->parent;
+ msgview->updating = TRUE;
summary_select_prev_unread(msgview->mainwin->summaryview);
+ msgview->updating = FALSE;
+
+ if (msgview->deferred_destroy) {
+ debug_print("messageview got away!\n");
+ messageview_destroy(msgview);
+ return;
+ }
/* Now we need to update the messageview window */
if (msgview->mainwin->summaryview->selected) {
case TOOLBAR_MSGVIEW:
msgview = (MessageView*)toolbar_item->parent;
+ msgview->updating = TRUE;
summary_select_next_unread(msgview->mainwin->summaryview);
-
+ msgview->updating = FALSE;
+
+ if (msgview->deferred_destroy) {
+ debug_print("messageview got away!\n");
+ messageview_destroy(msgview);
+ return;
+ }
+
/* Now we need to update the messageview window */
if (msgview->mainwin->summaryview->selected) {
GtkCTree *ctree = GTK_CTREE(msgview->mainwin->summaryview->ctree);