* mu-msg-contact: check for type of internetaddress (fixes some warning) +
small cleanups
This commit is contained in:
@ -39,14 +39,17 @@ fill_contact (MuMsgContact *contact, InternetAddress *addr,
|
|||||||
if (!addr)
|
if (!addr)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
contact->name = (char*)internet_address_get_name (addr);
|
contact->name = internet_address_get_name (addr);
|
||||||
contact->type = ctype;
|
contact->type = ctype;
|
||||||
|
|
||||||
/* we only support internet addresses;
|
/* we only support internet mailbox addresses; if we don't
|
||||||
* if we don't check, g_mime hits an assert
|
* check, g_mime hits an assert
|
||||||
*/
|
*/
|
||||||
contact->address = (char*)internet_address_mailbox_get_addr
|
if (INTERNET_ADDRESS_IS_MAILBOX(addr)) {
|
||||||
(INTERNET_ADDRESS_MAILBOX(addr));
|
contact->address = internet_address_mailbox_get_addr
|
||||||
|
(INTERNET_ADDRESS_MAILBOX(addr));
|
||||||
|
} else
|
||||||
|
contact->address = NULL;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,11 +35,11 @@ typedef enum _MuMsgContactType MuMsgContactType;
|
|||||||
|
|
||||||
|
|
||||||
struct _MuMsgContact {
|
struct _MuMsgContact {
|
||||||
char *name; /* Foo Bar */
|
const char *name; /* Foo Bar */
|
||||||
char *address; /* foo@bar.cuux */
|
const char *address; /* foo@bar.cuux */
|
||||||
MuMsgContactType type; /*MU_MSG_CONTACT_TYPE_{TO,CC,BCC,FROM}*/
|
MuMsgContactType type; /*MU_MSG_CONTACT_TYPE_{TO,CC,BCC,FROM}*/
|
||||||
};
|
};
|
||||||
typedef struct _MuMsgContact MuMsgContact;
|
typedef struct _MuMsgContact MuMsgContact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* macro to get the name of a contact
|
* macro to get the name of a contact
|
||||||
|
|||||||
Reference in New Issue
Block a user