diff options
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/em-folder-browser.c | 5 | ||||
-rw-r--r-- | mail/em-folder-view.c | 29 | ||||
-rw-r--r-- | mail/mail.error.xml | 6 |
4 files changed, 44 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 3c7466a81f..e31770b7d3 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2006-11-09 Sankar P <psankar@novell.com> + + * em-folder-browser.c: (emfb_view_hide_selected): + * em-folder-view.c: (emfv_popup_delete): + * mail.error.xml: + Disable mail delete for proxy when there are not enough rights + 2006-10-16 Tor Lillqvist <tml@novell.com> Fix for #348212: diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index b995b31631..366bf2a4d8 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -1439,6 +1439,11 @@ emfb_view_hide_selected(BonoboUIComponent *uid, void *data, const char *path) /* TODO: perhaps this should sit directly on message_list? */ /* is it worth it, it's so trivial */ + + /* A new flag CAMEL_MESSAGE_HIDDEN is added by Sankar + while extending the CAMEL_MESSAGE_FLAGS for proxy permissions. + This can be used to hide messages. */ + uids = message_list_get_selected(emfv->list); message_list_hide_uids(emfv->list, uids); message_list_free_uids(emfv->list, uids); diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index b9d6dbe485..6f1dac6cb3 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -953,9 +953,32 @@ emfv_popup_delete(EPopup *ep, EPopupItem *pitem, void *data) { EMFolderView *emfv = data; int count; - - count = em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED); - + GPtrArray *uids; + + uids = message_list_get_selected(emfv->list); + camel_folder_freeze(emfv->folder); + + for (count=0; count < uids->len; count++) { + if (camel_folder_get_message_flags (emfv->folder, uids->pdata[count]) & CAMEL_MESSAGE_USER_NOT_DELETABLE) { + if ((EMFormatHTML *)emfv->preview_active) { + GtkHTMLStream *hstream = gtk_html_begin(((EMFormatHTML *)emfv->preview)->html); + + gtk_html_stream_printf(hstream, "<h2>%s</h2><p>%s</p>", + _("Mail Deletion Failed"), + _("You do not have sufficient permissions to delete this mail.")); + gtk_html_stream_close(hstream, GTK_HTML_STREAM_OK); + } else + e_error_run (NULL, "mail:no-delete-permission", "", ""); + + count = -1; + break; + } else + camel_folder_set_message_flags(emfv->folder, uids->pdata[count], CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_DELETED ); + } + + message_list_free_uids(emfv->list, uids); + camel_folder_thaw(emfv->folder); + if (count == 1) { if (!message_list_select (emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0) && emfv->hide_deleted) message_list_select (emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0); diff --git a/mail/mail.error.xml b/mail/mail.error.xml index 21584eaf29..936bcf9748 100644 --- a/mail/mail.error.xml +++ b/mail/mail.error.xml @@ -391,5 +391,11 @@ You can choose to ignore this folder, overwrite or append its contents, or quit. <_secondary xml:space="preserve">Please enable the account or send using another account.</_secondary> </error> + <error id="no-delete-permission" type="warning"> + <_primary>Mail Deletion Failed</_primary> + <_secondary xml:space="preserve">You do not have sufficient permissions to delete this mail.</_secondary> + </error> + + </error-list> |