eliminate_parenthesis(str, '(', ')');
g_strstrip(str);
- srcp = str + subject_get_reply_prefix_length(str);
+ srcp = str + subject_get_prefix_length(str);
if (srcp != str)
memmove(str, srcp, strlen(srcp) + 1);
}
g_strstrip(str);
- srcp = str + subject_get_reply_prefix_length(str);
+ srcp = str + subject_get_prefix_length(str);
if (srcp != str)
memmove(str, srcp, strlen(srcp) + 1);
}
gchar op, cl;
gint in_brace;
- destp = str + subject_get_reply_prefix_length(str);
+ destp = str + subject_get_prefix_length(str);
if (*destp == '[') {
op = '[';
if (subject == NULL)
subject = "";
else
- subject += subject_get_reply_prefix_length(subject);
+ subject += subject_get_prefix_length(subject);
return g_hash_table_lookup(subject_table, subject);
}
{
if (subject == NULL || *subject == 0)
return;
- subject += subject_get_reply_prefix_length(subject);
+ subject += subject_get_prefix_length(subject);
g_hash_table_insert(subject_table, subject, data);
}
if (subject == NULL)
return;
- subject += subject_get_reply_prefix_length(subject);
+ subject += subject_get_prefix_length(subject);
g_hash_table_remove(subject_table, subject);
}
/*!
*\brief Check if a string is prefixed with known (combinations)
- * of reply prefixes. The function assumes that each prefix
+ * of prefixes. The function assumes that each prefix
* is terminated by zero or exactly _one_ space.
*
*\param str String to check for a prefixes
* for a "clean" subject line. If no prefix was found, 0
* is returned.
*/
-int subject_get_reply_prefix_length(const gchar *subject)
+int subject_get_prefix_length(const gchar *subject)
{
/*!< Array with allowable reply prefixes regexps. */
- static const gchar * const reply_prefixes[] = {
+ static const gchar * const prefixes[] = {
"Re\\:", /* "Re:" */
"Re\\[[1-9][0-9]*\\]\\:", /* "Re[XXX]:" (non-conforming news mail clients) */
"Antw\\:", /* "Antw:" (Dutch / German Outlook) */
"Aw\\:", /* "Aw:" (German) */
"Antwort\\:", /* "Antwort:" (German Lotus Notes) */
"Res\\:", /* "Res:" (Brazilian Outlook) */
- "Fw\\:" /* "Fw:" Forward */
+ "Fw\\:", /* "Fw:" Forward */
+ "Enc\\:" /* "Enc:" Forward (Brazilian Outlook) */
/* add more */
};
- const int REPLY_PREFIXES = sizeof reply_prefixes / sizeof reply_prefixes[0];
+ const int PREFIXES = sizeof prefixes / sizeof prefixes[0];
int n;
regmatch_t pos;
static regex_t regex;
if (!init_) {
GString *s = g_string_new("");
- for (n = 0; n < REPLY_PREFIXES; n++)
+ for (n = 0; n < PREFIXES; n++)
/* Terminate each prefix regexpression by a
* "\ ?" (zero or ONE space), and OR them */
g_string_sprintfa(s, "(%s\\ ?)%s",
- reply_prefixes[n],
- n < REPLY_PREFIXES - 1 ?
+ prefixes[n],
+ n < PREFIXES - 1 ?
"|" : "");
g_string_prepend(s, "(");
gchar *buf, *buf2, *p;
buf = p = g_strdup(msginfo->subject);
- p += subject_get_reply_prefix_length(p);
+ p += subject_get_prefix_length(p);
memmove(buf, p, strlen(p) + 1);
buf2 = g_strdup_printf("Fw: %s", buf);
gchar *buf, *buf2, *p;
buf = p = g_strdup(msginfo->subject);
- p += subject_get_reply_prefix_length(p);
+ p += subject_get_prefix_length(p);
memmove(buf, p, strlen(p) + 1);
buf2 = g_strdup_printf("Re: %s", buf);
GNode *found_subject = NULL;
subject = msginfo->subject;
- subject += subject_get_reply_prefix_length(subject);
+ subject += subject_get_prefix_length(subject);
found_subject = subject_table_lookup_clean
(subject_table, (gchar *) subject);
for (node = last; node && node != NULL;) {
next = node->prev;
msginfo = (MsgInfo *) node->data;
- subject = msginfo->subject + subject_get_reply_prefix_length(msginfo->subject);
+ subject = msginfo->subject + subject_get_prefix_length(msginfo->subject);
/* may not parentize if parent was delivered after childs */
if (subject != msginfo->subject)