summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorSebastian Thorarensen <sebth@naju.se>2014-10-11 18:47:39 +0200
committerSebastian Thorarensen <sebth@naju.se>2014-10-19 17:03:20 +0200
commitf81a54b937b16ebabc05a01d3053a49b3341ac8c (patch)
treeb89ee9fe7577e08ca40fef26204c862d20425015 /src/irc
parent31ee20e559bea19ed77376c4758e44c457eb9fb4 (diff)
downloadirssi-f81a54b937b16ebabc05a01d3053a49b3341ac8c.zip
Try to split long lines on spaces
Try to split long lines on spaces to avoid words being splitted. This can be turned off with the option `split_line_on_space'. The code assumes that the terminal encoding has ASCII spaces.
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-servers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c
index 27878989..baf8a0d2 100644
--- a/src/irc/core/irc-servers.c
+++ b/src/irc/core/irc-servers.c
@@ -85,6 +85,7 @@ static char **split_line(const SERVER_REC *server, const char *line,
{
const char *start = settings_get_str("split_line_start");
const char *end = settings_get_str("split_line_end");
+ gboolean onspace = settings_get_bool("split_line_on_space");
char *recoded_start = recode_out(server, start, target);
char *recoded_end = recode_out(server, end, target);
char **lines;
@@ -103,7 +104,7 @@ static char **split_line(const SERVER_REC *server, const char *line,
return NULL;
}
- lines = recode_split(server, line, target, len);
+ lines = recode_split(server, line, target, len, onspace);
for (i = 0; lines[i] != NULL; i++) {
if (i != 0 && *start != '\0') {
/* Not the first line. */
@@ -972,6 +973,7 @@ void irc_servers_init(void)
settings_add_str("misc", "usermode", DEFAULT_USER_MODE);
settings_add_str("misc", "split_line_start", "");
settings_add_str("misc", "split_line_end", "");
+ settings_add_bool("misc", "split_line_on_space", TRUE);
settings_add_time("flood", "cmd_queue_speed", DEFAULT_CMD_QUEUE_SPEED);
settings_add_int("flood", "cmds_max_at_once", DEFAULT_CMDS_MAX_AT_ONCE);