summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-04-02 17:32:47 -0400
committerJune McEnroe <june@causal.agency>2021-04-02 17:32:47 -0400
commitb02569e16e4643e65d73c3eb17deb7e3f529fe50 (patch)
treea5c981ea961d1b5568a6e834b7c3680745a30089
parentAllow interspersing flags and config files (diff)
downloadlitterbox-b02569e16e4643e65d73c3eb17deb7e3f529fe50.tar.gz
litterbox-b02569e16e4643e65d73c3eb17deb7e3f529fe50.zip
Skip STATUSMSG prefixes
This feature is rarely used, so just skip STATUSMSG prefixes in the
target so events use the right context.
-rw-r--r--litterbox.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/litterbox.c b/litterbox.c
index c3bc46e..cd7227b 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -128,6 +128,7 @@ static int searchLimit = 10;
 static char *self;
 static char *network;
 static char *chanTypes;
+static char *statusmsg;
 static char *prefixes;
 static char *prefixModes;
 static char *listModes;
@@ -182,6 +183,8 @@ static void handleReplyISupport(struct Message *msg) {
 			set(&network, msg->params[i]);
 		} else if (!strcmp(key, "CHANTYPES")) {
 			set(&chanTypes, msg->params[i]);
+		} else if (!strcmp(key, "STATUSMSG")) {
+			set(&statusmsg, msg->params[i]);
 		} else if (!strcmp(key, "PREFIX")) {
 			strsep(&msg->params[i], "(");
 			char *modes = strsep(&msg->params[i], ")");
@@ -429,6 +432,7 @@ static void handlePrivmsg(struct Message *msg) {
 
 	bool query = true;
 	const char *context = msg->params[0];
+	if (statusmsg) context += strspn(context, statusmsg);
 	if (strchr(chanTypes, context[0])) query = false;
 	if (!strcmp(context, self)) context = msg->nick;
 
r'>2016-08-17Highlight Search with black foregroundJune McEnroe 2016-08-15Remove gruvboxJune McEnroe 2016-08-04Remove march from SSH configJune McEnroe 2016-08-01Disable tab indicators in iTermJune McEnroe 2016-07-30Color PreProc DarkGreenJune McEnroe 2016-07-29Color Structure and Typedef in grayJune McEnroe 2016-07-27Color comments DarkBlue and LightBlueJune McEnroe 2016-07-27Color macros in yellowJune McEnroe 2016-07-26Colorscheme colors and schemesJune McEnroe 2016-07-26Add ''subtle'' colorschemeJune McEnroe I'm just trying this out. 2016-07-26Add htoprcJune McEnroe 2016-07-24Add may and refactor ssh configJune McEnroe 2016-07-18Disable cursorlineJune McEnroe 2016-07-18Use hard constrast gruvbox darkJune McEnroe 2016-07-15Remove vim configurationJune McEnroe 2016-07-15Add readline to README configurations listJune McEnroe 2016-07-15Add vendor script to READMEJune McEnroe 2016-07-15Pull latest pathogen and gruvboxJune McEnroe