# HG changeset patch # User Christian Hammond # Date 1163390026 0 # Node ID 1aa9839ca5993a52eca3a337a3b144f3ca67daa4 # Parent b933bffead6e345ab7348ad22b6e1195025308b1 [gaim-migrate @ 17742] Fixed a bug (1310664) where a buddy already listed in the Evolution addressbook would still have an "Add to Address Book" menuitem in the context menu when using the gevolution plugin. committer: Tailor Script diff -r b933bffead6e -r 1aa9839ca599 gtk/plugins/gevolution/gevolution.c --- a/gtk/plugins/gevolution/gevolution.c Mon Nov 13 03:28:15 2006 +0000 +++ b/gtk/plugins/gevolution/gevolution.c Mon Nov 13 03:53:46 2006 +0000 @@ -276,23 +276,30 @@ { GaimMenuAction *act; GaimBuddy *buddy; + EContact *contact; if (!GAIM_BLIST_NODE_IS_BUDDY(node)) return; buddy = (GaimBuddy *)node; - if (gevo_prpl_is_supported(buddy->account, buddy)) + if (!gevo_prpl_is_supported(gaim_buddy_get_account(buddy), buddy)) + return; + + contact = gevo_search_buddy_in_contacts(buddy, NULL); + + if (contact == NULL) { act = gaim_menu_action_new(_("Add to Address Book"), GAIM_CALLBACK(menu_item_activate_cb), NULL, NULL); *menu = g_list_append(*menu, act); - act = gaim_menu_action_new(_("Send E-Mail"), - GAIM_CALLBACK(menu_item_send_mail_activate_cb), - NULL, NULL); - *menu = g_list_append(*menu, act); } + + act = gaim_menu_action_new(_("Send E-Mail"), + GAIM_CALLBACK(menu_item_send_mail_activate_cb), + NULL, NULL); + *menu = g_list_append(*menu, act); } /* TODO: Something in here leaks 1 reference to a bonobo object! */ @@ -531,7 +538,7 @@ N_("Provides integration with Evolution."), /** description */ N_("Provides integration with Evolution."), - "Christian Hammond ", /**< author */ + "Christian Hammond ", /**< author */ GAIM_WEBSITE, /**< homepage */ plugin_load, /**< load */