summary refs log tree commit diff
path: root/contrib/palaver
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-04-30 17:27:13 -0400
committerJune McEnroe <june@causal.agency>2021-04-30 17:30:02 -0400
commit9b1be8c292cd26717330f77f34d0e285d4ae2d95 (patch)
tree7f2ffe4f208f71d18ef22d40bc2f2a1f9ffff32b /contrib/palaver
parentpalaver: Remove last vestiges of rc scripts (diff)
downloadpounce-9b1be8c292cd26717330f77f34d0e285d4ae2d95.tar.gz
pounce-9b1be8c292cd26717330f77f34d0e285d4ae2d95.zip
palaver: Add -s flag for case-sensitive matching
Diffstat (limited to 'contrib/palaver')
-rw-r--r--contrib/palaver/notify.c7
-rw-r--r--contrib/palaver/pounce-palaver.17
2 files changed, 10 insertions, 4 deletions
diff --git a/contrib/palaver/notify.c b/contrib/palaver/notify.c
index 7d3be5f..67d416c 100644
--- a/contrib/palaver/notify.c
+++ b/contrib/palaver/notify.c
@@ -283,6 +283,8 @@ static void handleReplyUserHost(struct Message *msg) {
 	}
 }
 
+static bool sensitive;
+
 static void keyword(sqlite3_context *ctx, int n, sqlite3_value *args[]) {
 	assert(n == 2);
 	const char *haystack = (const char *)sqlite3_value_text(args[0]);
@@ -311,7 +313,7 @@ static void keyword(sqlite3_context *ctx, int n, sqlite3_value *args[]) {
 	size_t len = strlen(needle);
 	const char *match = haystack;
 	sqlite3_result_int(ctx, false);
-	while (NULL != (match = strcasestr(match, needle))) {
+	while (NULL != (match = (sensitive ? strstr : strcasestr)(match, needle))) {
 		char a = (match > haystack ? match[-1] : ' ');
 		char b = (match[len] ? match[len] : ' ');
 		if (b == '\1') b = ' ';
@@ -693,7 +695,7 @@ int main(int argc, char *argv[]) {
 	const char *pass = NULL;
 	const char *user = "pounce-palaver";
 
-	for (int opt; 0 < (opt = getopt(argc, argv, "!NPc:d:k:p:u:vw:"));) {
+	for (int opt; 0 < (opt = getopt(argc, argv, "!NPc:d:k:p:su:vw:"));) {
 		switch (opt) {
 			break; case '!': insecure = true;
 			break; case 'N': noPreview = true;
@@ -702,6 +704,7 @@ int main(int argc, char *argv[]) {
 			break; case 'd': path = optarg;
 			break; case 'k': priv = optarg;
 			break; case 'p': port = optarg;
+			break; case 's': sensitive = true;
 			break; case 'u': user = optarg;
 			break; case 'v': verbose = true;
 			break; case 'w': pass = optarg;
diff --git a/contrib/palaver/pounce-palaver.1 b/contrib/palaver/pounce-palaver.1
index f88420e..37140c5 100644
--- a/contrib/palaver/pounce-palaver.1
+++ b/contrib/palaver/pounce-palaver.1
@@ -1,4 +1,4 @@
-.Dd August 27, 2020
+.Dd April 30, 2021
 .Dt POUNCE-PALAVER 1
 .Os
 .
@@ -8,7 +8,7 @@
 .
 .Sh SYNOPSIS
 .Nm
-.Op Fl PNv
+.Op Fl PNsv
 .Op Fl c Ar cert
 .Op Fl d Ar path
 .Op Fl k Ar priv
@@ -56,6 +56,9 @@ Load the TLS client private key from
 Connect to
 .Ar port .
 The default port is 6697.
+.It Fl s
+Match nick and keywords case-sensitively,
+despite the specification.
 .It Fl u Ar user
 Set the username to
 .Ar user .
>2020-02-11Add -R restricted flagJune McEnroe 2020-02-11Add chroot targetJune McEnroe 2020-02-11Exit focus and paste modes on err exitJune McEnroe 2020-02-11Add startup GPLv3 note and URLJune McEnroe I am a degenerate. 2020-02-11Make sure -D_GNU_SOURCE ends up in CFLAGS on LinuxJune McEnroe 2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe 2020-02-11Rename query ID on nick changeJune McEnroe 2020-02-11Call completeClear when closing a windowJune McEnroe 2020-02-11Don't insert color codes for non-mentionsJune McEnroe 2020-02-11Take first two words in colorMentionsJune McEnroe This lets phrases like "hi june" get colored, but still doesn't get carried away. 2020-02-11Use time_t for save signatureJune McEnroe It's actually more likely to be 64-bit than size_t anyway, and it eliminates some helper functions. Also don't error when reading an empty save file. 2020-02-11Set self.nick to * initiallyJune McEnroe Allows removing a bunch of checks that self.nick is set, and it's what the server usually calls you before registration. Never highlight notices as mentions. 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe Rookie mistake. 2020-02-11Cast towupper to wchar_tJune McEnroe For some reason it takes and returns wint_t... 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe