"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/camel/camel-internet-address.c" between
evolution-data-server-3.32.4.tar.xz and evolution-data-server-3.34.0.tar.xz

About: Evolution-Data-Server manages access to the calendar, tasks and addressbook information available for Evolution and other applications.

camel-internet-address.c  (evolution-data-server-3.32.4.tar.xz):camel-internet-address.c  (evolution-data-server-3.34.0.tar.xz)
skipping to change at line 86 skipping to change at line 86
return camel_address_length (addr) - count; return camel_address_length (addr) - count;
} }
static gchar * static gchar *
internet_address_encode (CamelAddress *paddr) internet_address_encode (CamelAddress *paddr)
{ {
CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr); CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr);
gint i; gint i;
GString *out; GString *out;
gchar *ret;
gint len = 6; /* "From: ", assume longer of the address headers */ gint len = 6; /* "From: ", assume longer of the address headers */
if (inet_addr->priv->addresses->len == 0) if (inet_addr->priv->addresses->len == 0)
return NULL; return NULL;
out = g_string_new (""); out = g_string_new ("");
for (i = 0; i < inet_addr->priv->addresses->len; i++) { for (i = 0; i < inet_addr->priv->addresses->len; i++) {
struct _address *addr = g_ptr_array_index (inet_addr->priv->addre sses, i); struct _address *addr = g_ptr_array_index (inet_addr->priv->addre sses, i);
gchar *enc; gchar *enc;
if (i != 0) if (i != 0)
g_string_append (out, ", "); g_string_append (out, ", ");
enc = camel_internet_address_encode_address (&len, addr->name, ad dr->address); enc = camel_internet_address_encode_address (&len, addr->name, ad dr->address);
g_string_append (out, enc); g_string_append (out, enc);
g_free (enc); g_free (enc);
} }
ret = out->str; return g_string_free (out, FALSE);
g_string_free (out, FALSE);
return ret;
} }
static gint static gint
internet_address_unformat (CamelAddress *paddr, internet_address_unformat (CamelAddress *paddr,
const gchar *raw) const gchar *raw)
{ {
CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr); CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr);
gchar *buffer, *p, *name, *addr; gchar *buffer, *p, *name, *addr;
gint c; gint c;
gint count = inet_addr->priv->addresses->len; gint count = inet_addr->priv->addresses->len;
skipping to change at line 186 skipping to change at line 182
return inet_addr->priv->addresses->len - count; return inet_addr->priv->addresses->len - count;
} }
static gchar * static gchar *
internet_address_format (CamelAddress *paddr) internet_address_format (CamelAddress *paddr)
{ {
CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr); CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr);
gint i; gint i;
GString *out; GString *out;
gchar *ret;
if (inet_addr->priv->addresses->len == 0) if (inet_addr->priv->addresses->len == 0)
return NULL; return NULL;
out = g_string_new (""); out = g_string_new ("");
for (i = 0; i < inet_addr->priv->addresses->len; i++) { for (i = 0; i < inet_addr->priv->addresses->len; i++) {
struct _address *addr = g_ptr_array_index (inet_addr->priv->addre sses, i); struct _address *addr = g_ptr_array_index (inet_addr->priv->addre sses, i);
gchar *enc; gchar *enc;
if (i != 0) if (i != 0)
g_string_append (out, ", "); g_string_append (out, ", ");
enc = camel_internet_address_format_address (addr->name, addr->ad dress); enc = camel_internet_address_format_address (addr->name, addr->ad dress);
g_string_append (out, enc); g_string_append (out, enc);
g_free (enc); g_free (enc);
} }
ret = out->str; return g_string_free (out, FALSE);
g_string_free (out, FALSE);
return ret;
} }
static void static void
internet_address_remove (CamelAddress *paddr, internet_address_remove (CamelAddress *paddr,
gint index) gint index)
{ {
CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr); CamelInternetAddress *inet_addr = CAMEL_INTERNET_ADDRESS (paddr);
struct _address *addr; struct _address *addr;
if (index < 0 || index >= inet_addr->priv->addresses->len) if (index < 0 || index >= inet_addr->priv->addresses->len)
skipping to change at line 569 skipping to change at line 561
* Note: The value at *@in will be updated based on any linewrapping done * Note: The value at *@in will be updated based on any linewrapping done
* *
* Returns: the encoded address * Returns: the encoded address
**/ **/
gchar * gchar *
camel_internet_address_encode_address (gint *inlen, camel_internet_address_encode_address (gint *inlen,
const gchar *real, const gchar *real,
const gchar *addr) const gchar *addr)
{ {
gchar *name; gchar *name;
gchar *ret = NULL;
gint len = 0; gint len = 0;
GString *out; GString *out;
g_return_val_if_fail (addr, NULL); g_return_val_if_fail (addr, NULL);
name = camel_header_encode_phrase ((const guchar *) real); name = camel_header_encode_phrase ((const guchar *) real);
out = g_string_new (""); out = g_string_new ("");
if (inlen != NULL) if (inlen != NULL)
len = *inlen; len = *inlen;
skipping to change at line 614 skipping to change at line 605
g_string_append (out, "\n\t"); g_string_append (out, "\n\t");
len = 1; len = 1;
} }
len -= out->len; len -= out->len;
if (name && name[0]) if (name && name[0])
g_string_append (out, " <"); g_string_append (out, " <");
cia_encode_addrspec (out, addr); cia_encode_addrspec (out, addr);
if (name && name[0]) if (name && name[0])
g_string_append (out, ">"); g_string_append_c (out, '>');
len += out->len; len += out->len;
if (inlen != NULL) if (inlen != NULL)
*inlen = len; *inlen = len;
g_free (name); g_free (name);
ret = out->str; return g_string_free (out, FALSE);
g_string_free (out, FALSE);
return ret;
} }
/** /**
* camel_internet_address_format_address: * camel_internet_address_format_address:
* @name: a name, quotes may be stripped from it * @name: a name, quotes may be stripped from it
* @addr: an rfc822 routing address * @addr: an rfc822 routing address
* *
* Function to format a single address, suitable for display. * Function to format a single address, suitable for display.
* *
* Returns: a nicely formatted string containing the rfc822 address * Returns: a nicely formatted string containing the rfc822 address
 End of changes. 7 change blocks. 
16 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)