mu: fix contacts callback return value

The callbacks for the contacts functions should return TRUE (or be
terminated early), but were void. Seems on Linux this usually still
worked, not so on OpenBSD at least (unit test broke). So, fix this.
This commit is contained in:
djcb
2016-11-16 20:20:15 +02:00
parent c2e4b26cd4
commit d30e0ab2ba

View File

@ -626,16 +626,16 @@ add_address_subfields (Xapian::Document& doc, const char *addr,
g_free (f2); g_free (f2);
} }
static void static gboolean
each_contact_info (MuMsgContact *contact, MsgDoc *msgdoc) each_contact_info (MuMsgContact *contact, MsgDoc *msgdoc)
{ {
/* for now, don't store reply-to addresses */ /* for now, don't store reply-to addresses */
if (mu_msg_contact_type (contact) == MU_MSG_CONTACT_TYPE_REPLY_TO) if (mu_msg_contact_type (contact) == MU_MSG_CONTACT_TYPE_REPLY_TO)
return; return TRUE;
const std::string pfx (xapian_pfx(contact)); const std::string pfx (xapian_pfx(contact));
if (pfx.empty()) if (pfx.empty())
return; /* unsupported contact type */ return TRUE; /* unsupported contact type */
if (!mu_str_is_empty(contact->name)) { if (!mu_str_is_empty(contact->name)) {
Xapian::TermGenerator termgen; Xapian::TermGenerator termgen;
@ -660,16 +660,18 @@ each_contact_info (MuMsgContact *contact, MsgDoc *msgdoc)
msgdoc->_personal, msgdoc->_personal,
mu_msg_get_date(msgdoc->_msg)); mu_msg_get_date(msgdoc->_msg));
} }
return TRUE;
} }
static void static gboolean
each_contact_check_if_personal (MuMsgContact *contact, MsgDoc *msgdoc) each_contact_check_if_personal (MuMsgContact *contact, MsgDoc *msgdoc)
{ {
GSList *cur; GSList *cur;
if (msgdoc->_personal || !contact->address) if (msgdoc->_personal || !contact->address)
return; return TRUE;
for (cur = msgdoc->_my_addresses; cur; cur = g_slist_next (cur)) { for (cur = msgdoc->_my_addresses; cur; cur = g_slist_next (cur)) {
if (g_ascii_strcasecmp ( if (g_ascii_strcasecmp (
@ -678,6 +680,8 @@ each_contact_check_if_personal (MuMsgContact *contact, MsgDoc *msgdoc)
break; break;
} }
} }
return TRUE;
} }
Xapian::Document Xapian::Document