merge/upstream-full #105

Manually merged
jabber.developer merged 407 commits from merge/upstream-full into master 2026-05-26 17:54:34 +00:00
208 changed files with 4217 additions and 26621 deletions
Showing only changes of commit 40aafd06e7 - Show all commits

View File

@@ -170,6 +170,25 @@ create_input_window(void)
_inp_win_update_virtual();
}
static gboolean
_inp_slashguard_check(void)
{
if (get_password)
return false;
/* ignore empty and quoted messages */
if (inp_line == NULL || inp_line[0] == '\0' || inp_line[0] == '>')
return false;
if (!prefs_get_boolean(PREF_SLASH_GUARD))
return false;
if (memchr(inp_line + 1, '/', 3)) {
cons_show("Your text contains a slash in the first 4 characters");
free(inp_line);
inp_line = NULL;
return true;
}
return false;
}
char*
inp_readline(void)
{
@@ -203,17 +222,7 @@ inp_readline(void)
chat_state_idle();
}
if (inp_line) {
if (!get_password && prefs_get_boolean(PREF_SLASH_GUARD)) {
// ignore quoted messages
if (strlen(inp_line) > 1 && inp_line[0] != '>') {
char* res = (char*)memchr(inp_line + 1, '/', 3);
if (res) {
cons_show("Your text contains a slash in the first 4 characters");
return NULL;
}
}
}
if (inp_line && !_inp_slashguard_check()) {
char* ret = inp_line;
inp_line = NULL;
return ret;