about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--chat.h1
-rw-r--r--handle.c7
-rw-r--r--ui.c4
3 files changed, 11 insertions, 1 deletions
diff --git a/chat.h b/chat.h
index 1c7ae5a..838c51d 100644
--- a/chat.h
+++ b/chat.h
@@ -41,6 +41,7 @@ void ircFmt(const char *format, ...);
 void uiInit(void);
 void uiHide(void);
 void uiDraw(void);
+void uiBeep(void);
 void uiRead(void);
 void uiTopic(const wchar_t *topic);
 void uiTopicStr(const char *topic);
diff --git a/handle.c b/handle.c
index 015960d..e2169e5 100644
--- a/handle.c
+++ b/handle.c
@@ -227,7 +227,12 @@ static void handlePrivmsg(char *prefix, char *params) {
 		char *action = strsep(&mesg, "\1");
 		uiFmt("* \3%d%s\3 %s", color(user), nick, action);
 	} else {
-		uiFmt("<\3%d%s\3> %s", color(user), nick, mesg);
+		bool ping = !strncasecmp(mesg, chat.nick, strlen(chat.nick));
+		if (ping) uiBeep();
+		uiFmt(
+			"<%s\3%d%s\17> %s",
+			(ping ? "\26" : ""), color(user), nick, mesg
+		);
 	}
 }
 
diff --git a/ui.c b/ui.c
index 62c3b3c..590bfb4 100644
--- a/ui.c
+++ b/ui.c
@@ -158,6 +158,10 @@ static void uiRedraw(void) {
 	clearok(curscr, true);
 }
 
+void uiBeep(void) {
+	beep(); // always be beeping
+}
+
 static const short IRC_COLORS[16] = {
 	8 + COLOR_WHITE,   // white
 	0 + COLOR_BLACK,   // black
Herbert Xu 2018-05-28mkinit: Split reset into exitreset and resetHerbert Xu 2018-05-28main: Only set savestatus in exitcmdHerbert Xu 2018-05-28exec: Return 126 on most errors in shellexecHerbert Xu 2018-05-17Release 0.5.10.2.Herbert Xu 2018-05-15parser: Fix incorrect eating of backslash newlinesHerbert Xu 2018-05-10Release 0.5.10.1.Herbert Xu 2018-05-09jobs - Do not block when waiting on SIGCHLDHerbert Xu 2018-05-03Release 0.5.10.Herbert Xu 2018-04-19eval: Variable assignments on functions are no longer persistentHerbert Xu 2018-04-19parser: Fix parameter expansion inside inner double quotesHerbert Xu 2018-04-19parser: Fix parsing of ${}Herbert Xu 2018-04-19man: correct typos, iff -> ifMartijn Dekker 2018-04-19expand: Do not quote backslashes in unquoted parameter expansionHerbert Xu 2018-04-19shell: Add subdir-objects to AM_INIT_AUTOMAKEJason Bowen 2018-04-19eval: Restore input files in evalcommandHerbert Xu 2018-04-19eval: Reap zombies after built-in commands and functionsHerbert Xu 2018-04-19redir: Fix typo in noclobber codeHerbert Xu 2018-04-19expand: Fix glibc glob(3) supportHerbert Xu 2018-04-02expand: Fix buffer overflow in expandmetaHerbert Xu 2018-04-02builtin: Move echo space/nl handling into print_escape_strHerbert Xu 2018-04-02builtin: Fix echo performance regressionHerbert Xu 2018-04-02expand: Fix ghost fields with unquoted $@/$*Herbert Xu 2018-04-02parser: Allow newlines within parameter substitutionHerbert Xu 2018-04-02expand: Fix bugs with words connected to the right of $@Herbert Xu 2018-03-25Revert "[BUILTIN] Remove unnecessary restoration of format string in printf"Herbert Xu 2018-03-22parser: Fix backquote support in here-document EOF markHerbert Xu