+2003-04-08
+
+ * src/procmsg.[ch]: procmsg_get_filter_keyword(): new. It returns
+ filter keyword for messages.
+ * src/summaryview.c: summary_filter_open(): use
+ procmsg_get_filter_keyword().
+ * src/messageview.c: create_filter_cb(): implemented.
+
+2003-04-07
+
+ * src/inc.c:
+ inc_start()
+ inc_put_error(): display server responses on error.
+ * src/pop.[ch]: added Pop3Session::error_msg, and set server responses
+ on error.
+
2003-04-04
* src/messageview.[ch]: separated the forced charset of message view
+2003-04-08 [paul] 0.8.11claws77
+
+ * sync with 0.8.11cvs20
+ see ChangeLog 2003-04-07 and 2003-04-08
+
2003-04-07 [christoph] 0.8.11claws76
* src/filtering.[ch]
+2003-04-08
+
+ * src/procmsg.[ch]: procmsg_get_filter_keyword(): ¿·µ¬¡£¥á¥Ã¥»¡¼¥¸¤Î
+ ¥Õ¥£¥ë¥¿ÍÑ¥¡¼¥ï¡¼¥É¤òÊÖ¤¹¡£
+ * src/summaryview.c: summary_filter_open():
+ procmsg_get_filter_keyword() ¤ò»ÈÍÑ¡£
+ * src/messageview.c: create_filter_cb(): ¼ÂÁõ¡£
+
+2003-04-07
+
+ * src/inc.c:
+ inc_start()
+ inc_put_error(): ¥¨¥é¡¼»þ¤Ë¥µ¡¼¥Ð¤Î±þÅú¤òɽ¼¨¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+ * src/pop.[ch]: Pop3Session::error_msg ¤òÄɲä·¡¢¥¨¥é¡¼»þ¤Ë
+ ¥µ¡¼¥Ð¤Î±þÅú¤ò¥»¥Ã¥È¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
2003-04-04
* src/messageview.[ch]: ÊÌ¥¦¥£¥ó¥É¥¦¤Î¥á¥Ã¥»¡¼¥¸¥Ó¥å¡¼¤Îʸ»ú¥³¡¼¥É
MICRO_VERSION=11
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws76
+EXTRA_VERSION=claws77
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
const gchar *msg,
gpointer data);
-static void inc_put_error (IncState istate);
+static void inc_put_error (IncState istate,
+ const gchar *msg);
static void inc_cancel_cb (GtkWidget *widget,
gpointer data);
if (inc_state != INC_SUCCESS && inc_state != INC_CANCEL) {
error_num++;
- if (inc_state == INC_ERROR ||
- inc_state == INC_IO_ERROR ||
- inc_state == INC_SOCKET_ERROR) {
- inc_put_error(inc_state);
- } else if (inc_state == INC_NO_SPACE) {
- inc_put_error(inc_state);
+ if (inc_dialog->show_dialog)
+ manage_window_focus_in
+ (inc_dialog->dialog->window,
+ NULL, NULL);
+ inc_put_error(inc_state, pop3_session->error_msg);
+ if (inc_dialog->show_dialog)
+ manage_window_focus_out
+ (inc_dialog->dialog->window,
+ NULL, NULL);
+ if (inc_state == INC_NO_SPACE ||
+ inc_state == INC_IO_ERROR)
break;
- }
}
inc_session_destroy(session);
return 0;
}
-static void inc_put_error(IncState istate)
+static void inc_put_error(IncState istate, const gchar *msg)
{
switch (istate) {
case INC_ERROR:
- if (!prefs_common.no_recv_err_panel)
- alertpanel_error
- (_("Error occurred while processing mail."));
+ if (prefs_common.no_recv_err_panel)
+ break;
+ if (msg)
+ alertpanel_error(_("Error occurred while processing mail:\n%s"), msg);
+ else
+ alertpanel_error(_("Error occurred while processing mail."));
break;
case INC_NO_SPACE:
alertpanel_error(_("No disk space left."));
alertpanel_error(_("Can't write file."));
break;
case INC_SOCKET_ERROR:
+ if (prefs_common.no_recv_err_panel)
+ break;
alertpanel_error(_("Socket error."));
break;
case INC_LOCKED:
- if (!prefs_common.no_recv_err_panel)
+ if (prefs_common.no_recv_err_panel)
+ break;
+ if (msg)
+ alertpanel_error(_("Mailbox is locked:\n%s"), msg);
+ else
alertpanel_error(_("Mailbox is locked."));
break;
+ case INC_AUTH_FAILED:
+ if (prefs_common.no_recv_err_panel)
+ break;
+ if (msg)
+ alertpanel_error(_("Authentication failed:\n%s"),
+ msg);
+ else
+ alertpanel_error(_("Authentication failed."));
+ break;
default:
break;
}
static void create_filter_cb(gpointer data, guint action, GtkWidget *widget)
{
+ MessageView *messageview = (MessageView *)data;
+ gchar *header = NULL;
+ gchar *key = NULL;
+
+ if (!messageview->msginfo) return;
+
+ procmsg_get_filter_keyword(messageview->msginfo, &header, &key,
+ (PrefsFilterType)action);
+ prefs_filtering_open(NULL, header, key);
+
+ g_free(header);
+ g_free(key);
}
static void about_cb(gpointer data, guint action, GtkWidget *widget)
session->uidl_table = pop3_get_uidl_table(account);
session->current_time = time(NULL);
session->error_val = PS_SUCCESS;
+ session->error_msg = NULL;
return SESSION(session);
}
g_free(pop3_session->greeting);
g_free(pop3_session->user);
g_free(pop3_session->pass);
+ g_free(pop3_session->error_msg);
}
GHashTable *pop3_get_uidl_table(PrefsAccount *ac_prefs)
}
}
+ g_free(session->error_msg);
+ session->error_msg = g_strdup(msg);
fprintf(stderr, "POP3: %s\n", msg);
} else
ok = PS_PROTOCOL;
time_t current_time;
Pop3ErrorValue error_val;
+ gchar *error_msg;
gpointer data;
};
#include "send_message.h"
#include "procmime.h"
#include "statusbar.h"
+#include "prefs_filtering.h"
+#include "filtering.h"
#include "folder.h"
#include "prefs_common.h"
#include "account.h"
#include "news.h"
#include "hooks.h"
#include "msgcache.h"
-#include "filtering.h"
typedef struct _FlagInfo FlagInfo;
return ret;
}
+void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
+ PrefsFilterType type)
+{
+ static HeaderEntry hentry[] = {{"X-BeenThere:", NULL, FALSE},
+ {"X-ML-Name:", NULL, FALSE},
+ {"X-List:", NULL, FALSE},
+ {"X-Mailing-list:", NULL, FALSE},
+ {"List-Id:", NULL, FALSE},
+ {NULL, NULL, FALSE}};
+
+ enum
+ {
+ H_X_BEENTHERE = 0,
+ H_X_ML_NAME = 1,
+ H_X_LIST = 2,
+ H_X_MAILING_LIST = 3,
+ H_LIST_ID = 4
+ };
+
+ FILE *fp;
+ int header_offset;
+ int hentry_offset;
+
+ g_return_if_fail(msginfo != NULL);
+ g_return_if_fail(header != NULL);
+ g_return_if_fail(key != NULL);
+
+ *header = NULL;
+ *key = NULL;
+
+ header_offset = 1;
+ hentry_offset = 5;
+
+ switch (type) {
+ case FILTER_BY_NONE:
+ return;
+ case FILTER_BY_AUTO:
+ if ((fp = procmsg_open_message(msginfo)) == NULL)
+ return;
+ procheader_get_header_fields(fp, hentry);
+ fclose(fp);
+
+ if (hentry[H_X_BEENTHERE].body != NULL) {
+ *header = g_strdup("header \"X-BeenThere\"");
+ *key = hentry[H_X_BEENTHERE].body;
+ hentry[H_X_BEENTHERE].body = NULL;
+ } else if (hentry[H_X_ML_NAME].body != NULL) {
+ *header = g_strdup("header \"X-ML-Name\"");
+ *key = hentry[H_X_ML_NAME].body;
+ hentry[H_X_ML_NAME].body = NULL;
+ } else if (hentry[H_X_LIST].body != NULL) {
+ *header = g_strdup("header \"X-List\"");
+ *key = hentry[H_X_LIST].body;
+ hentry[H_X_LIST].body = NULL;
+ } else if (hentry[H_X_MAILING_LIST].body != NULL) {
+ *header = g_strdup("header \"X-Mailing-List\"");
+ *key = hentry[H_X_MAILING_LIST].body;
+ hentry[H_X_MAILING_LIST].body = NULL;
+ } else if (hentry[H_LIST_ID].body != NULL) {
+ *header = g_strdup("header \"List-Id\"");
+ *key = hentry[H_LIST_ID].body;
+ hentry[H_LIST_ID].body = NULL;
+ } else if (msginfo->subject) {
+ *header = g_strdup("subject");
+ *key = g_strdup(msginfo->subject);
+ }
+
+ g_free(hentry[H_X_BEENTHERE].body);
+ hentry[H_X_BEENTHERE].body = NULL;
+ g_free(hentry[H_X_ML_NAME].body);
+ hentry[H_X_ML_NAME].body = NULL;
+ g_free(hentry[H_X_LIST].body);
+ hentry[H_X_LIST].body = NULL;
+ g_free(hentry[H_X_MAILING_LIST].body);
+ hentry[H_X_MAILING_LIST].body = NULL;
+ g_free(hentry[H_LIST_ID].body);
+ hentry[H_LIST_ID].body = NULL;
+
+ break;
+ case FILTER_BY_FROM:
+ *header = g_strdup("from");
+ *key = g_strdup(msginfo->from);
+ break;
+ case FILTER_BY_TO:
+ *header = g_strdup("to");
+ *key = g_strdup(msginfo->to);
+ break;
+ case FILTER_BY_SUBJECT:
+ *header = g_strdup("subject");
+ *key = g_strdup(msginfo->subject);
+ break;
+ default:
+ break;
+ }
+}
+
void procmsg_empty_trash(void)
{
FolderItem *trash;
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
MsgTmpFlags tmp_flags;
};
+#include "prefs_filtering.h"
+
struct _MsgInfo
{
guint refcnt;
#endif
gboolean procmsg_msg_exist (MsgInfo *msginfo);
+void procmsg_get_filter_keyword (MsgInfo *msginfo,
+ gchar **header,
+ gchar **key,
+ PrefsFilterType type);
+
void procmsg_empty_trash (void);
gint procmsg_send_queue (FolderItem *queue,
gboolean save_msgs);
void summary_filter_open(SummaryView *summaryview, PrefsFilterType type)
{
- static HeaderEntry hentry[] = {{"X-BeenThere:", NULL, FALSE},
- {"X-ML-Name:", NULL, FALSE},
- {"X-List:", NULL, FALSE},
- {"X-Mailing-list:", NULL, FALSE},
- {"List-Id:", NULL, FALSE},
- {NULL, NULL, FALSE}};
-
- static gchar *header_strs[] = {"From", "from", "To", "to", "Subject", "subject"};
-
- static gchar *hentry_strs[] = {"X-BeenThere", "X-ML-Name", "X-List",
- "X-Mailing-List", "List-Id",
- "header \"X-BeenThere\"", "header \"X-ML-Name\"",
- "header \"X-List\"", "header \"X-Mailing-List\"",
- "header \"List-Id\""};
- enum
- {
- H_X_BEENTHERE = 0,
- H_X_ML_NAME = 1,
- H_X_LIST = 2,
- H_X_MAILING_LIST = 3,
- H_LIST_ID = 4
- };
-
- enum
- {
- H_FROM = 0,
- H_TO = 2,
- H_SUBJECT = 4
- };
-
MsgInfo *msginfo;
gchar *header = NULL;
gchar *key = NULL;
- FILE *fp;
- int header_offset;
- int hentry_offset;
if (!summaryview->selected) return;
summaryview->selected);
if (!msginfo) return;
- header_offset = 1;
- hentry_offset = 5;
-
- switch (type) {
- case FILTER_BY_NONE:
- break;
- case FILTER_BY_AUTO:
- if ((fp = procmsg_open_message(msginfo)) == NULL) return;
- procheader_get_header_fields(fp, hentry);
- fclose(fp);
-
- if (hentry[H_X_BEENTHERE].body != NULL) {
- header = hentry_strs[H_X_BEENTHERE + hentry_offset];
- Xstrdup_a(key, hentry[H_X_BEENTHERE].body, );
- } else if (hentry[H_X_ML_NAME].body != NULL) {
- header = hentry_strs[H_X_ML_NAME + hentry_offset];
- Xstrdup_a(key, hentry[H_X_ML_NAME].body, );
- } else if (hentry[H_X_LIST].body != NULL) {
- header = hentry_strs[H_X_LIST + hentry_offset];
- Xstrdup_a(key, hentry[H_X_LIST].body, );
- } else if (hentry[H_X_MAILING_LIST].body != NULL) {
- header = hentry_strs[H_X_MAILING_LIST + hentry_offset];
- Xstrdup_a(key, hentry[H_X_MAILING_LIST].body, );
- } else if (hentry[H_LIST_ID].body != NULL) {
- header = hentry_strs[H_LIST_ID + hentry_offset];
- Xstrdup_a(key, hentry[H_LIST_ID].body, );
- } else if (msginfo->subject) {
- header = header_strs[H_SUBJECT + header_offset];
- key = msginfo->subject;
- }
-
- g_free(hentry[H_X_BEENTHERE].body);
- hentry[H_X_BEENTHERE].body = NULL;
- g_free(hentry[H_X_ML_NAME].body);
- hentry[H_X_ML_NAME].body = NULL;
- g_free(hentry[H_X_LIST].body);
- hentry[H_X_LIST].body = NULL;
- g_free(hentry[H_X_MAILING_LIST].body);
- hentry[H_X_MAILING_LIST].body = NULL;
- g_free(hentry[H_LIST_ID].body);
- hentry[H_LIST_ID].body = NULL;
-
- break;
- case FILTER_BY_FROM:
- header = header_strs[H_FROM + header_offset];
- key = msginfo->from;
- break;
- case FILTER_BY_TO:
- header = header_strs[H_TO + header_offset];
- key = msginfo->to;
- break;
- case FILTER_BY_SUBJECT:
- header = header_strs[H_SUBJECT + header_offset];
- key = msginfo->subject;
- break;
- default:
- break;
- }
-
- /*
- * NOTE: key may be allocated on the stack, so
- * prefs_filter[ing]_open() should have completed
- * and have set entries. Otherwise we're hosed.
- */
-
+ procmsg_get_filter_keyword(msginfo, &header, &key, type);
prefs_filtering_open(NULL, header, key);
+
+ g_free(header);
+ g_free(key);
}
/* color label */