[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-370-gb983c7d
ticho at claws-mail.org
ticho at claws-mail.org
Thu Oct 4 19:35:11 CEST 2018
The branch, gtk3 has been updated
via b983c7d3c93781cd5472ba183d02a197dbaa7694 (commit)
via 86f514dcf52de8e23e30b1b8d4b513327590f94d (commit)
via 0d64c584904a70c2432637d939b0811016583d48 (commit)
via 0ca53fa7fbe2e4459a866657228c011f1d1e1614 (commit)
via 0b1bc837167673b133dee288c3844efc8268a8b7 (commit)
via c70fdc703c0755981246a18361ed7ff10ba6ea06 (commit)
via 69280de2bdac08583974f8a628cab3a399ebe890 (commit)
via 2ac9c3f4aefa8fbc6e23c969b1e3a73a5dd482db (commit)
via 7568a95314b5780a5cdced23fa0c9d004c4e5d4f (commit)
via 08a211524ac3cdf941e92a5ea17148164cb507f2 (commit)
via 418e8c9d098fd7976f9b612acc6fd7bb55cf6e62 (commit)
via a24745f499008e5a9e3055190fe47ebba6ac9315 (commit)
via 5d4193bd118810861ab4ccaec879bfc0a81f9c8f (commit)
via 9dc71d31d8083083ee2b7745d38f7259df5f5b76 (commit)
via 5ab33c03b775d47ad8a7e50348b0201a82eab334 (commit)
via dadab31639eb4a69dc5dd0721b67e09d8723ec56 (commit)
via 31fce04fdc2ee85db11a923f1c5760fbc780a70b (commit)
via bf3b50ead3cabfa24dc85a1553e213510008965a (commit)
via 277798d5a492464a54d54c8c5d22c17dd41b6bd9 (commit)
via 1a6b1fa9a594a13b416192e1bdc413528b39136e (commit)
via 0492042f37449ed6e4079f9cadab3dec67bcaf63 (commit)
via 71b5da72e1c6ca505e6b68dfe17ddce78b743a68 (commit)
via dfe7fc39cae1299d4b3f1b85447fa6d599544658 (commit)
via 6293ad156ecd414b47ad534991a37b5d001c28f4 (commit)
via 5b1b28ce697da50f9af01e7b6aef9008403a816b (commit)
from cee37b8da30735cb8fcd8dd5b74a3aed599980d9 (commit)
Summary of changes:
.gitignore | 2 +
README | 50 +++++------
src/common/defs.h | 26 +++---
src/common/utils.c | 13 +--
src/common/utils.h | 5 --
src/compose.c | 18 ++--
src/entity.c | 26 +++++-
src/folderview.c | 30 +++----
src/gtk/quicksearch.c | 10 ++-
src/mainwindow.c | 18 +++-
src/messageview.c | 4 +-
src/plugins/archive/libarchive_archive.c | 2 +-
src/plugins/fancy/fancy_viewer.c | 23 -----
src/plugins/fancy/fancy_viewer.h | 4 -
src/plugins/libravatar/libravatar_missing.c | 2 +-
src/plugins/mailmbox/mailimf.c | 3 +-
.../notification/gtkhotkey/x11/tomboykeybinder.c | 1 -
src/plugins/notification/notification_core.c | 8 +-
src/plugins/rssyl/libfeed/parser_rss20.c | 3 +-
src/plugins/rssyl/parse822.c | 4 +-
src/plugins/rssyl/rssyl_add_item.c | 23 ++++-
src/prefs_themes.c | 57 ++++++-------
src/summaryview.c | 90 +++++++++++++++++---
src/summaryview.h | 6 +-
src/tests/entity_test.c | 70 ++++++++++++++-
src/toolbar.c | 14 ++-
26 files changed, 336 insertions(+), 176 deletions(-)
- Log -----------------------------------------------------------------
commit b983c7d3c93781cd5472ba183d02a197dbaa7694
Author: Ricardo Mones <ricardo at mones.org>
Date: Thu Oct 4 15:49:07 2018 +0200
Simplify comparison
and keep Coverity happy.
diff --git a/src/entity.c b/src/entity.c
index fcf4c28..058c3aa 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -357,7 +357,7 @@ static gchar *entity_decode_numeric(gchar *str)
if (strlen(b) > 0)
c = g_ascii_strtoll (b, NULL, (hex ? 16 : 10));
- if (c >= 0 && c <= 31)
+ if (c < 32)
/* An unprintable character; return the Unicode replacement symbol */
return g_strdup("\xef\xbf\xbd");
commit 86f514dcf52de8e23e30b1b8d4b513327590f94d
Author: Ricardo Mones <ricardo at mones.org>
Date: Thu Oct 4 10:49:32 2018 +0200
Disallow zero-length entity
diff --git a/src/entity.c b/src/entity.c
index aa0c543..fcf4c28 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -325,7 +325,7 @@ static gchar* entity_extract_to_buffer(gchar *p, gchar b[])
b[i] = *p;
++i, ++p;
}
- if (*p != ';' || i == ENTITY_MAX_LEN)
+ if (*p != ';' || i == 0 || i == ENTITY_MAX_LEN)
return NULL;
b[i] = '\0';
commit 0d64c584904a70c2432637d939b0811016583d48
Author: Ricardo Mones <ricardo at mones.org>
Date: Thu Oct 4 10:30:12 2018 +0200
Fix CID 1439871 and validate Unicode char strictly
diff --git a/src/entity.c b/src/entity.c
index 6aa0345..aa0c543 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -337,7 +337,7 @@ static gchar *entity_decode_numeric(gchar *str)
gchar b[ENTITY_MAX_LEN];
gchar *p = str, *res;
gboolean hex = FALSE;
- gunichar c = -1;
+ gunichar c = 0;
gint ret;
++p;
@@ -357,17 +357,13 @@ static gchar *entity_decode_numeric(gchar *str)
if (strlen(b) > 0)
c = g_ascii_strtoll (b, NULL, (hex ? 16 : 10));
- if (c < 0) {
- /* Obviously invalid */
- debug_print("Numeric reference '&#%s;' is invalid\n", b);
- return NULL;
- } else if (c >= 0 && c <= 31) {
+ if (c >= 0 && c <= 31)
/* An unprintable character; return the Unicode replacement symbol */
return g_strdup("\xef\xbf\xbd");
- } else if (c > 0x10ffff) {
- /* Make sure the character falls within the Unicode codespace
- * (0x0 - 0x10ffff) */
- debug_print("Numeric reference '&#%s;' is invalid, outside of Unicode codespace\n", b);
+
+ if (!g_unichar_validate(c)) {
+ /* Make sure the character is valid Unicode */
+ debug_print("Numeric reference '&#%s;' is invalid in Unicode codespace\n", b);
return NULL;
}
commit 0ca53fa7fbe2e4459a866657228c011f1d1e1614
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Wed Oct 3 18:27:39 2018 +0200
Make entity_decode() handle invalid input better.
diff --git a/src/entity.c b/src/entity.c
index 12069d4..6aa0345 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -337,7 +337,8 @@ static gchar *entity_decode_numeric(gchar *str)
gchar b[ENTITY_MAX_LEN];
gchar *p = str, *res;
gboolean hex = FALSE;
- gunichar c;
+ gunichar c = -1;
+ gint ret;
++p;
if (*p == '\0')
@@ -353,9 +354,30 @@ static gchar *entity_decode_numeric(gchar *str)
if (entity_extract_to_buffer (p, b) == NULL)
return NULL;
- c = g_ascii_strtoll (b, NULL, (hex? 16: 10));
+ if (strlen(b) > 0)
+ c = g_ascii_strtoll (b, NULL, (hex ? 16 : 10));
+
+ if (c < 0) {
+ /* Obviously invalid */
+ debug_print("Numeric reference '&#%s;' is invalid\n", b);
+ return NULL;
+ } else if (c >= 0 && c <= 31) {
+ /* An unprintable character; return the Unicode replacement symbol */
+ return g_strdup("\xef\xbf\xbd");
+ } else if (c > 0x10ffff) {
+ /* Make sure the character falls within the Unicode codespace
+ * (0x0 - 0x10ffff) */
+ debug_print("Numeric reference '&#%s;' is invalid, outside of Unicode codespace\n", b);
+ return NULL;
+ }
+
res = g_malloc0 (DECODED_MAX_LEN + 1);
- g_unichar_to_utf8 (c, res);
+ ret = g_unichar_to_utf8 (c, res);
+ if (ret == 0) {
+ debug_print("Failed to convert unicode character %u to UTF-8\n", c);
+ g_free(res);
+ res = NULL;
+ }
return res;
}
diff --git a/src/tests/entity_test.c b/src/tests/entity_test.c
index 86816ea..c52a4a1 100644
--- a/src/tests/entity_test.c
+++ b/src/tests/entity_test.c
@@ -1,18 +1,78 @@
#include <glib.h>
+#include <stdio.h>
+
#include "mock_debug_print.h"
#include "entity.h"
static void
-test_entity(void)
+test_entity_invalid(void)
{
gchar *result;
+ /* Invalid entity strings */
result = entity_decode(NULL);
g_assert_null(result);
-
+ result = entity_decode("");
+ g_assert_null(result);
result = entity_decode("foo");
g_assert_null(result);
+ result = entity_decode("&");
+ g_assert_null(result);
+ result = entity_decode("&;");
+ g_assert_null(result);
+ result = entity_decode("&#");
+ g_assert_null(result);
+ result = entity_decode("&#;");
+ g_assert_null(result);
+
+ /* Valid entity string, but with missing semicolon */
+ result = entity_decode("Á");
+ g_assert_null(result);
+ result = entity_decode("{");
+ g_assert_null(result);
+}
+
+static void
+test_entity_toolong(void)
+{
+ gchar *result;
+
+ /* Largest unicode code point is 0x10ffff, let's test that,
+ * and one past it */
+ result = entity_decode("");
+ g_assert_nonnull(result);
+ g_free(result);
+ result = entity_decode("");
+ g_assert_null(result);
+
+ /* ENTITY_MAX_LEN is 8, test 8- and 9-char entity strings
+ * for possible buffer overflows */
+ result = entity_decode("");
+ g_assert_null(result);
+ result = entity_decode("");
+ g_assert_null(result);
+}
+
+static void
+test_entity_unprintable(void)
+{
+ gchar *result, numstr[6]; /* "&#XX;" */
+ gint i;
+
+ for (i = 0; i < 32; i++) {
+ sprintf(numstr, "&#%d;", i);
+ result = entity_decode(numstr);
+ g_assert_nonnull(result);
+ g_assert_cmpstr(result, ==, "\xef\xbf\xbd");
+ g_free(result);
+ }
+}
+
+static void
+test_entity_valid(void)
+{
+ gchar *result;
result = entity_decode("Á");
g_assert_nonnull(result);
@@ -27,6 +87,7 @@ test_entity(void)
g_printerr("result '%s'\n", result);
g_assert_cmpstr(result, ==, "{");
g_free(result);
+
}
int
@@ -34,7 +95,10 @@ main(int argc, char *argv[])
{
g_test_init(&argc, &argv, NULL);
- g_test_add_func("/core/entity", test_entity);
+ g_test_add_func("/core/entity/invalid", test_entity_invalid);
+ g_test_add_func("/core/entity/toolong", test_entity_toolong);
+ g_test_add_func("/core/entity/unprintable", test_entity_unprintable);
+ g_test_add_func("/core/entity/valid", test_entity_valid);
return g_test_run();
}
commit 0b1bc837167673b133dee288c3844efc8268a8b7
Author: Colin Leroy <colin at colino.net>
Date: Wed Oct 3 09:15:30 2018 +0200
Fix Reply from mainwindow menu and toolbar when mainwindow's
messageview is hidden.
diff --git a/src/mainwindow.c b/src/mainwindow.c
index f40cb44..fd2ac16 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -4123,7 +4123,9 @@ static void main_window_reply_cb(GtkAction *gaction, gpointer data)
msginfo_list = summary_get_selection(mainwin->summaryview);
cm_return_if_fail(msginfo_list != NULL);
- if (summary_is_opened_message_selected(mainwin->summaryview)) {
+ if (!summary_has_opened_message(mainwin->summaryview)) {
+ compose_reply_from_messageview(NULL, msginfo_list, action);
+ } else if (summary_is_opened_message_selected(mainwin->summaryview)) {
compose_reply_from_messageview(msgview, msginfo_list, action);
} else {
compose_reply_from_messageview(msgview, NULL, action);
diff --git a/src/summaryview.c b/src/summaryview.c
index 522a126..8fe0484 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -8433,12 +8433,14 @@ static void summary_reply_cb(GtkAction *gaction, gpointer data)
gboolean summary_is_opened_message_selected(SummaryView *summaryview)
{
GList *sel = NULL;
-
+
cm_return_val_if_fail(summaryview != NULL, FALSE);
sel = GTK_CMCLIST(summaryview->ctree)->selection;
- cm_return_val_if_fail(sel != NULL, FALSE);
+ if (summaryview->displayed == NULL || sel == NULL) {
+ return FALSE;
+ }
for ( ; sel != NULL; sel = sel->next) {
if (summaryview->displayed == GTK_CMCTREE_NODE(sel->data)) {
@@ -8448,3 +8450,14 @@ gboolean summary_is_opened_message_selected(SummaryView *summaryview)
return FALSE;
}
+gboolean summary_has_opened_message(SummaryView *summaryview)
+{
+ GList *sel = NULL;
+
+ cm_return_val_if_fail(summaryview != NULL, FALSE);
+
+ sel = GTK_CMCLIST(summaryview->ctree)->selection;
+
+ return (summaryview->displayed != NULL);
+}
+
diff --git a/src/summaryview.h b/src/summaryview.h
index e00f133..5824761 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -336,4 +336,5 @@ void summary_update_unread(SummaryView *summaryview, FolderItem *removed_item);
gboolean summary_is_list(SummaryView *summaryview);
gboolean summaryview_search_root_progress(gpointer data, guint at, guint matched, guint total);
gboolean summary_is_opened_message_selected(SummaryView *summaryview);
+gboolean summary_has_opened_message(SummaryView *summaryview);
#endif /* __SUMMARY_H__ */
diff --git a/src/toolbar.c b/src/toolbar.c
index 9fcb7ea..4c16c47 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -2967,6 +2967,7 @@ static void toolbar_reply(gpointer data, guint action)
MessageView *msgview;
GSList *msginfo_list = NULL;
gboolean msg_is_selected = FALSE;
+ gboolean msg_is_opened = FALSE;
cm_return_if_fail(toolbar_item != NULL);
@@ -2975,12 +2976,14 @@ static void toolbar_reply(gpointer data, guint action)
mainwin = (MainWindow*)toolbar_item->parent;
msginfo_list = summary_get_selection(mainwin->summaryview);
msgview = (MessageView*)mainwin->messageview;
+ msg_is_opened = summary_has_opened_message(mainwin->summaryview);
msg_is_selected = summary_is_opened_message_selected(mainwin->summaryview);
break;
case TOOLBAR_MSGVIEW:
msgview = (MessageView*)toolbar_item->parent;
cm_return_if_fail(msgview != NULL);
msginfo_list = g_slist_append(msginfo_list, msgview->msginfo);
+ msg_is_opened = TRUE;
msg_is_selected = TRUE;
break;
default:
@@ -2989,7 +2992,9 @@ static void toolbar_reply(gpointer data, guint action)
cm_return_if_fail(msgview != NULL);
cm_return_if_fail(msginfo_list != NULL);
- if (msg_is_selected) {
+ if (!msg_is_opened) {
+ compose_reply_from_messageview(NULL, msginfo_list, action);
+ } else if (msg_is_selected) {
compose_reply_from_messageview(msgview, msginfo_list, action);
} else {
compose_reply_from_messageview(msgview, NULL, action);
commit c70fdc703c0755981246a18361ed7ff10ba6ea06
Author: Colin Leroy <colin at colino.net>
Date: Tue Oct 2 16:27:41 2018 +0200
Fix Coverity #1372351
diff --git a/src/folderview.c b/src/folderview.c
index 95d07cf..48d8e9c 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -3179,23 +3179,21 @@ static void folderview_drag_received_cb(GtkWidget *widget,
src_item && src_item != item && FOLDER_CLASS(item->folder)->copy_msg != NULL)) {
return;
}
- if (item && src_item) {
- switch (gdk_drag_context_get_selected_action(drag_context)) {
- case GDK_ACTION_COPY:
+
+ switch (gdk_drag_context_get_selected_action(drag_context)) {
+ case GDK_ACTION_COPY:
+ summary_copy_selected_to(folderview->summaryview, item);
+ gtk_drag_finish(drag_context, TRUE, FALSE, time);
+ break;
+ case GDK_ACTION_MOVE:
+ case GDK_ACTION_DEFAULT:
+ default:
+ if (FOLDER_CLASS(src_item->folder)->remove_msg == NULL)
summary_copy_selected_to(folderview->summaryview, item);
- gtk_drag_finish(drag_context, TRUE, FALSE, time);
- break;
- case GDK_ACTION_MOVE:
- case GDK_ACTION_DEFAULT:
- default:
- if (FOLDER_CLASS(src_item->folder)->remove_msg == NULL)
- summary_copy_selected_to(folderview->summaryview, item);
- else
- summary_move_selected_to(folderview->summaryview, item);
- gtk_drag_finish(drag_context, TRUE, TRUE, time);
- }
- } else
- gtk_drag_finish(drag_context, FALSE, FALSE, time);
+ else
+ summary_move_selected_to(folderview->summaryview, item);
+ gtk_drag_finish(drag_context, TRUE, TRUE, time);
+ }
} else {
/* comes from folderview */
char *source;
commit 69280de2bdac08583974f8a628cab3a399ebe890
Author: Colin Leroy <colin at colino.net>
Date: Tue Oct 2 16:27:27 2018 +0200
Fix build warning
diff --git a/src/plugins/mailmbox/mailimf.c b/src/plugins/mailmbox/mailimf.c
index fd44122..af49ca4 100644
--- a/src/plugins/mailmbox/mailimf.c
+++ b/src/plugins/mailmbox/mailimf.c
@@ -4521,7 +4521,6 @@ static int mailimf_field_parse(const char * message, size_t length,
mailimf_keywords_free(keywords);
if (optional_field != NULL)
mailimf_optional_field_free(optional_field);
- err:
return res;
}
commit 2ac9c3f4aefa8fbc6e23c969b1e3a73a5dd482db
Author: Colin Leroy <colin at colino.net>
Date: Tue Oct 2 16:21:16 2018 +0200
Fix Coverity #1220388
diff --git a/src/plugins/notification/notification_core.c b/src/plugins/notification/notification_core.c
index c585b2c..d7e9820 100644
--- a/src/plugins/notification/notification_core.c
+++ b/src/plugins/notification/notification_core.c
@@ -656,22 +656,22 @@ gchar* notification_libnotify_sanitize_str(gchar *in)
out = 0;
while(*in) {
if(*in == '<') {
- if(out+4 > STR_MAX_LEN+1) break;
+ if(out+4 > STR_MAX_LEN) break;
memcpy(&(tmp_str[out]),"<",4);
in++; out += 4;
}
else if(*in == '>') {
- if(out+4 > STR_MAX_LEN+1) break;
+ if(out+4 > STR_MAX_LEN) break;
memcpy(&(tmp_str[out]),">",4);
in++; out += 4;
}
else if(*in == '&') {
- if(out+5 > STR_MAX_LEN+1) break;
+ if(out+5 > STR_MAX_LEN) break;
memcpy(&(tmp_str[out]),"&",5);
in++; out += 5;
}
else {
- if(out+1 > STR_MAX_LEN+1) break;
+ if(out+1 > STR_MAX_LEN) break;
tmp_str[out++] = *in++;
}
}
commit 7568a95314b5780a5cdced23fa0c9d004c4e5d4f
Author: Colin Leroy <colin at colino.net>
Date: Tue Oct 2 16:16:57 2018 +0200
Fix Coverity #1220444
diff --git a/src/plugins/mailmbox/mailimf.c b/src/plugins/mailmbox/mailimf.c
index d664050..fd44122 100644
--- a/src/plugins/mailmbox/mailimf.c
+++ b/src/plugins/mailmbox/mailimf.c
@@ -4455,7 +4455,7 @@ static int mailimf_field_parse(const char * message, size_t length,
&optional_field);
if (r != MAILIMF_NO_ERROR) {
res = r;
- goto err;
+ goto free_fields;
}
type = MAILIMF_FIELD_OPTIONAL_FIELD;
commit 08a211524ac3cdf941e92a5ea17148164cb507f2
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Tue Oct 2 14:18:52 2018 +0200
Remove Webkit version check ifdefs, since we depend on a new enough version.
diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
index 52a90e5..7f5e0f6 100644
--- a/src/plugins/fancy/fancy_viewer.c
+++ b/src/plugins/fancy/fancy_viewer.c
@@ -70,10 +70,6 @@ static void *download_file_curl (void *data);
static void download_file_cb(GtkWidget *widget, FancyViewer *viewer);
static gboolean fancy_set_contents(FancyViewer *viewer, gboolean use_defaults);
-#if !WEBKIT_CHECK_VERSION (1,5,1)
-gchar* webkit_web_view_get_selected_text(WebKitWebView* web_view);
-#endif
-
/*------*/
static GtkWidget *fancy_get_widget(MimeViewer *_viewer)
{
@@ -343,7 +339,6 @@ static gchar *fancy_get_selection (MimeViewer *_viewer)
{
debug_print("fancy_get_selection\n");
FancyViewer *viewer = (FancyViewer *) _viewer;
-#if WEBKIT_CHECK_VERSION(1,5,1)
viewer->doc = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(viewer->view));
viewer->window = webkit_dom_document_get_default_view (viewer->doc);
viewer->selection = webkit_dom_dom_window_get_selection (viewer->window);
@@ -353,9 +348,6 @@ static gchar *fancy_get_selection (MimeViewer *_viewer)
if (viewer->range == NULL)
return NULL;
gchar *sel = webkit_dom_range_get_text (viewer->range);
-#else
- gchar *sel = webkit_web_view_get_selected_text(viewer->view);
-#endif
if (!viewer->view || strlen(sel) == 0) {
g_free(sel);
return NULL;
@@ -627,15 +619,11 @@ static void search_the_web_cb(GtkWidget *widget, FancyViewer *viewer)
debug_print("Clicked on Search on Web\n");
if (webkit_web_view_has_selection(viewer->view)) {
gchar *search;
-#if WEBKIT_CHECK_VERSION(1,5,1)
viewer->doc = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(viewer->view));
viewer->window = webkit_dom_document_get_default_view (viewer->doc);
viewer->selection = webkit_dom_dom_window_get_selection (viewer->window);
viewer->range = webkit_dom_dom_selection_get_range_at(viewer->selection, 0, NULL);
gchar *tmp = webkit_dom_range_get_text (viewer->range);
-#else
- gchar *tmp = webkit_web_view_get_selected_text(viewer->view);
-#endif
search = g_strconcat(GOOGLE_SEARCH, tmp, NULL);
webkit_web_view_load_uri(viewer->view, search);
@@ -890,8 +878,6 @@ static gboolean release_button_cb (WebKitWebView *view, GdkEvent *ev,
FancyViewer *viewer)
{
if (ev->button.button == 1 && viewer->cur_link && viewer->override_prefs_external) {
-#if WEBKIT_CHECK_VERSION(1,9,3)
- /* The x and y properties were added in 1.9.3 */
gint x, y;
WebKitHitTestResult *result;
result = webkit_web_view_get_hit_test_result(view, (GdkEventButton *)ev);
@@ -904,7 +890,6 @@ static gboolean release_button_cb (WebKitWebView *view, GdkEvent *ev,
* want to open the link. */
if ((x != viewer->click_x || y != viewer->click_y))
return FALSE;
-#endif
open_uri(viewer->cur_link, prefs_common_get_uri_cmd());
return TRUE;
@@ -915,16 +900,13 @@ static gboolean release_button_cb (WebKitWebView *view, GdkEvent *ev,
static gboolean press_button_cb (WebKitWebView *view, GdkEvent *ev,
FancyViewer *viewer)
{
-#if WEBKIT_CHECK_VERSION(1,5,1)
gint type = 0;
WebKitHitTestResult *result =
webkit_web_view_get_hit_test_result(view, (GdkEventButton *)ev);
g_object_get(G_OBJECT(result),
"context", &type,
-# if WEBKIT_CHECK_VERSION(1,9,3)
"x", &viewer->click_x, "y", &viewer->click_y,
-# endif /* 1.9.3 */
NULL);
if (type & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION)
@@ -935,7 +917,6 @@ static gboolean press_button_cb (WebKitWebView *view, GdkEvent *ev,
viewer->selection = webkit_dom_dom_window_get_selection (viewer->window);
if (viewer->selection != NULL)
webkit_dom_dom_selection_empty(viewer->selection);
-#endif /* 1.5.1 */
return FALSE;
}
@@ -956,7 +937,6 @@ static void zoom_out_cb(GtkWidget *widget, GdkEvent *ev, FancyViewer *viewer)
webkit_web_view_zoom_out(viewer->view);
}
-#if WEBKIT_CHECK_VERSION (1,7,5)
static void resource_load_failed_cb(WebKitWebView *web_view,
WebKitWebFrame *web_frame,
WebKitWebResource *web_resource,
@@ -965,7 +945,6 @@ static void resource_load_failed_cb(WebKitWebView *web_view,
{
debug_print("Loading error: %s\n", error->message);
}
-#endif
static MimeViewer *fancy_viewer_create(void)
{
@@ -1113,10 +1092,8 @@ static MimeViewer *fancy_viewer_create(void)
g_signal_connect(G_OBJECT(viewer->view), "key_press_event",
G_CALLBACK(keypress_events_cb), viewer);
-#if WEBKIT_CHECK_VERSION (1,7,5)
g_signal_connect(G_OBJECT(viewer->view), "resource-load-failed",
G_CALLBACK(resource_load_failed_cb), viewer);
-#endif
viewer->filename = NULL;
return (MimeViewer *) viewer;
diff --git a/src/plugins/fancy/fancy_viewer.h b/src/plugins/fancy/fancy_viewer.h
index 952b337..c22ca40 100644
--- a/src/plugins/fancy/fancy_viewer.h
+++ b/src/plugins/fancy/fancy_viewer.h
@@ -35,9 +35,7 @@
#include <webkit/webkitnetworkrequest.h>
#include <webkit/webkitwebnavigationaction.h>
#include <webkit/webkitwebpolicydecision.h>
-#if WEBKIT_CHECK_VERSION (1,3,10)
#include <webkit/webkitglobals.h>
-#endif
#include <prefs_common.h>
#include "common/claws.h"
#include "common/version.h"
@@ -123,12 +121,10 @@ struct _FancyViewer
gint click_y;
/* DOM Objects */
-#if WEBKIT_CHECK_VERSION(1,5,1)
WebKitDOMDocument *doc;
WebKitDOMDOMWindow *window;
WebKitDOMDOMSelection *selection;
WebKitDOMRange *range;
-#endif
};
#define OPEN_INTERNAL FALSE
#define OPEN_EXTERNAL TRUE
commit 418e8c9d098fd7976f9b612acc6fd7bb55cf6e62
Author: Ricardo Mones <ricardo at mones.org>
Date: Mon Oct 1 23:58:24 2018 +0200
Don't try to be too clever and remove superuser_p()
Being root doesn't really tell much about filesystem permissions. Now it
simply ask user what to do and does it as requested. If things go wrong
errors will be catched anyway.
diff --git a/src/common/utils.c b/src/common/utils.c
index 51813e1..3833545 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -90,17 +90,6 @@
static gboolean debug_mode = FALSE;
-/* Return true if we are running as root. This function should beused
- instead of getuid () == 0. */
-gboolean superuser_p (void)
-{
-#ifdef G_OS_WIN32
- return w32_is_administrator ();
-#else
- return !getuid();
-#endif
-}
-
GSList *slist_copy_deep(GSList *list, GCopyFunc func)
{
#if GLIB_CHECK_VERSION(2, 34, 0)
diff --git a/src/common/utils.h b/src/common/utils.h
index 3573d40..96c4dc2 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -247,11 +247,6 @@ gboolean debug_get_mode (void);
#define Str(x) #x
#define Xstr(x) Str(x)
-
-/* System related stuff. */
-
-gboolean superuser_p (void);
-
/* List utilities. */
GSList *slist_copy_deep (GSList *list,
diff --git a/src/prefs_themes.c b/src/prefs_themes.c
index 5681854..0d4adc6 100644
--- a/src/prefs_themes.c
+++ b/src/prefs_themes.c
@@ -495,18 +495,11 @@ static void prefs_themes_btn_remove_clicked_cb(GtkWidget *widget, gpointer data)
theme_str = tdata->displayed;
tmp = g_path_get_basename(theme_str);
-
if (IS_SYSTEM_THEME(theme_str)) {
- if (!superuser_p()) {
- alertpanel_error(_("Only root can remove system themes"));
- return;
- }
alert_title = g_strdup_printf(_("Remove system theme '%s'"), tmp);
- }
- if (NULL == alert_title) {
+ } else {
alert_title = g_strdup_printf(_("Remove theme '%s'"), tmp);
}
-
g_free(tmp);
val = alertpanel(alert_title,
@@ -565,27 +558,30 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
alert_title = g_strdup_printf(_("Install theme '%s'"), themename);
if (file_exist(themeinfo, FALSE) == FALSE) {
val = alertpanel(alert_title,
- _("This folder doesn't seem to be a theme folder.\nInstall anyway?"),
- GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST);
- if (G_ALERTALTERNATE != val)
- goto end_inst;
- }
- if (superuser_p ()) {
- val = alertpanel(alert_title,
- _("Do you want to install theme for all users?"),
+ _("This folder doesn't seem to be a theme"
+ "folder.\nInstall anyway?"),
GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST);
- switch (val) {
- case G_ALERTALTERNATE:
- cinfo->dest = stock_pixmap_get_system_theme_dir_for_theme(
- themename);
- break;
- case G_ALERTDEFAULT:
- break;
- default:
+ if (G_ALERTALTERNATE != val) {
+ g_free(alert_title);
goto end_inst;
}
}
+
+ val = alertpanel(alert_title,
+ _("Do you want to install theme for all users?"),
+ GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST);
g_free(alert_title);
+ switch (val) {
+ case G_ALERTALTERNATE:
+ cinfo->dest = stock_pixmap_get_system_theme_dir_for_theme(
+ themename);
+ break;
+ case G_ALERTDEFAULT:
+ break;
+ default:
+ goto end_inst;
+ }
+
if (cinfo->dest == NULL) {
cinfo->dest = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
PIXMAP_THEME_DIR, G_DIR_SEPARATOR_S,
@@ -593,13 +589,15 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
}
if (TRUE == is_dir_exist(cinfo->dest)) {
AlertValue val = alertpanel_full(_("Theme exists"),
- _("A theme with the same name is\nalready installed in this location.\n\n"
+ _("A theme with the same name is\n"
+ "already installed in this location.\n\n"
"Do you want to replace it?"),
GTK_STOCK_CANCEL, _("Overwrite"), NULL, ALERTFOCUS_FIRST,
FALSE, NULL, ALERT_WARNING);
if (val == G_ALERTALTERNATE) {
if (remove_dir_recursive(cinfo->dest) < 0) {
- alertpanel_error(_("Couldn't delete the old theme in %s."), cinfo->dest);
+ alertpanel_error(_("Couldn't delete the old theme in %s."),
+ cinfo->dest);
goto end_inst;
}
} else {
@@ -607,7 +605,8 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
}
}
if (0 != make_dir_hier(cinfo->dest)) {
- alertpanel_error(_("Couldn't create destination directory %s."), cinfo->dest);
+ alertpanel_error(_("Couldn't create destination directory %s."),
+ cinfo->dest);
goto end_inst;
}
prefs_themes_foreach_file(source, prefs_themes_file_install, cinfo);
@@ -616,8 +615,8 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
/* update interface to show newly installed theme */
prefs_themes_get_themes_and_names(tdata);
- insted = g_list_find_custom(tdata->themes,
- (gpointer)(cinfo->dest),
+ insted = g_list_find_custom(tdata->themes,
+ (gpointer)(cinfo->dest),
(GCompareFunc)strcmp2);
if (NULL != insted) {
alertpanel_notice(_("Theme installed successfully."));
commit a24745f499008e5a9e3055190fe47ebba6ac9315
Author: Colin Leroy <colin at colino.net>
Date: Fri Sep 28 16:55:24 2018 +0200
Fix possible resource leak
diff --git a/src/common/utils.c b/src/common/utils.c
index 33eb31d..51813e1 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -2630,7 +2630,7 @@ gint copy_file_part(FILE *fp, off_t offset, size_t length, const gchar *dest)
if (copy_file_part_to_fp(fp, offset, length, dest_fp) < 0)
err = TRUE;
- if (!err && fclose(dest_fp) == EOF) {
+ if (fclose(dest_fp) == EOF) {
FILE_OP_ERROR(dest, "fclose");
err = TRUE;
}
commit 5d4193bd118810861ab4ccaec879bfc0a81f9c8f
Author: Colin Leroy <colin at colino.net>
Date: Fri Sep 28 15:26:59 2018 +0200
Fix implicit declaration of g_close()
diff --git a/src/plugins/archive/libarchive_archive.c b/src/plugins/archive/libarchive_archive.c
index ed37ed5..32f75bf 100644
--- a/src/plugins/archive/libarchive_archive.c
+++ b/src/plugins/archive/libarchive_archive.c
@@ -23,6 +23,7 @@
#include <glib.h>
#include <glib/gi18n.h>
+#include <glib/gstdio.h>
#include "libarchive_archive.h"
@@ -44,7 +45,6 @@
#include <string.h>
#include <unistd.h>
#include <dirent.h>
-#include <glib.h>
#include <libgen.h>
#define READ_BLOCK_SIZE 10240
commit 9dc71d31d8083083ee2b7745d38f7259df5f5b76
Author: Colin Leroy <colin at colino.net>
Date: Fri Sep 28 14:17:24 2018 +0200
Add a few ignores
diff --git a/.gitignore b/.gitignore
index bebe946..ba5856d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -80,10 +80,12 @@ Makefile.in
/po/en at boldquot.header
/po/en at quot.header
/po/*.gmo
+/po/*.mo
/po/insert-header.sin
/po/Makevars.template
/po/*.po~
/po/stamp-po
+/po/stamp-it
/po/.intltool-merge-cache
/po/POTFILES
/po/quot.sed
commit 5ab33c03b775d47ad8a7e50348b0201a82eab334
Author: Colin Leroy <colin at colino.net>
Date: Fri Sep 28 14:17:11 2018 +0200
Fix build on Debian 7
diff --git a/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c b/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c
index 598d0e5..01cf302 100644
--- a/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c
+++ b/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c
@@ -4,7 +4,6 @@
#include <unistd.h>
#include <sys/socket.h>
#include <gdk/gdk.h>
-#include <gdk/gdkwindow.h>
#include <gdk/gdkx.h>
#include <X11/Xlib.h>
commit dadab31639eb4a69dc5dd0721b67e09d8723ec56
Author: Colin Leroy <colin at colino.net>
Date: Fri Sep 28 13:20:26 2018 +0200
Fix Coverity warning (unsafe fscanf)
diff --git a/src/plugins/libravatar/libravatar_missing.c b/src/plugins/libravatar/libravatar_missing.c
index d451510..5ea99a7 100644
--- a/src/plugins/libravatar/libravatar_missing.c
+++ b/src/plugins/libravatar/libravatar_missing.c
@@ -54,7 +54,7 @@ GHashTable *missing_load_from_file(const gchar *filename)
table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
- while ((r = fscanf(file, "%s %llu\n", md5sum, &seen)) != EOF) {
+ while ((r = fscanf(file, "%32s %llu\n", md5sum, &seen)) != EOF) {
if (t - (time_t)seen <= LIBRAVATAR_MISSING_TIME) {
time_t *value = g_malloc0(sizeof(time_t));
*value = (time_t)seen;
commit 31fce04fdc2ee85db11a923f1c5760fbc780a70b
Author: Colin Leroy <colin at colino.net>
Date: Fri Sep 28 10:33:20 2018 +0200
Fix bug #3889, "Address and quoted message inconsistent in reply"
* Fix right-click replying to messages in summaryview
* Fix corner-case when selected and opened messages are different,
and one of them is to a mailing-list.
diff --git a/src/compose.c b/src/compose.c
index cf04e6f..6694348 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -12166,11 +12166,9 @@ static void compose_reply_from_messageview_real(MessageView *msgview, GSList *ms
Compose *compose = NULL;
gchar *s_system = NULL;
- cm_return_if_fail(msgview != NULL);
-
cm_return_if_fail(msginfo_list != NULL);
- if (g_slist_length(msginfo_list) == 1 && !opening_multiple) {
+ if (g_slist_length(msginfo_list) == 1 && !opening_multiple && msgview != NULL) {
MimeInfo *mimeinfo = messageview_get_selected_mime_part(msgview);
MsgInfo *orig_msginfo = (MsgInfo *)msginfo_list->data;
@@ -12195,7 +12193,7 @@ static void compose_reply_from_messageview_real(MessageView *msgview, GSList *ms
}
}
- if (!opening_multiple)
+ if (!opening_multiple && msgview != NULL)
body = messageview_get_selection(msgview);
if (new_msglist) {
@@ -12221,6 +12219,7 @@ void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
guint action)
{
if ((!prefs_common.forward_as_attachment || action != COMPOSE_FORWARD)
+ && msginfo_list != NULL
&& action != COMPOSE_FORWARD_AS_ATTACH && g_slist_length(msginfo_list) > 1) {
GSList *cur = msginfo_list;
gchar *msg = g_strdup_printf(_("You are about to reply to %d "
@@ -12248,7 +12247,16 @@ void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
} else {
/* forwarding multiple mails as attachments is done via a
* single compose window */
- compose_reply_from_messageview_real(msgview, msginfo_list, action, FALSE);
+ if (msginfo_list != NULL) {
+ compose_reply_from_messageview_real(msgview, msginfo_list, action, FALSE);
+ } else if (msgview != NULL) {
+ GSList tmplist;
+ tmplist.data = msgview->msginfo;
+ tmplist.next = NULL;
+ compose_reply_from_messageview_real(msgview, &tmplist, action, FALSE);
+ } else {
+ debug_print("Nothing to reply to\n");
+ }
}
}
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 8c694c0..f40cb44 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -4122,7 +4122,13 @@ static void main_window_reply_cb(GtkAction *gaction, gpointer data)
msginfo_list = summary_get_selection(mainwin->summaryview);
cm_return_if_fail(msginfo_list != NULL);
- compose_reply_from_messageview(msgview, msginfo_list, action);
+
+ if (summary_is_opened_message_selected(mainwin->summaryview)) {
+ compose_reply_from_messageview(msgview, msginfo_list, action);
+ } else {
+ compose_reply_from_messageview(msgview, NULL, action);
+ }
+
g_slist_free(msginfo_list);
}
diff --git a/src/summaryview.c b/src/summaryview.c
index 0f7a6bd..522a126 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -418,16 +418,21 @@ GtkTargetEntry summary_drag_types[3] =
{"claws-mail/msg-path-list", 0, TARGET_MAIL_CM_PATH_LIST},
};
-#define DO_ACTION(name, act) { \
- if(!strcmp(name, a_name)) { \
- act; \
- } \
-}
+static void summary_reply_cb(GtkAction *gaction, gpointer data);
+/* Only submenus and specifically-handled menu entries here */
static GtkActionEntry summary_popup_entries[] =
{
{"SummaryViewPopup", NULL, "SummaryViewPopup", NULL, NULL, NULL },
+ {"SummaryViewPopup/Reply", NULL, N_("_Reply"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_REPLY */
{"SummaryViewPopup/ReplyTo", NULL, N_("Repl_y to"), NULL, NULL, NULL },
+ {"SummaryViewPopup/ReplyTo/All", NULL, N_("_All"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_REPLY_TO_ALL */
+ {"SummaryViewPopup/ReplyTo/Sender", NULL, N_("_Sender"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_REPLY_TO_SENDER */
+ {"SummaryViewPopup/ReplyTo/List", NULL, N_("Mailing _list"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_REPLY_TO_LIST */
+
+ {"SummaryViewPopup/Forward", NULL, N_("_Forward"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_FORWARD_INLINE */
+ {"SummaryViewPopup/ForwardAtt", NULL, N_("For_ward as attachment"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_FORWARD_AS_ATTACH */
+ {"SummaryViewPopup/Redirect", NULL, N_("Redirec_t"), NULL, NULL, G_CALLBACK(summary_reply_cb) }, /* COMPOSE_REDIRECT */
{"SummaryViewPopup/Mark", NULL, N_("_Mark"), NULL, NULL, NULL },
{"SummaryViewPopup/ColorLabel", NULL, N_("Color la_bel"), NULL, NULL, NULL },
{"SummaryViewPopup/Tags", NULL, N_("Ta_gs"), NULL, NULL, NULL },
@@ -659,17 +664,21 @@ SummaryView *summary_create(MainWindow *mainwin)
gtk_action_group_add_actions(mainwin->action_group, summary_popup_entries,
G_N_ELEMENTS(summary_popup_entries), (gpointer)summaryview);
+ summaryview->ui_manager = gtk_ui_manager_new();
+ summaryview->action_group = cm_menu_create_action_group_full(summaryview->ui_manager,"Menu", summary_popup_entries,
+ G_N_ELEMENTS(summary_popup_entries), (gpointer)summaryview);
+
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menus", "Menus", GTK_UI_MANAGER_MENUBAR)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus", "SummaryViewPopup", "SummaryViewPopup", GTK_UI_MANAGER_MENU)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Reply", "Message/Reply", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Reply", "SummaryViewPopup/Reply", GTK_UI_MANAGER_MENUITEM)
#ifndef GENERIC_UMPC
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "ReplyTo", "SummaryViewPopup/ReplyTo", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Separator1", "Message/---", GTK_UI_MANAGER_SEPARATOR)
#endif
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Forward", "Message/Forward", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Forward", "SummaryViewPopup/Forward", GTK_UI_MANAGER_MENUITEM)
#ifndef GENERIC_UMPC
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "ForwardAtt", "Message/ForwardAtt", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Redirect", "Message/Redirect", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "ForwardAtt", "SummaryViewPopup/ForwardAtt", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Redirect", "SummaryViewPopup/Redirect", GTK_UI_MANAGER_MENUITEM)
#endif
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Separator2", "Message/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Move", "Message/Move", GTK_UI_MANAGER_MENUITEM)
@@ -701,9 +710,9 @@ SummaryView *summary_create(MainWindow *mainwin)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup", "Separator6", "File/---", GTK_UI_MANAGER_SEPARATOR)
/* submenus - replyto */
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup/ReplyTo", "All", "Message/ReplyTo/All", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup/ReplyTo", "Sender", "Message/ReplyTo/Sender", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup/ReplyTo", "MailingList", "Message/ReplyTo/List", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup/ReplyTo", "All", "SummaryViewPopup/ReplyTo/All", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup/ReplyTo", "Sender", "SummaryViewPopup/ReplyTo/Sender", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup/ReplyTo", "MailingList", "SummaryViewPopup/ReplyTo/List", GTK_UI_MANAGER_MENUITEM)
/* submenus - mark */
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menus/SummaryViewPopup/Mark", "Mark", "Message/Mark/Mark", GTK_UI_MANAGER_MENUITEM)
@@ -8398,3 +8407,44 @@ void summaryview_unlock(SummaryView *summaryview, FolderItem *item)
{
gtk_widget_set_sensitive(summaryview->ctree, TRUE);
}
+
+#define DO_ACTION(name, act) { if (!strcmp(a_name, name)) action = act; }
+static void summary_reply_cb(GtkAction *gaction, gpointer data)
+{
+ SummaryView *summaryview = (SummaryView *)data;
+ GSList *msginfo_list = NULL;
+ gint action = COMPOSE_REPLY;
+ const gchar *a_name = gtk_action_get_name(gaction);
+
+ DO_ACTION("SummaryViewPopup/Reply", COMPOSE_REPLY);
+ DO_ACTION("SummaryViewPopup/ReplyTo/All", COMPOSE_REPLY_TO_ALL);
+ DO_ACTION("SummaryViewPopup/ReplyTo/Sender", COMPOSE_REPLY_TO_SENDER);
+ DO_ACTION("SummaryViewPopup/ReplyTo/List", COMPOSE_REPLY_TO_LIST);
+ DO_ACTION("SummaryViewPopup/Forward", COMPOSE_FORWARD_INLINE);
+ DO_ACTION("SummaryViewPopup/ForwardAtt", COMPOSE_FORWARD_AS_ATTACH);
+ DO_ACTION("SummaryViewPopup/Redirect", COMPOSE_REDIRECT);
+
+ msginfo_list = summary_get_selection(summaryview);
+ cm_return_if_fail(msginfo_list != NULL);
+ compose_reply_from_messageview(NULL, msginfo_list, action);
+ g_slist_free(msginfo_list);
+}
+
+gboolean summary_is_opened_message_selected(SummaryView *summaryview)
+{
+ GList *sel = NULL;
+
+ cm_return_val_if_fail(summaryview != NULL, FALSE);
+
+ sel = GTK_CMCLIST(summaryview->ctree)->selection;
+
+ cm_return_val_if_fail(sel != NULL, FALSE);
+
+ for ( ; sel != NULL; sel = sel->next) {
+ if (summaryview->displayed == GTK_CMCTREE_NODE(sel->data)) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
diff --git a/src/summaryview.h b/src/summaryview.h
index 258672c..e00f133 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -110,7 +110,6 @@ struct _SummaryView
GtkWidget *popupmenu;
GtkWidget *colorlabel_menu;
GtkWidget *tags_menu;
-
GtkWidget *window;
GtkCMCTreeNode *selected;
@@ -174,6 +173,9 @@ private:
FolderItem *search_root_folder;
guint mark_as_read_timeout_tag;
+
+ GtkActionGroup *action_group;
+ GtkUIManager *ui_manager;
};
SummaryView *summary_create(MainWindow *mainwin);
@@ -333,4 +335,5 @@ void summary_relayout(SummaryView *summaryview);
void summary_update_unread(SummaryView *summaryview, FolderItem *removed_item);
gboolean summary_is_list(SummaryView *summaryview);
gboolean summaryview_search_root_progress(gpointer data, guint at, guint matched, guint total);
+gboolean summary_is_opened_message_selected(SummaryView *summaryview);
#endif /* __SUMMARY_H__ */
diff --git a/src/toolbar.c b/src/toolbar.c
index 15b05b5..9fcb7ea 100644
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -2966,6 +2966,7 @@ static void toolbar_reply(gpointer data, guint action)
MainWindow *mainwin;
MessageView *msgview;
GSList *msginfo_list = NULL;
+ gboolean msg_is_selected = FALSE;
cm_return_if_fail(toolbar_item != NULL);
@@ -2974,11 +2975,13 @@ static void toolbar_reply(gpointer data, guint action)
mainwin = (MainWindow*)toolbar_item->parent;
msginfo_list = summary_get_selection(mainwin->summaryview);
msgview = (MessageView*)mainwin->messageview;
+ msg_is_selected = summary_is_opened_message_selected(mainwin->summaryview);
break;
case TOOLBAR_MSGVIEW:
msgview = (MessageView*)toolbar_item->parent;
cm_return_if_fail(msgview != NULL);
msginfo_list = g_slist_append(msginfo_list, msgview->msginfo);
+ msg_is_selected = TRUE;
break;
default:
return;
@@ -2986,7 +2989,11 @@ static void toolbar_reply(gpointer data, guint action)
cm_return_if_fail(msgview != NULL);
cm_return_if_fail(msginfo_list != NULL);
- compose_reply_from_messageview(msgview, msginfo_list, action);
+ if (msg_is_selected) {
+ compose_reply_from_messageview(msgview, msginfo_list, action);
+ } else {
+ compose_reply_from_messageview(msgview, NULL, action);
+ }
g_slist_free(msginfo_list);
/* TODO: update reply state ion summaryview */
commit bf3b50ead3cabfa24dc85a1553e213510008965a
Author: Colin Leroy <colin at colino.net>
Date: Fri Sep 28 10:29:27 2018 +0200
Fix possible null-dereference (thanks Coverity)
diff --git a/src/messageview.c b/src/messageview.c
index 1cc2981..5663fd5 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -1269,8 +1269,8 @@ static gboolean messageview_try_select_mimeinfo(MessageView *messageview, MsgInf
return TRUE;
} else if (!strcasecmp(mimeinfo->subtype, "html")
&& mimeinfo->disposition != DISPOSITIONTYPE_ATTACHMENT
- && (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS
- || (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT
+ && ((msginfo->folder && msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS)
+ || ((msginfo->folder && msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT)
&& prefs_common.promote_html_part))) {
mimeview_select_mimepart_icon(messageview->mimeview, mimeinfo);
return TRUE;
commit 277798d5a492464a54d54c8c5d22c17dd41b6bd9
Author: Colin Leroy <colin at colino.net>
Date: Thu Sep 27 08:55:10 2018 +0200
Fix Quicksearch eating keypresses it didn't handle.
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 775eafc..8c694c0 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -1369,9 +1369,11 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
{
GtkWidget *entry =
quicksearch_get_entry(mainwin->summaryview->quicksearch);
- gboolean dummy;
- g_signal_emit_by_name(entry, "key-press-event", event, &dummy);
- return TRUE;
+ gboolean handled;
+ g_signal_emit_by_name(entry, "key-press-event", event, &handled);
+ if (handled) {
+ return TRUE;
+ }
}
switch (event->keyval) {
commit 1a6b1fa9a594a13b416192e1bdc413528b39136e
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Sun Sep 23 16:44:45 2018 +0200
Add a NULL check in summary_select_by_msg_list when selecting tree nodes.
This fixes an assertion failure when executing an action
which moves selected messages to a different folder. We
obviously cannot select previously selected messages if
they're not in current folder anymore.
diff --git a/src/summaryview.c b/src/summaryview.c
index 1fd33a9..0f7a6bd 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -2225,7 +2225,8 @@ void summary_select_by_msg_list(SummaryView *summaryview, GSList *msginfos)
for(walk = msgnum_list; walk; walk = walk->next) {
GtkCMCTreeNode *node;
node = summary_find_msg_by_msgnum(summaryview, GPOINTER_TO_UINT(walk->data));
- gtk_cmctree_select(ctree, node);
+ if (node != NULL)
+ gtk_cmctree_select(ctree, node);
}
END_LONG_OPERATION(summaryview);
g_slist_free(msgnum_list);
commit 0492042f37449ed6e4079f9cadab3dec67bcaf63
Author: wwp <subscript at free.fr>
Date: Thu Sep 20 22:16:33 2018 +0200
Quicksearch: expand extended symbols on "Edit", patch by Olivier Brunel.
diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c
index 63e92e0..633664c 100644
--- a/src/gtk/quicksearch.c
+++ b/src/gtk/quicksearch.c
@@ -594,12 +594,16 @@ static gboolean search_condition_expr(GtkMenuItem *widget, gpointer data)
mainwindow_get_mainwindow()->summaryview->quicksearch != NULL,
FALSE);
- /* re-use the current quicksearch value if it's a condition expression,
- otherwise ignore it silently */
+ /* re-use the current quicksearch value, expanding it so it also works
+ * with extended symbols */
cond_str = quicksearch_get_text(mainwindow_get_mainwindow()->summaryview->quicksearch);
if (*cond_str != '\0') {
- matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
+ gchar *newstr = advsearch_expand_search_string(cond_str);
+
+ if (newstr && newstr[0] != '\0')
+ matchers = matcher_parser_get_cond(newstr, FALSE);
+ g_free(newstr);
}
prefs_matcher_open(matchers, search_condition_expr_done);
commit 71b5da72e1c6ca505e6b68dfe17ddce78b743a68
Author: Paul <paul at claws-mail.org>
Date: Thu Sep 20 10:00:47 2018 +0100
Fix protocol part of some more URLs
diff --git a/src/common/defs.h b/src/common/defs.h
index 5ab20e6..d115b5e 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -77,20 +77,20 @@
#define ADDRESS_BOOK "addressbook.xml"
#define ADDRBOOK_DIR "addrbook"
#define MANUAL_HTML_INDEX "claws-mail-manual.html"
-#define HOMEPAGE_URI "http://www.claws-mail.org/"
-#define MANUAL_URI "http://www.claws-mail.org/documentation.php"
-#define FAQ_URI "http://www.claws-mail.org/faq/index.php"
-#define PLUGINS_URI "http://www.claws-mail.org/plugins.php"
-#define DICTS_URI "http://www.claws-mail.org/win32/dictionaries.php"
-#define BUGZILLA_URI "http://www.thewildbeast.co.uk/claws-mail/bugzilla/enter_bug.cgi"
-#define THEMES_URI "http://www.claws-mail.org/themes.php"
-#define TOOLS_URI "http://www.claws-mail.org/tools.php"
-#define MAILING_LIST_URI "http://www.claws-mail.org/MLs.php"
+#define HOMEPAGE_URI "https://www.claws-mail.org/"
+#define MANUAL_URI "https://www.claws-mail.org/documentation.php"
+#define FAQ_URI "https://www.claws-mail.org/faq/index.php"
+#define PLUGINS_URI "https://www.claws-mail.org/plugins.php"
+#define DICTS_URI "https://www.claws-mail.org/win32/dictionaries.php"
+#define BUGZILLA_URI "https://www.thewildbeast.co.uk/claws-mail/bugzilla/enter_bug.cgi"
+#define THEMES_URI "https://www.claws-mail.org/themes.php"
+#define TOOLS_URI "https://www.claws-mail.org/tools.php"
+#define MAILING_LIST_URI "https://www.claws-mail.org/MLs.php"
#define USERS_ML_ADDR "users at lists.claws-mail.org"
-#define USERS_ML_URI "http://lists.claws-mail.org/cgi-bin/mailman/listinfo/users"
-#define GPL_URI "http://www.gnu.org/licenses/gpl.html"
-#define DONATE_URI "http://www.claws-mail.org/sponsors.php"
-#define CONFIG_VERSIONS_URI "http://www.claws-mail.org/cvc.php"
+#define USERS_ML_URI "https://lists.claws-mail.org/cgi-bin/mailman/listinfo/users"
+#define GPL_URI "https://www.gnu.org/licenses/gpl.html"
+#define DONATE_URI "https://www.claws-mail.org/sponsors.php"
+#define CONFIG_VERSIONS_URI "https://www.claws-mail.org/cvc.php"
#define RELEASE_NOTES_FILE "RELEASE_NOTES"
#define THEMEINFO_FILE ".claws_themeinfo"
#define FOLDER_LIST "folderlist.xml"
commit dfe7fc39cae1299d4b3f1b85447fa6d599544658
Author: Ricardo Mones <ricardo at mones.org>
Date: Thu Sep 20 00:53:52 2018 +0200
Fix protocol part of some URLs
diff --git a/README b/README
index 6ec822d..5da3c34 100644
--- a/README
+++ b/README
@@ -245,7 +245,7 @@ All plugin preferences can be found under
Additonal plugins can be found here:
-http://www.claws-mail.org/plugins.php
+https://www.claws-mail.org/plugins.php
3. Actions
@@ -367,7 +367,7 @@ http://www.claws-mail.org/plugins.php
4. Icon Themes
--------------
Claws has support for different icon sets. Several icon sets can be
- downloaded from http://www.claws-mail.org/themes.php
+ downloaded from https://www.claws-mail.org/themes.php
You will need to create a directory called 'themes' in your config
directory, unpack them into this directory, and then use the interface
to select them, /Configuration/Preferences/Display/Themes
@@ -500,7 +500,7 @@ http://www.claws-mail.org/plugins.php
The complete and up to date list of hidden options can be found
on Hidden preferences section of Claws Mail Manual:
- http://www.claws-mail.org/manual/claws-mail-manual.html#adv_hidden
+ https://www.claws-mail.org/manual/claws-mail-manual.html#adv_hidden
9. Tools
---------
@@ -598,17 +598,17 @@ http://www.claws-mail.org/plugins.php
---------------------
You are encourged to send patches via the Claws Mail bugzilla at
-http://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
+https://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
But please first read the patch guidelines here:
-http://www.claws-mail.org/devel.php
+https://www.claws-mail.org/devel.php
If that's too troublesome, either contact Paul Mangan
<paul at claws-mail.org> or consider posting to the
Claws Mail-users mailing list.
-http://www.claws-mail.org/MLs.php
+https://www.claws-mail.org/MLs.php
Bugs can be reported with Claws' bugzilla at:
-http://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
+https://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
Of course, you can also post to the Claws Mail-users mailing list.
@@ -629,7 +629,7 @@ it, or the feature was already discussed and rejected for whatever reason.
You might want to go ahead and hack a patch for it. (That would be very
cool!) Another possibility is to add a request to our bugzilla, (severity:
'enhancement'), at
-http://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
+https://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
12. Installing Claws Mail from Git
@@ -641,7 +641,7 @@ http://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
To download the latest Git, cd to the directory where you wish to download
to and type the following information:
- git clone http://git.claws-mail.org/readonly/claws.git
+ git clone https://git.claws-mail.org/readonly/claws.git
Later, when you want to update your local repository, you'll just have to
go back to the 'claws' directory, and type:
@@ -803,35 +803,35 @@ GTK 1 Version
14. Useful links
----------------
Homepage
- http://www.claws-mail.org/
+ https://www.claws-mail.org/
User Contributed FAQ
- http://www.claws-mail.org/faq/
+ https://www.claws-mail.org/faq/
Downloads
- http://www.claws-mail.org/releases.php
+ https://www.claws-mail.org/releases.php
Release Announcement Feed
- http://www.claws-mail.org/releases.rss
+ https://www.claws-mail.org/releases.rss
Latest Release Notes
- http://www.claws-mail.org/news.php
+ https://www.claws-mail.org/news.php
Other Downloads
- http://www.claws-mail.org/downloads.php
+ https://www.claws-mail.org/downloads.php
List of Plugins
- http://www.claws-mail.org/plugins.php
+ https://www.claws-mail.org/plugins.php
Icon Themes
- http://www.claws-mail.org/themes.php
+ https://www.claws-mail.org/themes.php
Mailing Lists
- http://www.claws-mail.org/MLs.php
+ https://www.claws-mail.org/MLs.php
Users Mailing List archive
- http://lists.claws-mail.org/pipermail/users/index.html
+ https://lists.claws-mail.org/pipermail/users/index.html
Commits Announcement List archive
- http://lists.claws-mail.org/pipermail/commits/index.html
+ https://lists.claws-mail.org/pipermail/commits/index.html
Bug/Patch/Feature Request Tracker
- http://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
+ https://www.thewildbeast.co.uk/claws-mail/bugzilla/index.cgi
Internationalisation Status
- http://www.claws-mail.org/i18n.php
+ https://www.claws-mail.org/i18n.php
Donations
- http://www.claws-mail.org/sponsors.php
+ https://www.claws-mail.org/sponsors.php
Planet Claws Mail
- http://planet.claws-mail.org/
+ https://planet.claws-mail.org/
Claws Mail for Windows homepage
- http://www.claws-mail.org/win32/
+ https://www.claws-mail.org/win32/
commit 6293ad156ecd414b47ad534991a37b5d001c28f4
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Tue Sep 18 19:29:12 2018 +0200
Set missing pubdate/moddate in RSSyl items to the other one, if available.
diff --git a/src/plugins/rssyl/parse822.c b/src/plugins/rssyl/parse822.c
index b153936..3f12414 100644
--- a/src/plugins/rssyl/parse822.c
+++ b/src/plugins/rssyl/parse822.c
@@ -103,10 +103,12 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
started_author = TRUE;
}
- /* Date */
+ /* Date (set both FeedItem timestamps) */
if( !strcmp(line[0], "Date") ) {
feed_item_set_date_modified(item,
procheader_date_parse(NULL, line[1], 0));
+ feed_item_set_date_published(item,
+ feed_item_get_date_modified(item));
debug_print("RSSyl: got date \n" );
}
diff --git a/src/plugins/rssyl/rssyl_add_item.c b/src/plugins/rssyl/rssyl_add_item.c
index 25ce836..685d75b 100644
--- a/src/plugins/rssyl/rssyl_add_item.c
+++ b/src/plugins/rssyl/rssyl_add_item.c
@@ -303,11 +303,30 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item)
}
*/
- /* If neither item date is set, use date from source (Atom only). */
+ /* If one of the timestamps is empty, set it to value of the other one. */
if( feed_item_get_date_modified(feed_item) == -1 &&
- feed_item_get_date_published(feed_item) == -1 )
+ feed_item_get_date_published(feed_item) >= 0 ) {
+ debug_print("RSSyl: setting missing moddate to pubdate %ld\n",
+ feed_item_get_date_published(feed_item));
+ feed_item_set_date_modified(feed_item,
+ feed_item_get_date_published(feed_item));
+ } else if( feed_item_get_date_published(feed_item) == -1 &&
+ feed_item_get_date_modified(feed_item) >= 0 ) {
+ debug_print("RSSyl: setting missing pubdate to modddate %ld\n",
+ feed_item_get_date_modified(feed_item));
feed_item_set_date_published(feed_item,
+ feed_item_get_date_modified(feed_item));
+ } else if( feed_item_get_date_modified(feed_item) == -1 &&
+ feed_item_get_date_published(feed_item) == -1 &&
+ feed_item_get_sourcedate(feed_item) >= 0 ) {
+ /* If neither item date is set, use date from source (Atom only). */
+ debug_print("RSSyl: setting missing pubdate and moddate to feed source date %ld\n",
feed_item_get_sourcedate(feed_item));
+ feed_item_set_date_modified(feed_item,
+ feed_item_get_sourcedate(feed_item));
+ feed_item_set_date_published(feed_item,
+ feed_item_get_sourcedate(feed_item));
+ }
/* Fix up subject, url and ID (rssyl_format_string()) so that
* comparing doesn't break. */
commit 5b1b28ce697da50f9af01e7b6aef9008403a816b
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Tue Sep 18 19:28:28 2018 +0200
The pubDate timestamp in RSS2.0 sets date_published.
diff --git a/src/plugins/rssyl/libfeed/parser_rss20.c b/src/plugins/rssyl/libfeed/parser_rss20.c
index df9c08e..c407894 100644
--- a/src/plugins/rssyl/libfeed/parser_rss20.c
+++ b/src/plugins/rssyl/libfeed/parser_rss20.c
@@ -29,6 +29,7 @@
#include "feeditemenclosure.h"
#include "date.h"
#include "parser.h"
+#include "common/utils.h"
void feed_parser_rss20_start(void *data, const gchar *el, const gchar **attr)
{
@@ -164,7 +165,7 @@ void feed_parser_rss20_end(void *data, const gchar *el)
} else if( !strcmp(el, "dc:date") ) {
ctx->curitem->date_modified = procheader_date_parse(NULL, text, 0);
} else if( !strcmp(el, "pubDate") ) {
- ctx->curitem->date_modified = procheader_date_parse(NULL, text, 0);
+ ctx->curitem->date_published = procheader_date_parse(NULL, text, 0);
} else if( !strcmp(el, "dc:creator")) {
FILL(ctx->curitem->author)
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list