* some cleanups
This commit is contained in:
@ -83,7 +83,6 @@ libmu_la_SOURCES= \
|
||||
mu-store-read.cc \
|
||||
mu-store-write.cc \
|
||||
mu-store-priv.hh \
|
||||
mu-str-normalize.c \
|
||||
mu-str.c \
|
||||
mu-str.h \
|
||||
mu-threader.c \
|
||||
|
||||
@ -281,7 +281,6 @@ mu_contacts_add (MuContacts *self, const char *addr, const char *name,
|
||||
* empty name */
|
||||
group = encode_email_address (addr);
|
||||
|
||||
|
||||
cinfo = (ContactInfo*) g_hash_table_lookup (self->_hash, group);
|
||||
if (!cinfo || (cinfo->_tstamp < tstamp && !mu_str_is_empty(name))) {
|
||||
char *addr_dc;
|
||||
|
||||
39
lib/mu-msg.c
39
lib/mu-msg.c
@ -567,40 +567,6 @@ mu_msg_get_field_numeric (MuMsg *self, MuMsgFieldId mfid)
|
||||
}
|
||||
|
||||
|
||||
|
||||
MuMsgContact *
|
||||
mu_msg_contact_new (const char *name, const char *address,
|
||||
MuMsgContactType type)
|
||||
{
|
||||
MuMsgContact *self;
|
||||
|
||||
g_return_val_if_fail (name, NULL);
|
||||
g_return_val_if_fail (address, NULL);
|
||||
g_return_val_if_fail (!mu_msg_contact_type_is_valid(type),
|
||||
NULL);
|
||||
|
||||
self = g_slice_new (MuMsgContact);
|
||||
|
||||
self->name = g_strdup (name);
|
||||
self->address = g_strdup (address);
|
||||
self->type = type;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mu_msg_contact_destroy (MuMsgContact *self)
|
||||
{
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
g_free ((void*)self->name);
|
||||
g_free ((void*)self->address);
|
||||
g_slice_free (MuMsgContact, self);
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
fill_contact (MuMsgContact *self, InternetAddress *addr,
|
||||
MuMsgContactType ctype)
|
||||
@ -620,6 +586,11 @@ fill_contact (MuMsgContact *self, InternetAddress *addr,
|
||||
else
|
||||
self->address = NULL;
|
||||
|
||||
/* if there's no address, just a name, it's probably a local
|
||||
* address (without @) */
|
||||
if (self->name && !self->address)
|
||||
self->address = self->name;
|
||||
|
||||
/* note, the address could NULL e.g. when the recipient is something like
|
||||
* 'Undisclosed recipients'
|
||||
*/
|
||||
|
||||
22
lib/mu-msg.h
22
lib/mu-msg.h
@ -511,28 +511,6 @@ struct _MuMsgContact {
|
||||
};
|
||||
typedef struct _MuMsgContact MuMsgContact;
|
||||
|
||||
/**
|
||||
* create a new MuMsgContact object; note, in many case, this is not
|
||||
* needed, any a stack-allocated struct can be uses.
|
||||
*
|
||||
* @param name the name of the contact
|
||||
* @param address the e-mail address of the contact
|
||||
* @param type the type of contact: cc, bcc, from, to
|
||||
*
|
||||
* @return a newly allocated MuMsgConcact or NULL in case of
|
||||
* error. use mu_msg_contact_destroy to destroy it when it's no longer
|
||||
* needed.
|
||||
*/
|
||||
MuMsgContact *mu_msg_contact_new (const char *name, const char *address,
|
||||
MuMsgContactType type)
|
||||
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* destroy a MuMsgConcact object
|
||||
*
|
||||
* @param contact a contact object, or NULL
|
||||
*/
|
||||
void mu_msg_contact_destroy (MuMsgContact *contact);
|
||||
|
||||
/**
|
||||
* macro to get the name of a contact
|
||||
|
||||
Reference in New Issue
Block a user