Skip to content

Commit

Permalink
WIP: slashguard fix
Browse files Browse the repository at this point in the history
* Need more time to investigate the callback stuff.
* Need to check whether we need the slashguard check in two locations or
  not. If we do put it into a func.

Fix #1955
  • Loading branch information
jubalh committed Feb 17, 2024
1 parent 569e37f commit 008a04c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ui/inputwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,19 @@ _inp_callback(GIOChannel* source, GIOCondition condition, gpointer data)
ui_reset_idle_time();

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");
free(inp_line);
inp_line = NULL;
return TRUE;
}
}
}

ProfWin* window = wins_get_current();

if (!cmd_process_input(window, inp_line))
Expand Down

0 comments on commit 008a04c

Please sign in to comment.