* mu-contacts: use encoded email address as group in gkeyfile (which valid as a

groupname), add real email as email= value; use g_keyfile_(get|set)_value
  instead of string, so there is no utf-8 problems, just the raw data we got
  as address

  This should all allow for any kind of email address, even invalid
  ones. switch order of name / address in mu_contacts_add
This commit is contained in:
Dirk-Jan C. Binnema
2011-05-24 21:41:52 +03:00
parent 271ec23b4e
commit 93522893bf
3 changed files with 217 additions and 86 deletions

View File

@ -69,7 +69,6 @@ struct _MuStore {
~_MuStore () {
try {
g_free (_version);
mu_contacts_destroy (_contacts);
mu_store_flush (this);
@ -536,13 +535,14 @@ each_contact_info (MuMsgContact *contact, MsgDoc *msgdoc)
if (!mu_str_is_empty(contact->address)) {
char *escaped = mu_str_ascii_xapian_escape (contact->address);
msgdoc->_doc->add_term
(std::string (pfx + escaped, 0, MU_STORE_MAX_TERM_LENGTH));
(std::string (pfx + escaped, 0,
MU_STORE_MAX_TERM_LENGTH));
g_free (escaped);
/* store it also in our contacts cache */
if (msgdoc->_store->_contacts)
mu_contacts_add (msgdoc->_store->_contacts,
contact->name, contact->address,
contact->address, contact->name,
mu_msg_get_date(msgdoc->_msg));
}
}