X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-text-utils.c;h=5906bb7de158bb02b940c971f4bb51d2ae80acd4;hp=01e70d3a59b1f438c1b293385c7fff676f1755b2;hb=33b5d84fbaaf8dd4eafe4176dba08213c046463f;hpb=28d516b84dd03478afd76befe3529c8cb0d85045 diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index 01e70d3..5906bb7 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -653,6 +653,30 @@ modest_text_utils_address_range_at_position (const gchar *recipients_list, *end = range_end; } +gchar * +modest_text_utils_address_with_standard_length (const gchar *recipients_list) +{ + gchar ** splitted; + gchar ** current; + GString *buffer = g_string_new (""); + + splitted = g_strsplit (recipients_list, "\n", 0); + current = splitted; + while (*current) { + gchar *line; + if (current != splitted) + buffer = g_string_append_c (buffer, '\n'); + line = g_strndup (*splitted, 1000); + buffer = g_string_append (buffer, line); + g_free (line); + current++; + } + + g_strfreev (splitted); + + return g_string_free (buffer, FALSE); +} + /* ******************************************************************* */ /* ************************* UTILIY FUNCTIONS ************************ */