* Added support to better handle online/offline status
[modest] / src / modest-text-utils.c
index 0900a69..4262066 100644 (file)
@@ -198,8 +198,10 @@ modest_text_utils_derived_subject (const gchar *subject, const gchar *prefix)
 {
        gchar *tmp;
 
+       g_return_val_if_fail (prefix, NULL);
+       
        if (!subject)
-               return g_strdup_printf ("%s ", prefix);
+               return g_strdup (prefix);
 
        tmp = g_strchug (g_strdup (subject));
 
@@ -233,9 +235,9 @@ modest_text_utils_remove_address (const gchar *address_list, const gchar *addres
                /* Add to list if not found */
                if (!strstr ((const char *) token, (const char *) address)) {
                        if (filtered_emails->len == 0)
-                               g_string_append_printf (filtered_emails, "%s", token);
+                               g_string_append_printf (filtered_emails, "%s", g_strstrip (token));
                        else
-                               g_string_append_printf (filtered_emails, ",%s", token);
+                               g_string_append_printf (filtered_emails, ",%s", g_strstrip (token));
                }
                token = strtok_r (NULL, ",", &ptr);
        }