mirror of https://github.com/djcb/mu.git
* mu-str: add simplistic mu_str_subject_normalize (WIP)
This commit is contained in:
parent
b08bf4a1ed
commit
35f7e2cd95
15
src/mu-str.c
15
src/mu-str.c
|
@ -429,6 +429,21 @@ mu_str_free_list (GSList *lst)
|
||||||
g_slist_free (lst);
|
g_slist_free (lst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gchar*
|
||||||
|
mu_str_subject_normalize (const gchar* str)
|
||||||
|
{
|
||||||
|
gchar *last_colon;
|
||||||
|
g_return_val_if_fail (str, NULL);
|
||||||
|
|
||||||
|
/* FIXME: improve this */
|
||||||
|
last_colon = g_strrstr (str, ":");
|
||||||
|
if (!last_colon)
|
||||||
|
return str;
|
||||||
|
else
|
||||||
|
return g_strchug (last_colon + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Xapian treats various characters such as '@', '-', ':' and '.'
|
* Xapian treats various characters such as '@', '-', ':' and '.'
|
||||||
|
|
13
src/mu-str.h
13
src/mu-str.h
|
@ -294,6 +294,19 @@ GSList* mu_str_to_list (const char *str, char sepa);
|
||||||
*/
|
*/
|
||||||
void mu_str_free_list (GSList *lst);
|
void mu_str_free_list (GSList *lst);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* strip the subject of Re:, Fwd: etc.
|
||||||
|
*
|
||||||
|
* @param str a subject string
|
||||||
|
*
|
||||||
|
* @return a new string -- this is pointing somewhere inside the @str;
|
||||||
|
* no copy is made, don't free
|
||||||
|
*/
|
||||||
|
const gchar* mu_str_subject_normalize (const gchar* str);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* guess some nick name for the given name; if we can determine an
|
* guess some nick name for the given name; if we can determine an
|
||||||
* first name, last name, the nick will be first name + the first char
|
* first name, last name, the nick will be first name + the first char
|
||||||
|
|
Loading…
Reference in New Issue