summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/client.c b/client.c
index 201566e..dec0041 100644
--- a/client.c
+++ b/client.c
@@ -318,12 +318,29 @@ static const char *filterInviteNotify(const char *line) {
 	return (wordcmp(line, 2, stateNick()) ? NULL : line);
 }
 
+static const char *filterUserhostInNames(const char *line) {
+	if (wordcmp(line, 1, "353")) return line;
+	static char buf[512];
+	if (strlen(line) >= sizeof(buf)) return NULL;
+	char *ptr = buf;
+	while (*line) {
+		size_t len = strcspn(line, "!");
+		memcpy(ptr, line, len);
+		ptr += len;
+		line += len;
+		line += strcspn(line, " ");
+	}
+	*ptr = '\0';
+	return buf;
+}
+
 static Filter *Filters[] = {
 	[CapAccountNotifyBit] = filterAccountNotify,
 	[CapAwayNotifyBit] = filterAwayNotify,
 	[CapChghostBit] = filterChghost,
 	[CapExtendedJoinBit] = filterExtendedJoin,
 	[CapInviteNotifyBit] = filterInviteNotify,
+	[CapUserhostInNamesBit] = filterUserhostInNames,
 };
 
 void clientConsume(struct Client *client) {
2dda7682d2ec85b6548cc&follow=1'>Sandbox calico with pledge(2) and unveil(2)June McEnroe 2020-08-27Add support for OpenBSDJune McEnroe 2020-08-27Remove rc scriptsJune McEnroe 2020-08-27contrib/palaver: Fix documented database pathJune McEnroe 2020-08-27contrib/palaver: Remove rc scriptJune McEnroe 2020-08-27contrib/palaver: Fix database search and creationJune McEnroe 2020-08-27contrib/palaver: Use pounce's XDG directoryJune McEnroe 2020-08-27contrib/palaver: Only allow HTTPSJune McEnroe 2020-08-25Support the pounce_env rc variableJune McEnroe 2020-08-25Remove deprecated option namesJune McEnroe 2020-08-25Document configuration and data file searchJune McEnroe 2020-08-24Use dataOpen for save fileJune McEnroe 2020-08-24Use configOpen to load localCAJune McEnroe 2020-08-24Use configPath to load client cert/privJune McEnroe 2020-08-24Use configOpen in getopt_configJune McEnroe 2020-08-24Import xdg.c from catgirlJune McEnroe 2020-08-23Replace “RAND_bytes” by “getentropy”Issam E. Maghni 2020-08-16contrib/palaver: Add no message preview flagsJune McEnroe 2020-08-13contrib/palaver: Don't set channel for PMsJune McEnroe 2020-08-13Fix unintended interception of NICK after registrationJune McEnroe 2020-08-12Add Additional Components section to READMEJune McEnroe 2020-08-12Document -L / palaver optionJune McEnroe 2020-08-11contrib/palaver: Document service configurationJune McEnroe 2020-08-11contrib/palaver: Add install target and rc scriptJune McEnroe 2020-08-11contrib/palaver: Implement command and notificationsJune McEnroe