3 Commits

Author SHA1 Message Date
ef0cbe9a59 Rename the project
It is about to see some extensions, obsoleting the number three.
2022-08-07 10:40:42 +02:00
2d8808d795 utm-filter.lua: mention the passing of fbclid 2022-07-18 17:59:28 +02:00
60d52ad479 xC, xD: add basic WALLOPS support 2022-02-04 22:48:54 +01:00
10 changed files with 81 additions and 37 deletions

12
.gitignore vendored
View File

@@ -3,9 +3,9 @@
# Qt Creator files # Qt Creator files
/CMakeLists.txt.user* /CMakeLists.txt.user*
/uirc3.config /xK.config
/uirc3.files /xK.files
/uirc3.creator* /xK.creator*
/uirc3.includes /xK.includes
/uirc3.cflags /xK.cflags
/uirc3.cxxflags /xK.cxxflags

View File

@@ -1,6 +1,6 @@
# Ubuntu 18.04 LTS and OpenBSD 6.4 # Ubuntu 18.04 LTS and OpenBSD 6.4
cmake_minimum_required (VERSION 3.10) cmake_minimum_required (VERSION 3.10)
project (uirc3 VERSION 1.5.0 LANGUAGES C) project (xK VERSION 1.5.0 DESCRIPTION "IRC client, daemon and bot" LANGUAGES C)
# Options # Options
option (WANT_READLINE "Use GNU Readline for the UI (better)" ON) option (WANT_READLINE "Use GNU Readline for the UI (better)" ON)
@@ -229,7 +229,6 @@ foreach (page ${project_MAN_PAGES})
endforeach () endforeach ()
# CPack # CPack
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Unreasonable 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>")

7
NEWS
View File

@@ -1,3 +1,10 @@
Unreleased
* xC: made it show WALLOPS messages, as PRIVMSG for the server buffer
* xD: implemented WALLOPS, choosing to make it target even non-operators
1.5.0 (2021-12-21) "The Show Must Go On" 1.5.0 (2021-12-21) "The Show Must Go On"
* xC: made it possible to pass the cursor position to external editors, * xC: made it possible to pass the cursor position to external editors,

View File

@@ -1,11 +1,11 @@
uirc3 xK
===== ==
The unreasonable IRC trinity. This project consists of an IRC client, daemon, 'xK' (chat kit) is an IRC software suite consisting of a terminal client,
and bot. It's all you're ever going to need for chatting, as long as you can daemon, and bot. It's all you're ever going to need for chatting,
make do with minimalist software. so long as you can make do with slightly minimalist software.
They have these potentially interesting properties: They come with these potentially interesting properties:
- supporting IRCv3, SOCKS, IPv6, TLS (including client certificates) - supporting IRCv3, SOCKS, IPv6, TLS (including client certificates)
- lean on dependencies - lean on dependencies
@@ -14,18 +14,18 @@ They have these potentially interesting properties:
xC xC
-- --
The IRC client. It is largely defined by being built on top of GNU Readline The IRC client, and the core of 'xK'. It is largely defined by being built
that has been hacked to death. Its interface should feel somewhat familiar for on top of GNU Readline that has been hacked to death. Its interface should feel
weechat or irssi users. somewhat familiar for weechat or irssi users.
image::xC.png[align="center"] image::xC.png[align="center"]
This is the core of the project. It has most of the stuff you'd expect of It has most of the stuff you'd expect of an IRC client, such as being
an IRC client, such as being multiserver, a powerful configuration system, multiserver, a powerful configuration system, integrated help, text formatting,
integrated help, text formatting, automatic splitting of overlong messages, automatic splitting of overlong messages, multiline editing, bracketed paste
multiline editing, bracketed paste support, decent word wrapping, autocomplete, support, decent word wrapping, autocomplete, logging, CTCP queries, auto-away,
logging, CTCP queries, auto-away, command aliases, and basic support for Lua command aliases, and basic support for Lua scripting. As a unique bonus,
scripting. As a unique bonus, you can launch a full text editor from within. you can launch a full text editor from within.
xD xD
-- --
@@ -79,9 +79,9 @@ Additionally for 'xC': curses, libffi, lua >= 5.3 (optional),
Avoid libedit if you can, in general it works but at the moment history is Avoid libedit if you can, in general it works but at the moment history is
acting up and I have no clue about fixing it. acting up and I have no clue about fixing it.
$ git clone --recursive https://git.janouch.name/p/uirc3.git $ git clone --recursive https://git.janouch.name/p/xK.git
$ mkdir uirc3/build $ mkdir xK/build
$ cd uirc3/build $ cd xK/build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo \ $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWANT_READLINE=ON -DWANT_LIBEDIT=OFF -DWANT_LUA=ON -DWANT_READLINE=ON -DWANT_LIBEDIT=OFF -DWANT_LUA=ON
$ make $ make
@@ -93,7 +93,7 @@ To install the application, you can do either the usual:
Or you can try telling CMake to make a package for you: Or you can try telling CMake to make a package for you:
$ cpack -G DEB # also supported: RPM, FreeBSD $ cpack -G DEB # also supported: RPM, FreeBSD
# dpkg -i uirc3-*.deb # dpkg -i xK-*.deb
Usage Usage
----- -----
@@ -179,7 +179,7 @@ configurations accordingly, but I consider it rather messy and unnecessary.
Contributing and Support Contributing and Support
------------------------ ------------------------
Use https://git.janouch.name/p/uirc3 to report any bugs, request features, Use https://git.janouch.name/p/xK to report any bugs, request features,
or submit pull requests. `git send-email` is tolerated. If you want to discuss or submit pull requests. `git send-email` is tolerated. If you want to discuss
the project, feel free to join me at ircs://irc.janouch.name, channel #dev. the project, feel free to join me at ircs://irc.janouch.name, channel #dev.

View File

@@ -18,6 +18,9 @@
-- A list of useless URL parameters that don't affect page function -- A list of useless URL parameters that don't affect page function
local banned = { local banned = {
gclid = 1, gclid = 1,
-- Alas, Facebook no longer uses this parameter, see:
-- https://news.ycombinator.com/item?id=32117489
fbclid = 1, fbclid = 1,
utm_source = 1, utm_source = 1,

View File

@@ -1,8 +1,8 @@
xB(1) xB(1)
===== =====
:doctype: manpage :doctype: manpage
:manmanual: uirc3 Manual :manmanual: xK Manual
:mansource: uirc3 {release-version} :mansource: xK {release-version}
Name Name
---- ----
@@ -100,5 +100,5 @@ _/usr/share/xB/plugins/_::
Reporting bugs Reporting bugs
-------------- --------------
Use https://git.janouch.name/p/uirc3 to report bugs, request features, Use https://git.janouch.name/p/xK to report bugs, request features,
or submit pull requests. or submit pull requests.

View File

@@ -1,8 +1,8 @@
xC(1) xC(1)
===== =====
:doctype: manpage :doctype: manpage
:manmanual: uirc3 Manual :manmanual: xK Manual
:mansource: uirc3 {release-version} :mansource: xK {release-version}
Name Name
---- ----
@@ -119,7 +119,7 @@ to work but exhibits bugs that are not our fault.
Reporting bugs Reporting bugs
-------------- --------------
Use https://git.janouch.name/p/uirc3 to report bugs, request features, Use https://git.janouch.name/p/xK to report bugs, request features,
or submit pull requests. or submit pull requests.
See also See also

11
xC.c
View File

@@ -7488,6 +7488,16 @@ irc_handle_topic (struct server *s, const struct irc_message *msg)
} }
} }
static void
irc_handle_wallops (struct server *s, const struct irc_message *msg)
{
if (!msg->prefix || msg->params.len < 1)
return;
const char *message = msg->params.vector[0];
log_server (s, s->buffer, 0, "<#n> #m", msg->prefix, message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static struct irc_handler g_irc_handlers[] = static struct irc_handler g_irc_handlers[] =
@@ -7511,6 +7521,7 @@ static struct irc_handler g_irc_handlers[] =
{ "QUIT", irc_handle_quit }, { "QUIT", irc_handle_quit },
{ "TAGMSG", irc_handle_tagmsg }, { "TAGMSG", irc_handle_tagmsg },
{ "TOPIC", irc_handle_topic }, { "TOPIC", irc_handle_topic },
{ "WALLOPS", irc_handle_wallops },
}; };
static bool static bool

View File

@@ -1,8 +1,8 @@
xD(1) xD(1)
===== =====
:doctype: manpage :doctype: manpage
:manmanual: uirc3 Manual :manmanual: xK Manual
:mansource: uirc3 {release-version} :mansource: xK {release-version}
Name Name
---- ----
@@ -49,5 +49,5 @@ _/etc/xdg/xD/xD.conf_::
Reporting bugs Reporting bugs
-------------- --------------
Use https://git.janouch.name/p/uirc3 to report bugs, request features, Use https://git.janouch.name/p/xK to report bugs, request features,
or submit pull requests. or submit pull requests.

24
xD.c
View File

@@ -2932,6 +2932,29 @@ irc_handle_links (const struct irc_message *msg, struct client *c)
irc_send_reply (c, IRC_RPL_ENDOFLINKS, mask); irc_send_reply (c, IRC_RPL_ENDOFLINKS, mask);
} }
static void
irc_handle_wallops (const struct irc_message *msg, struct client *c)
{
if (msg->params.len < 1)
RETURN_WITH_REPLY (c, IRC_ERR_NEEDMOREPARAMS, msg->command);
if (!(c->mode & IRC_USER_MODE_OPERATOR))
RETURN_WITH_REPLY (c, IRC_ERR_NOPRIVILEGES);
const char *message = msg->params.vector[0];
// Our interpretation: anonymize the sender,
// and target all users who want to receive these messages
struct str_map_iter iter = str_map_iter_make (&c->ctx->users);
struct client *target;
while ((target = str_map_iter_next (&iter)))
{
if (target != c && !(target->mode & IRC_USER_MODE_RX_WALLOPS))
continue;
client_send (target, ":%s WALLOPS :%s", c->ctx->server_name, message);
}
}
static void static void
irc_handle_kill (const struct irc_message *msg, struct client *c) irc_handle_kill (const struct irc_message *msg, struct client *c)
{ {
@@ -2994,6 +3017,7 @@ irc_register_handlers (struct server_context *ctx)
{ "ADMIN", true, irc_handle_admin, 0, 0 }, { "ADMIN", true, irc_handle_admin, 0, 0 },
{ "STATS", true, irc_handle_stats, 0, 0 }, { "STATS", true, irc_handle_stats, 0, 0 },
{ "LINKS", true, irc_handle_links, 0, 0 }, { "LINKS", true, irc_handle_links, 0, 0 },
{ "WALLOPS", true, irc_handle_wallops, 0, 0 },
{ "MODE", true, irc_handle_mode, 0, 0 }, { "MODE", true, irc_handle_mode, 0, 0 },
{ "PRIVMSG", true, irc_handle_privmsg, 0, 0 }, { "PRIVMSG", true, irc_handle_privmsg, 0, 0 },