about summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2021-05-23 17:26:19 +0000
committerJune McEnroe <june@causal.agency>2021-05-25 16:11:31 -0400
commit868c604a5548b19cb1678f686172978e3ba52b1a (patch)
tree761d5dcdded4ad653d7e414e3d1f60b2f405c64e /handle.c
parentUse color enum instead of hardcoded value (diff)
downloadtest-868c604a5548b19cb1678f686172978e3ba52b1a.tar.gz
test-868c604a5548b19cb1678f686172978e3ba52b1a.zip
Use reverse video not colors for topic change when disabled
`-H 0,0`/"hash = 0,0" makes catgirl mostly colorless which is great,
but topic changes still hardcode brown/green colors to show differences
which is usually not desired by users (like me) disabling colors.

Go for a less eye stressing topic change message that shows both old
and new in reverse video with default terminal colors.

This isn't perfect, other parts of catgirl still hardcode colors and
`-H 0,0`/"hash = 0,0" was never meant to disable colors completely, but
topics change often enough that avoiding less readable^Waccessible topic
diffs seems sensible enough.

NB: parseHash() is brittle and "0,0" is not the only value disabling
colors...
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/handle.c b/handle.c
index 09b28d5..2607420 100644
--- a/handle.c
+++ b/handle.c
@@ -662,6 +662,11 @@ static void handleTopic(struct Message *msg) {
 	if (swprintf(old, ARRAY_LEN(old), L"%s", prev) < 0) goto plain;
 	if (swprintf(new, ARRAY_LEN(new), L"%s", msg->params[1]) < 0) goto plain;
 
+	if (!hashBound) {
+		catf(&cat, "%c%ls%c -> %c%ls%c", R, old, O, R, new, O);
+		goto plain;
+	}
+
 	size_t pre;
 	for (pre = 0; old[pre] && new[pre] && old[pre] == new[pre]; ++pre);
 	wchar_t *osuf = &old[wcslen(old)];
class='nohover-highlight'> 2018-09-27Export PWDJune McEnroe Without it, $(PWD) is unset in GNU make. 2018-09-27Add sans6x8 PSF2 fontJune McEnroe 2018-09-26Add copy paste to psfedJune McEnroe 2018-09-25Add r to psfed for invertJune McEnroe 2018-09-24Add psfed, a PSF2 font editorJune McEnroe 2018-09-21Add scheme -i to swap white and blackJune McEnroe 2018-09-21Map caps lock to escape on Linux consoleJune McEnroe 2018-09-19Fix README mandoc lintsJune McEnroe 2018-09-19Un-NOT trans.alpha values in pngoJune McEnroe 2018-09-18Refactor reads in pngo and clear palette between filesJune McEnroe 2018-09-17Add tRNS support to pngoJune McEnroe 2018-09-11Move gfx man pages to gfx/manJune McEnroe 2018-09-11Move bin man pages to bin/manJune McEnroe 2018-09-11Rewrite gfx.7 and render plaintext READMEJune McEnroe 2018-09-11Remove GAMES from BINSJune McEnroe 2018-09-11Rewrite bin.7 and render to plaintext READMEJune McEnroe 2018-09-11Add "blank" lines to man pagesJune McEnroe 2018-09-10Add mdoc syntax fileJune McEnroe 2018-09-08Fix Nm usage in multi-name man pagesJune McEnroe 2018-09-08Put real dates on man pagesJune McEnroe 2018-09-08Replace gfx README with REAMDE.7June McEnroe 2018-09-08Link gfx man pages in ~/.localJune McEnroe