jcs
/wallops
/amendments
/111
irc: Add support for /say
jcs made amendment 111 2 months ago
--- irc.c Mon Sep 16 10:15:57 2024
+++ irc.c Mon Sep 16 16:51:26 2024
@@ -1038,11 +1038,17 @@ irc_process_input(struct irc_connection *conn, struct
{
char *arg0, *arg1, *channel_name;
size_t n;
+ bool say = false;
if (conn == NULL || conn->state < IRC_STATE_CONNECTED)
goto not_connected;
-
- if (str[0] != '/') {
+
+ if (strncasecmp(str, "/say ", 5) == 0) {
+ say = true;
+ strsep(&str, " ");
+ }
+
+ if (say || str[0] != '/') {
if (channel != NULL) {
irc_printf(conn, "PRIVMSG %s :%s\r\n", channel->name, str);
chatter_printf(conn->chatter, conn, channel->name,
@@ -1063,7 +1069,7 @@ irc_process_input(struct irc_connection *conn, struct
arg0 = strsep(&str, " ");
- /* special case: send as-is */
+ /* special cases: send as-is */
if (strcasecmp(arg0, "quote") == 0 || strcasecmp(arg0, "raw") == 0) {
if (conn == NULL)
goto not_connected;
--- README Thu Sep 12 08:57:33 2024
+++ README Mon Sep 16 16:55:40 2024
@@ -17,6 +17,7 @@ See http://jcs.org/wallops for more information and ve
will show the window and cancel the alert.
- Supports selective ignoring of certain channel events such as joins,
parts/quits, and nick changes.
+- Supports tab completion of nicks at the beginning of messages to a channel
- Implements the following commands, though any unsupported commands
can be sent to the server with "/quote <raw command>":
@@ -35,6 +36,7 @@ See http://jcs.org/wallops for more information and ve
/query - open a new query tab with a user
/quit - disconnect and quit the program
/quote - send a raw string to the server
+ /say - send a message to the channel or query that starts with /
/topic - show the current channel topic or set a new one
/umode - change user mode
/voice - grant voice privileges to given users