(account_signatures_* -> account_sigsep_*).
return FALSE;
}
-static GSList *account_signatures_list = NULL;
+static GSList *account_sigsep_list = NULL;
/* create a list of unique signatures from accounts list */
-void account_signatures_matchlist_create(void)
+void account_sigsep_matchlist_create(void)
{
GList *cur_ac = NULL;
PrefsAccount *ac_prefs = NULL;
- if (account_signatures_list)
+ if (account_sigsep_list)
return;
- account_signatures_list = g_slist_prepend(account_signatures_list, g_strdup("-- "));
+ account_sigsep_list = g_slist_prepend(account_sigsep_list, g_strdup("-- "));
for (cur_ac = account_get_list();
cur_ac != NULL;
cur_ac = g_list_next(cur_ac)) {
ac_prefs = (PrefsAccount *)cur_ac->data;
if (ac_prefs->sig_sep && *ac_prefs->sig_sep != '\0') {
- if (!g_slist_find_custom(account_signatures_list, ac_prefs->sig_sep,
+ if (!g_slist_find_custom(account_sigsep_list, ac_prefs->sig_sep,
(GCompareFunc)g_strcmp0)) {
- account_signatures_list = g_slist_prepend(account_signatures_list,
+ account_sigsep_list = g_slist_prepend(account_sigsep_list,
g_strdup(ac_prefs->sig_sep));
}
}
}
}
-/* delete the list of signatures created by account_signatures_matchlist_create() */
-void account_signatures_matchlist_delete(void)
+/* delete the list of signatures created by account_sigsep_matchlist_create() */
+void account_sigsep_matchlist_delete(void)
{
- if (account_signatures_list) {
- slist_free_strings_full(account_signatures_list);
- account_signatures_list = NULL;
+ if (account_sigsep_list) {
+ slist_free_strings_full(account_sigsep_list);
+ account_sigsep_list = NULL;
}
}
/* match a string against all signatures in list, using the specified format */
-gboolean account_signatures_matchlist_str_found(const gchar *str, const gchar *format)
+gboolean account_sigsep_matchlist_str_found(const gchar *str, const gchar *format)
{
gchar *tmp = NULL;
gboolean found = FALSE;
GSList *item;
- for (item = account_signatures_list;
+ for (item = account_sigsep_list;
item != NULL && !found;
item = g_slist_next(item)) {
tmp = g_strdup_printf(format, (gchar *)item->data);
found = (strcmp(tmp, str) == 0);
g_free(tmp);
} else {
- g_warning("account_signatures_matchlist_str_found: g_strdup_printf failed, check format '%s'",
+ g_warning("account_sigsep_matchlist_str_found: g_strdup_printf failed, check format '%s'",
format);
return FALSE;
}
}
/* match M first char of a string against all signatures in list, using the specified format */
-gboolean account_signatures_matchlist_nchar_found(const gchar *str, const gchar *format)
+gboolean account_sigsep_matchlist_nchar_found(const gchar *str, const gchar *format)
{
gchar *tmp = NULL;
gboolean found = FALSE;
GSList *item;
gint len;
- for (item = account_signatures_list;
+ for (item = account_sigsep_list;
item != NULL && !found;
item = g_slist_next(item)) {
tmp = g_strdup_printf(format, (gchar *)item->data);
found = (strncmp(tmp, str, len) == 0);
g_free(tmp);
} else {
- g_warning("account_signatures_matchlist_nchar_found: g_strdup_printf failed, check format '%s'",
+ g_warning("account_sigsep_matchlist_nchar_found: g_strdup_printf failed, check format '%s'",
format);
return FALSE;
}
guint16 port,
gchar **password);
-void account_signatures_matchlist_create (void);
-void account_signatures_matchlist_delete (void);
-gboolean account_signatures_matchlist_str_found (const gchar *str, const gchar *format);
-gboolean account_signatures_matchlist_nchar_found (const gchar *str, const gchar *format);
+void account_sigsep_matchlist_create (void);
+void account_sigsep_matchlist_delete (void);
+gboolean account_sigsep_matchlist_str_found (const gchar *str, const gchar *format);
+gboolean account_sigsep_matchlist_nchar_found (const gchar *str, const gchar *format);
#endif /* __ACCOUNT_H__ */
gint llen = 0; \
strretchomp(lastline); \
llen = strlen(lastline); \
- if (lastline[llen-1] == ' ' && !account_signatures_matchlist_str_found(lastline, "%s") && \
+ if (lastline[llen-1] == ' ' && !account_sigsep_matchlist_str_found(lastline, "%s") && \
!(llen == 2 && lastline[1] == ' ' && strchr(prefs_common.quote_chars, lastline[0]))) { \
/* this is flowed */ \
if (delsp) \
tmp_file = TRUE;
readend = mimeinfo->offset + mimeinfo->length;
- account_signatures_matchlist_create(); /* FLUSH_LASTLINE will use it */
+ account_sigsep_matchlist_create(); /* FLUSH_LASTLINE will use it */
*buf = '\0';
if (encoding == ENC_QUOTED_PRINTABLE) {
claws_fclose(outfp);
claws_fclose(infp);
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
if (err == TRUE) {
return FALSE;
if (fp == NULL)
g_warning("Can't get text part");
else {
- account_signatures_matchlist_create();
+ account_sigsep_matchlist_create();
while (fgets(buf, sizeof(buf), fp) != NULL) {
strcrchomp(buf);
- if (!signature && account_signatures_matchlist_nchar_found(buf, "%s\n"))
+ if (!signature && account_sigsep_matchlist_nchar_found(buf, "%s\n"))
break;
if (quoted && quote_str)
INSERT(buf);
}
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
fclose(fp);
}
}
procmime_decode_content(mimeinfo);
- account_signatures_matchlist_create();
+ account_sigsep_matchlist_create();
if (!g_ascii_strcasecmp(mimeinfo->subtype, "html") &&
prefs_common.render_html) {
claws_fclose(tmpfp);
waitpid(pid, pfd, 0);
g_unlink(fname);
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
return;
}
}
tmpfp = claws_fopen(mimeinfo->data.filename, "rb");
if (!tmpfp) {
FILE_OP_ERROR(mimeinfo->data.filename, "claws_fopen");
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
return;
}
if (fseek(tmpfp, mimeinfo->offset, SEEK_SET) < 0) {
FILE_OP_ERROR(mimeinfo->data.filename, "fseek");
claws_fclose(tmpfp);
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
return;
}
debug_print("Viewing text content of type: %s (length: %d)\n", mimeinfo->subtype, mimeinfo->length);
textview_write_line(textview, buf, conv, TRUE);
if (textview->stop_loading) {
claws_fclose(tmpfp);
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
return;
}
wrote += ftell(tmpfp)-i;
claws_fclose(tmpfp);
}
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
conv_code_converter_destroy(conv);
procmime_force_encoding(0);
parser = sc_html_parser_new(fp, conv);
cm_return_if_fail(parser != NULL);
- account_signatures_matchlist_create();
+ account_sigsep_matchlist_create();
while ((str = sc_html_parse(parser)) != NULL) {
if (parser->state == SC_HTML_HREF) {
if (lines % 500 == 0)
GTK_EVENTS_FLUSH();
if (textview->stop_loading) {
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
return;
}
}
textview_write_line(textview, "\n", NULL, FALSE);
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
sc_html_parser_destroy(parser);
}
parser = ertf_parser_new(fp, conv);
cm_return_if_fail(parser != NULL);
- account_signatures_matchlist_create();
+ account_sigsep_matchlist_create();
while ((str = ertf_parse(parser)) != NULL) {
textview_write_line(textview, str, NULL, FALSE);
if (lines % 500 == 0)
GTK_EVENTS_FLUSH();
if (textview->stop_loading) {
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
return;
}
}
- account_signatures_matchlist_delete();
+ account_sigsep_matchlist_delete();
ertf_parser_destroy(parser);
}
else if (strncmp(buf, "@@ ", 3) == 0 &&
strcmp(buf+strlen(buf)-4, " @@\n") == 0)
fg_color = "diff-hunk";
- } else if (account_signatures_matchlist_str_found(buf,"%s\n")
- || account_signatures_matchlist_str_found(buf, "- %s\n")
+ } else if (account_sigsep_matchlist_str_found(buf,"%s\n")
+ || account_sigsep_matchlist_str_found(buf, "- %s\n")
|| textview->is_in_signature) {
fg_color = "signature";
textview->is_in_signature = TRUE;