diff options
author | June McEnroe <june@causal.agency> | 2019-12-28 18:34:12 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-12-28 18:34:12 -0500 |
commit | 37295ea945f04e1a2cf45dcae24b19da5996b0db (patch) | |
tree | 3e6a96c5fc5a1d4c6ada132816713b22da332f20 | |
parent | Run PRAGMA optimize in dbClose (diff) | |
download | litterbox-37295ea945f04e1a2cf45dcae24b19da5996b0db.tar.gz litterbox-37295ea945f04e1a2cf45dcae24b19da5996b0db.zip |
Don't insert self-messages
Even with NOTICEs litterbox would sometimes receive its own responses, which would create duplicates in the database, essentially.
Diffstat (limited to '')
-rw-r--r-- | litterbox.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/litterbox.c b/litterbox.c index 5924680..9cc1bb5 100644 --- a/litterbox.c +++ b/litterbox.c @@ -360,12 +360,14 @@ static void handlePrivmsg(struct Message *msg) { type = Action; } + bool selfMessage = !strcmp(msg->nick, msg->params[0]); if (query && searchQuery && type == Privmsg) { - if (searchQuery == Public || !strcmp(msg->nick, msg->params[0])) { + if (searchQuery == Public || selfMessage) { querySearch(msg); return; } } + if (selfMessage) return; insertContext(context, query); insertName(msg); |