* updates for the mu-contacs API update

This commit is contained in:
djcb
2012-06-18 18:00:13 +03:00
parent be46769255
commit afe2717ad4
3 changed files with 13 additions and 14 deletions

View File

@ -136,8 +136,8 @@ typedef struct _ECData ECData;
static void static void
each_contact (const char *email, const char *name, time_t tstamp, each_contact (const char *email, const char *name, gboolean personal,
ECData *ecdata) time_t tstamp, ECData *ecdata)
{ {
switch (ecdata->format) { switch (ecdata->format) {
case MU_CONFIG_FORMAT_MUTT_ALIAS: case MU_CONFIG_FORMAT_MUTT_ALIAS:

View File

@ -92,9 +92,6 @@ test_mu_cfind_plain (void)
==, ==,
"Mü testmu@testmu.xx\n" "Mü testmu@testmu.xx\n"
"Helmut Kröger hk@testmu.xxx\n"); "Helmut Kröger hk@testmu.xxx\n");
g_free (cmdline); g_free (cmdline);
g_free (muhome); g_free (muhome);
g_free (output); g_free (output);

View File

@ -1,5 +1,5 @@
/* /*
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** Copyright (C) 2008-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** **
** This program is free software; you can redistribute it and/or modify it ** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the ** under the terms of the GNU General Public License as published by the
@ -59,19 +59,21 @@ fill_database (void)
struct _Contact { struct _Contact {
char *name, *email; char *name, *email;
gboolean personal;
time_t tstamp; time_t tstamp;
}; };
typedef struct _Contact Contact; typedef struct _Contact Contact;
static Contact* static Contact*
contact_new (const char *email, const char *name, size_t tstamp) contact_new (const char *email, const char *name, gboolean personal, size_t tstamp)
{ {
Contact *contact; Contact *contact;
contact = g_slice_new (Contact); contact = g_slice_new (Contact);
contact->name = name ? g_strdup (name) :NULL; contact->name = name ? g_strdup (name) :NULL;
contact->email = email ? g_strdup (email) : NULL; contact->email = email ? g_strdup (email) : NULL;
contact->tstamp = tstamp; contact->personal = personal;
contact->tstamp = tstamp;
return contact; return contact;
@ -89,14 +91,14 @@ contact_destroy (Contact *contact)
static void static void
each_contact (const char *email, const char *name, time_t tstamp, each_contact (const char *email, const char *name, gboolean personal,
GSList **lst) time_t tstamp, GSList **lst)
{ {
Contact *contact; Contact *contact;
/* g_print ("[n:%s, e:%s]\n", name, email); */ /* g_print ("[n:%s, e:%s]\n", name, email); */
contact = contact_new (email, name, tstamp); contact = contact_new (email, name, personal, tstamp);
*lst = g_slist_prepend (*lst, contact); *lst = g_slist_prepend (*lst, contact);
} }