summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-06 04:01:11 -0500
committerJune McEnroe <june@causal.agency>2020-02-06 04:01:11 -0500
commit30b3780e57e532e928d445b882b218decb88af55 (patch)
tree074d334cd1d5a9a544b8382c37a4b731e70d8a7a
parentSend CAP END if CAP LS doesn't list anything good (diff)
downloadcatgirl-30b3780e57e532e928d445b882b218decb88af55.tar.gz
catgirl-30b3780e57e532e928d445b882b218decb88af55.zip
Route own query messages correctly
-rw-r--r--handle.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/handle.c b/handle.c
index cb080e9..9244e66 100644
--- a/handle.c
+++ b/handle.c
@@ -263,11 +263,20 @@ static bool isAction(struct Message *msg) {
 static void handlePrivmsg(struct Message *msg) {
 	require(msg, true, 2);
 	bool query = !strchr(self.chanTypes, msg->params[0][0]);
-	bool network = query && strchr(msg->nick, '.');
+	bool network = strchr(msg->nick, '.');
+	bool mine = self.nick && !strcmp(msg->nick, self.nick);
+	size_t id;
+	if (query && network) {
+		id = Network;
+	} else if (query && !mine) {
+		id = idFor(msg->nick);
+		idColors[id] = hash(msg->user);
+	} else {
+		id = idFor(msg->params[0]);
+	}
+
 	bool notice = (msg->cmd[0] == 'N');
 	bool action = isAction(msg);
-	size_t id = (network ? Network : idFor(query ? msg->nick : msg->params[0]));
-	if (query && !network) idColors[id] = hash(msg->user);
 	uiFormat(
 		id, Warm, tagTime(msg),
 		"\3%d%s%s%s\3\t%s",
cripts/wrap-compiler-for-flag-checkJune McEnroe 2021-05-08Import LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe