Compare commits

..

No commits in common. "cd7133e1735906d941f5f2ccc2faa083360841d6" and "47a4c8beca44d5c07516418c348d77aba5b554fc" have entirely different histories.

9 changed files with 21 additions and 40 deletions

View File

@ -216,7 +216,7 @@ foreach (page ${project_MAN_PAGES})
endforeach () endforeach ()
# CPack # CPack
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Unethical IRC client, daemon and bot") set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Experimental IRC client, daemon and bot")
set (CPACK_PACKAGE_VERSION "${project_version_safe}") set (CPACK_PACKAGE_VERSION "${project_version_safe}")
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch") set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>") set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")

View File

@ -3,8 +3,8 @@ uirc3
:compact-option: :compact-option:
The [line-through]#unethical# edgy IRC trinity. This project consists of an The [line-through]#unethical# edgy IRC trinity. This project consists of an
IRC client, daemon, and bot. It's all you're ever going to need for chatting, experimental IRC client, daemon, and bot. It's all you're ever going to need
as long as you can make do with minimalist software. for chatting, as long as you can make do with minimalist software.
All of them have these potentially interesting properties: All of them have these potentially interesting properties:
@ -103,7 +103,6 @@ Or you can try telling CMake to make a package for you. For Debian it is:
Usage Usage
----- -----
'degesch' has in-program configuration. Just run it and read the instructions. 'degesch' has in-program configuration. Just run it and read the instructions.
Consult its link:degesch.adoc[man page] for details about the interface.
For the rest you might want to generate a configuration file: For the rest you might want to generate a configuration file:
@ -125,7 +124,7 @@ as a `forking` type systemd user service.
Client Certificates Client Certificates
------------------- -------------------
'kike' uses SHA-1 fingerprints of TLS client certificates to authenticate users. 'kike' uses SHA1 fingerprints of TLS client certificates to authenticate users.
To get the fingerprint from a certificate file in the required form, use: To get the fingerprint from a certificate file in the required form, use:
$ openssl x509 -in public.pem -outform DER | sha1sum $ openssl x509 -in public.pem -outform DER | sha1sum
@ -153,9 +152,9 @@ Beware that you can easily break the program if you're not careful.
How do I make degesch look like the screenshot? How do I make degesch look like the screenshot?
----------------------------------------------- -----------------------------------------------
First of all, you must build it with Lua support. With the defaults, degesch First of all, you must build it with Lua support. With the defaults, degesch
doesn't look too fancy because I don't want to depend on Lua or 256-colour doesn't look very fancy because some things are rather hackish, and I also don't
terminals. In addition to that, I appear to be one of the few people who use want to depend on UTF-8 or 256color terminals in the code. In addition to that,
black on white terminals. I appear to be one of the few people who use black on white terminals.
/set behaviour.date_change_line = "%a %e %b %Y" /set behaviour.date_change_line = "%a %e %b %Y"
/set behaviour.plugin_autoload += "fancy-prompt.lua" /set behaviour.plugin_autoload += "fancy-prompt.lua"

View File

@ -6,7 +6,7 @@ degesch(1)
Name Name
---- ----
degesch - terminal-based IRC client degesch - an experimental IRC client
Synopsis Synopsis
-------- --------

View File

@ -1,5 +1,5 @@
/* /*
* degesch.c: a terminal-based IRC client * degesch.c: the experimental IRC client
* *
* Copyright (c) 2015 - 2020, Přemysl Eric Janouch <p@janouch.name> * Copyright (c) 2015 - 2020, Přemysl Eric Janouch <p@janouch.name>
* *
@ -2458,7 +2458,7 @@ static struct config_schema g_config_behaviour[] =
{ .name = "backlog_helper", { .name = "backlog_helper",
.comment = "Shell command to display a buffer's history", .comment = "Shell command to display a buffer's history",
.type = CONFIG_ITEM_STRING, .type = CONFIG_ITEM_STRING,
.default_ = "\"LESSSECURE=1 less -M -R +Gb\"" }, .default_ = "\"LESSSECURE=1 less -M -R +G\"" },
{ .name = "backlog_helper_strip_formatting", { .name = "backlog_helper_strip_formatting",
.comment = "Strip formatting from backlog helper input", .comment = "Strip formatting from backlog helper input",
.type = CONFIG_ITEM_BOOLEAN, .type = CONFIG_ITEM_BOOLEAN,
@ -4497,7 +4497,6 @@ irc_get_or_make_user_buffer (struct server *s, const char *nickname)
// Open a new buffer for the user // Open a new buffer for the user
buffer = buffer_new (s->ctx->input); buffer = buffer_new (s->ctx->input);
buffer->type = BUFFER_PM; buffer->type = BUFFER_PM;
// FIXME: this probably needs to be converted to UTF-8
buffer->name = xstrdup_printf ("%s.%s", s->name, nickname); buffer->name = xstrdup_printf ("%s.%s", s->name, nickname);
buffer->server = s; buffer->server = s;
buffer->user = user; buffer->user = user;
@ -6029,14 +6028,6 @@ make_prompt (struct app_context *ctx, struct str *output)
static void static void
input_maybe_set_prompt (struct input *self, char *new_prompt) input_maybe_set_prompt (struct input *self, char *new_prompt)
{ {
// Fix libedit's expectations to see a non-control character following
// the end mark (see prompt.c and literal.c) by cleaning this up
for (char *p = new_prompt; *p; )
if (p[0] == INPUT_END_IGNORE && p[1] == INPUT_START_IGNORE)
memmove (p, p + 2, strlen (p + 2) + 1);
else
p++;
// Redisplay can be an expensive operation // Redisplay can be an expensive operation
const char *prompt = CALL (self, get_prompt); const char *prompt = CALL (self, get_prompt);
if (prompt && !strcmp (new_prompt, prompt)) if (prompt && !strcmp (new_prompt, prompt))
@ -6064,12 +6055,6 @@ on_refresh_prompt (struct app_context *ctx)
prompt.str[--prompt.len] = 0; prompt.str[--prompt.len] = 0;
attributed_suffix = " "; attributed_suffix = " ";
} }
// Also enable a uniform interface for prompt hooks by assuming it uses
// GNU Readline escapes: turn this into libedit's almost-flip-flop
for (size_t i = 0; i < prompt.len; i++)
if (prompt.str[i] == '\x01' || prompt.str[i] == '\x02')
prompt.str[i] = INPUT_START_IGNORE /* == INPUT_END_IGNORE */;
#endif // HAVE_EDITLINE #endif // HAVE_EDITLINE
char *localized = iconv_xstrdup (ctx->term_from_utf8, prompt.str, -1, NULL); char *localized = iconv_xstrdup (ctx->term_from_utf8, prompt.str, -1, NULL);
@ -6645,7 +6630,6 @@ irc_handle_join (struct server *s, const struct irc_message *msg)
buffer = buffer_new (s->ctx->input); buffer = buffer_new (s->ctx->input);
buffer->type = BUFFER_CHANNEL; buffer->type = BUFFER_CHANNEL;
// FIXME: this probably needs to be converted to UTF-8
buffer->name = xstrdup_printf ("%s.%s", s->name, channel_name); buffer->name = xstrdup_printf ("%s.%s", s->name, channel_name);
buffer->server = s; buffer->server = s;
buffer->channel = channel = buffer->channel = channel =
@ -6653,7 +6637,6 @@ irc_handle_join (struct server *s, const struct irc_message *msg)
str_map_set (&s->irc_buffer_map, channel->name, buffer); str_map_set (&s->irc_buffer_map, channel->name, buffer);
buffer_add (s->ctx, buffer); buffer_add (s->ctx, buffer);
// XXX: this is annoying, consider only doing it a while after /join
buffer_activate (s->ctx, buffer); buffer_activate (s->ctx, buffer);
} }
@ -14081,7 +14064,7 @@ main (int argc, char *argv[])
}; };
struct opt_handler oh = struct opt_handler oh =
opt_handler_make (argc, argv, opts, NULL, "Terminal-based IRC client."); opt_handler_make (argc, argv, opts, NULL, "Experimental IRC client.");
bool format_mode = false; bool format_mode = false;
int c; int c;

View File

@ -6,7 +6,7 @@ kike(1)
Name Name
---- ----
kike - IRC daemon kike - an experimental IRC daemon
Synopsis Synopsis
-------- --------

4
kike.c
View File

@ -1,5 +1,5 @@
/* /*
* kike.c: an IRC daemon * kike.c: the experimental IRC daemon
* *
* Copyright (c) 2014 - 2020, Přemysl Eric Janouch <p@janouch.name> * Copyright (c) 2014 - 2020, Přemysl Eric Janouch <p@janouch.name>
* *
@ -3991,7 +3991,7 @@ main (int argc, char *argv[])
}; };
struct opt_handler oh = struct opt_handler oh =
opt_handler_make (argc, argv, opts, NULL, "IRC daemon."); opt_handler_make (argc, argv, opts, NULL, "Experimental IRC daemon.");
int c; int c;
while ((c = opt_handler_get (&oh)) != -1) while ((c = opt_handler_get (&oh)) != -1)

View File

@ -64,13 +64,12 @@ degesch.hook_prompt (function (hook)
local lines, cols = degesch.get_screen_size () local lines, cols = degesch.get_screen_size ()
x = x .. " " .. active .. string.rep (" ", cols) x = x .. " " .. active .. string.rep (" ", cols)
-- Readline 7.0.003 seems to be broken and completely corrupts the prompt. -- Readline seems to be broken and completely corrupts the prompt
-- However 8.0.004 seems to be fine with these, as is libedit 20191231-3.1. -- (tested on 7.0.003 Archlinux, 7.0-5 Debian buster)
--x = x:gsub("[\128-\255]", "?") x = x:gsub("[\128-\255]", "?")
-- Cut off extra characters and apply formatting, including the hack. -- Cut off extra characters and apply formatting, including the hack.
-- FIXME: this doesn't count with full-width or zero-width characters. -- Note that this doesn't count with full-width or zero-width characters.
-- We might want to export wcwidth() above term_from_utf8 somehow.
local overflow = utf8.offset (x, cols - 1) local overflow = utf8.offset (x, cols - 1)
if overflow then x = x:sub (1, overflow) end if overflow then x = x:sub (1, overflow) end
x = "\x01\x1b[0;4;1;38;5;16m\x1b[48;5;" .. bg_color .. "m\x02" .. x = "\x01\x1b[0;4;1;38;5;16m\x1b[48;5;" .. bg_color .. "m\x02" ..

View File

@ -6,7 +6,7 @@ zyklonb(1)
Name Name
---- ----
zyklonb - modular IRC bot zyklonb - an experimental IRC bot
Synopsis Synopsis
-------- --------

View File

@ -1,5 +1,5 @@
/* /*
* zyklonb.c: a modular IRC bot * zyklonb.c: the experimental IRC bot
* *
* Copyright (c) 2014 - 2020, Přemysl Eric Janouch <p@janouch.name> * Copyright (c) 2014 - 2020, Přemysl Eric Janouch <p@janouch.name>
* *
@ -1983,7 +1983,7 @@ main (int argc, char *argv[])
}; };
struct opt_handler oh = struct opt_handler oh =
opt_handler_make (argc, argv, opts, NULL, "Modular IRC bot."); opt_handler_make (argc, argv, opts, NULL, "Experimental IRC bot.");
int c; int c;
while ((c = opt_handler_get (&oh)) != -1) while ((c = opt_handler_get (&oh)) != -1)