From 33efd90a82fbbbfb3f7645a149cfbfed471596fb Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 3 Dec 2003 00:27:52 +0000 Subject: changed to setup the rule part properly, it could never have worked. Bug 2003-12-03 Not Zed * mail-autofilter.c (rule_match_thread): changed to setup the rule part properly, it could never have worked. Bug #51601. * em-popup.c (emp_uri_popup_address_add): implement. * em-folder-view.c (emfv_popup_add_sender): implement. (emfv_add_sender_addressbook): hook up to above func. * em-utils.c (em_utils_add_address): implementation to add an email address to the addressbook. (emu_add_address_cb): callback required for funny api. Bug #51321. svn path=/trunk/; revision=23592 --- mail/em-folder-view.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'mail/em-folder-view.c') diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 602993e8f9..ca3df84be6 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -630,8 +630,17 @@ emfv_popup_label_set(GtkWidget *w, struct _emfv_label_item *item) static void emfv_popup_add_sender(GtkWidget *w, EMFolderView *emfv) { - /* FIXME */ - printf("UNIMPLEMENTED: add sender to addressbook\n"); + GPtrArray *uids = message_list_get_selected(emfv->list); + CamelMessageInfo *info; + const char *addr; + + if (uids->len == 1 + && (info = camel_folder_get_message_info(emfv->folder, uids->pdata[0])) != NULL + && (addr = camel_message_info_from(info)) != NULL + && addr[0] != 0) + em_utils_add_address((GtkWidget *)emfv, addr); + + em_utils_uids_free(uids); } static void @@ -824,6 +833,7 @@ from(BonoboUIComponent *uid, void *data, const char *path) \ to(NULL, (EMFolderView *)data); \ } +EMFV_MAP_CALLBACK(emfv_add_sender_addressbook, emfv_popup_add_sender) EMFV_MAP_CALLBACK(emfv_message_apply_filters, emfv_popup_apply_filters) EMFV_MAP_CALLBACK(emfv_message_copy, emfv_popup_copy) EMFV_MAP_CALLBACK(emfv_message_move, emfv_popup_move) @@ -933,15 +943,6 @@ emfv_mail_previous_unread(BonoboUIComponent *uid, void *data, const char *path) message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, CAMEL_MESSAGE_SEEN, TRUE); } -static void -emfv_add_sender_addressbook(BonoboUIComponent *uid, void *data, const char *path) -{ - EMFolderView *emfv = data; - - emfv = emfv; - /* FIXME: need to find out what the new addressbook API is for this... */ -} - static void emfv_message_forward_attached (BonoboUIComponent *uic, void *data, const char *path) { -- cgit