aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-04-19 01:55:54 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-04-19 01:55:54 +0800
commitaa9071a09452e98b5e2a8842b3d2a0f288f2514d (patch)
tree4d72dac3ec26e1cfc6a87bac46a3f545c9c026c6
parentd9dc3541809b08e592657f14dcd690a111748fde (diff)
downloadgsoc2013-evolution-aa9071a09452e98b5e2a8842b3d2a0f288f2514d.tar
gsoc2013-evolution-aa9071a09452e98b5e2a8842b3d2a0f288f2514d.tar.gz
gsoc2013-evolution-aa9071a09452e98b5e2a8842b3d2a0f288f2514d.tar.bz2
gsoc2013-evolution-aa9071a09452e98b5e2a8842b3d2a0f288f2514d.tar.lz
gsoc2013-evolution-aa9071a09452e98b5e2a8842b3d2a0f288f2514d.tar.xz
gsoc2013-evolution-aa9071a09452e98b5e2a8842b3d2a0f288f2514d.tar.zst
gsoc2013-evolution-aa9071a09452e98b5e2a8842b3d2a0f288f2514d.zip
Implemented. (resend_msg): Use is_sent_folder().
2001-04-18 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (is_sent_folder): Implemented. (resend_msg): Use is_sent_folder(). svn path=/trunk/; revision=9449
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-callbacks.c63
2 files changed, 66 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 87291536a6..0d24ccf6d8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-18 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-callbacks.c (is_sent_folder): Implemented.
+ (resend_msg): Use is_sent_folder().
+
2001-04-17 Dan Winship <danw@ximian.com>
* mail-mt.c (mail_msg_check_error): Fix a memory leak.
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 8a5e0de29f..c94d575ed7 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -68,6 +68,7 @@
#endif
extern CamelFolder *drafts_folder;
+extern CamelFolder *sent_folder;
struct post_send_data {
CamelFolder *folder;
@@ -1008,6 +1009,63 @@ do_edit_messages(CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void
}
static gboolean
+is_sent_folder (CamelFolder *folder)
+{
+ /* FIXME: hide other attributes of the URL? */
+ CamelService *service = CAMEL_SERVICE (folder->parent_store);
+ guint32 flags = CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS;
+ const GSList *accounts;
+ CamelURL *url;
+ char *str;
+
+ if (folder == sent_folder)
+ return TRUE;
+
+ str = camel_url_to_string (service->url, flags);
+ url = camel_url_new (str, NULL);
+ g_free (str);
+
+ g_free (url->path);
+ url->path = g_strdup_printf ("/%s", folder->full_name);
+
+ accounts = mail_config_get_accounts ();
+ while (accounts) {
+ const MailConfigAccount *account = accounts->data;
+
+ if (account && account->sent_folder_uri) {
+ CamelURL *sent_url;
+
+ sent_url = camel_url_new (account->sent_folder_uri, NULL);
+
+ if (sent_url) {
+ g_free (sent_url->passwd);
+ sent_url->passwd = NULL;
+
+ if (sent_url->params) {
+ g_datalist_clear (&url->params);
+ url->params = NULL;
+ }
+
+ if (camel_url_equal (url, sent_url)) {
+ camel_url_free (sent_url);
+ camel_url_free (url);
+
+ return TRUE;
+ }
+
+ camel_url_free (sent_url);
+ }
+ }
+
+ accounts = accounts->next;
+ }
+
+ camel_url_free (url);
+
+ return FALSE;
+}
+
+static gboolean
is_drafts_folder (CamelFolder *folder)
{
/* FIXME: hide other attributes of the URL? */
@@ -1107,14 +1165,15 @@ do_resend_messages (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, v
mail_send_mail (account->transport->url, messages->pdata[i], NULL, NULL);
}
+
+
void
resend_msg (GtkWidget *widget, gpointer user_data)
{
FolderBrowser *fb = FOLDER_BROWSER (user_data);
- extern CamelFolder *sent_folder;
GPtrArray *uids;
- if (fb->folder != sent_folder) {
+ if (!is_sent_folder (fb->folder)) {
GtkWidget *message;
message = gnome_warning_dialog (_("You may only resend messages\n"