about summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-05 19:00:54 -0500
committerJune McEnroe <june@causal.agency>2020-02-05 19:00:54 -0500
commitb2d35edcb22a9a41235229b41b180a50b51b5908 (patch)
tree4cfc6ca3682aff0fa7fd65348c35210df832460f /ui.c
parentScroll the input window (diff)
downloadcatgirl-b2d35edcb22a9a41235229b41b180a50b51b5908.tar.gz
catgirl-b2d35edcb22a9a41235229b41b180a50b51b5908.zip
Change prompt depending on command
Diffstat (limited to '')
-rw-r--r--ui.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/ui.c b/ui.c
index 12c8541..daa6dec 100644
--- a/ui.c
+++ b/ui.c
@@ -479,16 +479,29 @@ static void inputUpdate(void) {
 		colorPair(mapColor(self.color), -1),
 		NULL
 	);
+	const char *head = editHead();
+	const char *skip = NULL;
 	if (self.nick) {
-		// TODO: Check if input is command or action.
-		waddch(input, '<');
-		waddstr(input, self.nick);
-		waddstr(input, "> ");
+		size_t id = windows.active->id;
+		if (NULL != (skip = commandIsPrivmsg(id, head))) {
+			waddch(input, '<');
+			waddstr(input, self.nick);
+			waddstr(input, "> ");
+		} else if (NULL != (skip = commandIsNotice(id, head))) {
+			waddch(input, '-');
+			waddstr(input, self.nick);
+			waddstr(input, "- ");
+		} else if (NULL != (skip = commandIsAction(id, head))) {
+			waddstr(input, "* ");
+			waddstr(input, self.nick);
+			waddch(input, ' ');
+		}
 	}
+	if (skip) head = skip;
 
 	int y, x;
 	struct Style style = Reset;
-	inputAdd(&style, editHead());
+	inputAdd(&style, head);
 	getyx(input, y, x);
 	inputAdd(&style, editTail());
 	wclrtoeol(input);
526f9ebdc66fbc01c3bf7b96543660f71c&follow=1'>Rewrite install script yet againJune McEnroe 2020-09-11Remove NetBSD from install scriptJune McEnroe I never use it. 2020-09-11Use MacPorts rather than pkgsrcJune McEnroe My system is probably such a mess now... 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe Reading has really slowed down :( 2020-09-07Add SunglassesJune McEnroe An IRC find. 2020-09-06Add Between the BreathsJune McEnroe One of those good songs from a soundtrack of a film that probably isn't? The summary sounds a lot more interesting than the title implies, at least. 2020-09-04Open /dev/tty in nudgeJune McEnroe This makes it work even when it's run connected to a pipe, i.e. as the notify command of catgirl... 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe I guess this got lost somewhere, long ago... 2020-08-29Add tweets from retweetsJune McEnroe