summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-04-02 17:03:10 -0400
committerJune McEnroe <june@causal.agency>2021-04-02 17:26:43 -0400
commitdf6bc07f44ea3974ba7376d8e3c2b04b0422bf7c (patch)
tree829dee90325abd56524ceaaa59fd68f053ae6d5c /handle.c
parentFix README typo (diff)
downloadcatgirl-df6bc07f44ea3974ba7376d8e3c2b04b0422bf7c.tar.gz
catgirl-df6bc07f44ea3974ba7376d8e3c2b04b0422bf7c.zip
Skip STATUSMSG prefixes
This feature is rarely used, so just skip STATUSMSG prefixes in the
target so messages get routed correctly.
Diffstat (limited to '')
-rw-r--r--handle.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/handle.c b/handle.c
index d889f8e..9f323d1 100644
--- a/handle.c
+++ b/handle.c
@@ -270,6 +270,9 @@ static void handleReplyISupport(struct Message *msg) {
 		} else if (!strcmp(key, "CHANTYPES")) {
 			if (!msg->params[i]) continue;
 			set(&network.chanTypes, msg->params[i]);
+		} else if (!strcmp(key, "STATUSMSG")) {
+			if (!msg->params[i]) continue;
+			set(&network.statusmsg, msg->params[i]);
 		} else if (!strcmp(key, "PREFIX")) {
 			strsep(&msg->params[i], "(");
 			char *modes = strsep(&msg->params[i], ")");
@@ -1196,6 +1199,9 @@ static void colorMentions(struct Cat *cat, uint id, struct Message *msg) {
 
 static void handlePrivmsg(struct Message *msg) {
 	require(msg, true, 2);
+	if (network.statusmsg) {
+		msg->params[0] += strspn(msg->params[0], network.statusmsg);
+	}
 	bool query = !strchr(network.chanTypes, msg->params[0][0]);
 	bool server = strchr(msg->nick, '.');
 	bool mine = !strcmp(msg->nick, self.nick);
s='nohover-highlight'> 2016-09-12Add -s flag to xxJune McEnroe 2016-09-12Add -a flag to xxJune McEnroe 2016-09-12Add -o flag to xxJune McEnroe 2016-09-12Add -g option to xxJune McEnroe 2016-09-12Add -c option to xxJune McEnroe 2016-09-12Add .bin/xx.cJune McEnroe 2016-09-08Rename colorscheme to lameJune McEnroe 2016-09-04Simplify colors syntax in zsh promptJune McEnroe 2016-08-29Color rubyStringDelimiter as StringJune McEnroe 2016-08-24Highlight rubyDefine as StructureJune McEnroe 2016-08-23Remove scroll bindings from nvim configJune McEnroe 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