aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-04-24 04:52:17 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-04-24 04:52:17 +0000
commit8390e12e45f209a0174318ed529068595c7f70d3 (patch)
tree82b00686474b5ca39952f2b310f146fdc51d38f5 /src
parent983aea7a0e0e695c6cba6b6490d9d4d958b039e1 (diff)
exclude quote lines when notifying missing attachments.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1984 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c30
-rw-r--r--src/prefs_common_dialog.c2
2 files changed, 24 insertions, 8 deletions
diff --git a/src/compose.c b/src/compose.c
index af0e73d5..8df6a948 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -2859,10 +2859,12 @@ static gboolean compose_check_attachments(Compose *compose)
{
GtkTextView *text = GTK_TEXT_VIEW(compose->text);
GtkTextBuffer *buffer;
- GtkTextIter iter, pos;
+ GtkTextIter iter, line_end;
+ gchar *line;
gchar **strv;
gint i;
gboolean attach_found = FALSE;
+ gboolean valid = TRUE;
if (!prefs_common.check_attach)
return TRUE;
@@ -2876,17 +2878,31 @@ static gboolean compose_check_attachments(Compose *compose)
buffer = gtk_text_view_get_buffer(text);
gtk_text_buffer_get_start_iter(buffer, &iter);
+ line_end = iter;
strv = g_strsplit(prefs_common.check_attach_str, ",", -1);
- for (i = 0; strv[i] != NULL; i++) {
+ for (i = 0; strv[i] != NULL; i++)
g_strstrip(strv[i]);
- if (strv[i][0] == '\0')
+
+ while (valid) {
+ valid = gtk_text_iter_forward_to_line_end(&line_end);
+ line = gtk_text_buffer_get_text(buffer, &iter, &line_end,
+ FALSE);
+ iter = line_end;
+ if (get_quote_level(line) != -1)
continue;
- if (gtkut_text_buffer_find(buffer, &iter, strv[i], FALSE,
- &pos)) {
- attach_found = TRUE;
- break;
+
+ for (i = 0; strv[i] != NULL; i++) {
+ if (strv[i][0] == '\0')
+ continue;
+ if (strcasestr(line, strv[i])) {
+ attach_found = TRUE;
+ valid = FALSE;
+ break;
+ }
}
+
+ g_free(line);
}
g_strfreev(strv);
diff --git a/src/prefs_common_dialog.c b/src/prefs_common_dialog.c
index e7d7c61f..4ff57334 100644
--- a/src/prefs_common_dialog.c
+++ b/src/prefs_common_dialog.c
@@ -962,7 +962,7 @@ static void prefs_send_create(void)
"RFC 2231: conforms to standard, but not popular"));
PACK_CHECK_BUTTON (vbox1, checkbtn_check_attach,
- _("Confirm attachments when the following strings (comma-separated) are found in the message body"));
+ _("Notify for missing attachments when the following strings (comma-separated) are found in the message body"));
gtk_label_set_line_wrap(GTK_LABEL(GTK_BIN(checkbtn_check_attach)->child), TRUE);
hbox1 = gtk_hbox_new (FALSE, 8);