From dce7891331fcf3b86095b64bea8853942dfd667c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 2 Feb 2020 03:43:18 -0500 Subject: Add extremely basid handlePrivmsg --- handle.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/handle.c b/handle.c index ef61129..da635b4 100644 --- a/handle.c +++ b/handle.c @@ -193,6 +193,18 @@ static void handleJoin(struct Message *msg) { ); } +static void handlePrivmsg(struct Message *msg) { + require(msg, true, 2); + bool query = self.nick && !strcmp(msg->params[0], self.nick); + size_t id = idFor(query ? msg->nick : msg->params[0]); + if (query) idColors[id] = hash(msg->user); + uiFormat( + id, Warm, tagTime(msg), + "\3%d<%s>\3 %s", + hash(msg->user), msg->nick, msg->params[1] + ); +} + static void handlePing(struct Message *msg) { require(msg, false, 1); ircFormat("PONG :%s\r\n", msg->params[0]); @@ -215,6 +227,7 @@ static const struct Handler { { "CAP", handleCap }, { "JOIN", handleJoin }, { "PING", handlePing }, + { "PRIVMSG", handlePrivmsg }, }; static int compar(const void *cmd, const void *_handler) { -- cgit 1.4.1 zlib?id=9b7b605e5abeee8b93dacd2e7dc3e66fb7916362'>tree commit diff
path: root/doc/zlib (unfollow)
Commit message (Expand)Author
2021-02-04Remove cgit logo using cgitrcJune McEnroe
2021-01-31Add The Rosewater RedemptionJune McEnroe
2021-01-29Use int when checking for EOFJune McEnroe
2021-01-28Move gpl.c and agpl.c templates out of etcJune McEnroe
2021-01-27Set para and sect for mdocJune McEnroe
2021-01-26Use First state to match keyword at beginning of lineJune McEnroe
2021-01-25Install vi on Linux and nvi on macOSJune McEnroe
2021-01-25Use vi and lessJune McEnroe
2021-01-20Use mtags for sh in source-filterJune McEnroe
2021-01-20Generate tags for sh files in mtagsJune McEnroe
2021-01-20Add messy sh lexerJune McEnroe
2021-01-20Add all target to git.causal.agency MakefileJune McEnroe
2021-01-20Remove Lua supportJune McEnroe
2021-01-20Fix tests for diff spansJune McEnroe
2021-01-20Avoid matching ':' in make tagsJune McEnroe
2021-01-19Prefer tag matches not preceded by [[:alnum:]]June McEnroe
2021-01-19Escape \ and / in mtags search patternsJune McEnroe
2021-01-20Use mtags in source-filterJune McEnroe
2021-01-19Add mtags to generate tags for make and mdocJune McEnroe
2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe
2021-01-19Don't use a pager if reading standard inputJune McEnroe
2021-01-19Support BSD make syntax and match *.amJune McEnroe
2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe
2021-01-18Allow matching lexers using first input lineJune McEnroe