[evolution/account-mgmt: 43/50] Adapt mailing-list-actions plugin to the new ESource API.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/account-mgmt: 43/50] Adapt mailing-list-actions plugin to the new ESource API.
- Date: Fri, 23 Dec 2011 19:52:18 +0000 (UTC)
commit e8bad799231e3d5bfaf306be21984c53a7658194
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon Apr 25 15:16:52 2011 -0400
Adapt mailing-list-actions plugin to the new ESource API.
.../mailing-list-actions/mailing-list-actions.c | 38 ++++++++++++++------
1 files changed, 27 insertions(+), 11 deletions(-)
---
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c
index 8e849be..9d5db71 100644
--- a/plugins/mailing-list-actions/mailing-list-actions.c
+++ b/plugins/mailing-list-actions/mailing-list-actions.c
@@ -29,6 +29,8 @@
#include <string.h>
#include <gtk/gtk.h>
+#include <libedataserver/e-source-mail-account.h>
+
#include "composer/e-msg-composer.h"
#include "mail/e-mail-browser.h"
#include "mail/e-mail-reader.h"
@@ -40,7 +42,6 @@
#include "mail/mail-mt.h"
#include "mail/message-list.h"
#include "e-util/e-util.h"
-#include "e-util/e-account-utils.h"
#include "e-util/e-alert-dialog.h"
#include "shell/e-shell-view.h"
#include "shell/e-shell-window.h"
@@ -130,16 +131,24 @@ emla_list_action_cb (CamelFolder *folder,
CamelMimeMessage *message;
gint send_message_response;
EShell *shell;
+ ESource *source;
EMailBackend *backend;
+ ESourceRegistry *registry;
EShellBackend *shell_backend;
- EAccount *account;
GtkWindow *window;
CamelStore *store;
const gchar *uid;
GError *error = NULL;
+ window = e_mail_reader_get_window (context->reader);
+ backend = e_mail_reader_get_backend (context->reader);
alert_sink = e_activity_get_alert_sink (context->activity);
+ shell_backend = E_SHELL_BACKEND (backend);
+ shell = e_shell_backend_get_shell (shell_backend);
+
+ registry = e_shell_get_registry (shell);
+
message = camel_folder_get_message_finish (folder, result, &error);
if (e_activity_handle_cancellation (context->activity, error)) {
@@ -168,14 +177,19 @@ emla_list_action_cb (CamelFolder *folder,
store = camel_folder_get_parent_store (folder);
uid = camel_service_get_uid (CAMEL_SERVICE (store));
- account = e_get_account_by_uid (uid);
+ source = e_source_registry_lookup_by_uid (registry, uid);
- backend = e_mail_reader_get_backend (context->reader);
+ /* Reuse this to hold the mail identity UID. */
+ uid = NULL;
- shell_backend = E_SHELL_BACKEND (backend);
- shell = e_shell_backend_get_shell (shell_backend);
+ if (source != NULL) {
+ ESourceMailAccount *extension;
+ const gchar *extension_name;
- window = e_mail_reader_get_window (context->reader);
+ extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
+ extension = e_source_get_extension (source, extension_name);
+ uid = e_source_mail_account_get_identity_uid (extension);
+ }
for (t = 0; t < G_N_ELEMENTS (emla_action_headers); t++) {
if (emla_action_headers[t].action == context->action &&
@@ -224,12 +238,14 @@ emla_list_action_cb (CamelFolder *folder,
url, NULL);
if (send_message_response == GTK_RESPONSE_YES) {
+ EComposerHeaderTable *table;
+
/* directly send message */
composer = e_msg_composer_new_from_url (shell, url);
- if (account != NULL)
- e_composer_header_table_set_account (
- e_msg_composer_get_header_table (composer),
- account);
+ table = e_msg_composer_get_header_table (composer);
+
+ if (uid != NULL)
+ e_composer_header_table_set_identity_uid (table, uid);
e_msg_composer_send (composer);
} else if (send_message_response == GTK_RESPONSE_NO) {
/* show composer */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]