From ce938bb4a5b21f4759e9a3a08416ff53b09a0315 Mon Sep 17 00:00:00 2001 From: NullIsNot0 Date: Tue, 7 Jan 2020 22:24:26 +0200 Subject: [PATCH 1/2] Load DNS overwrite config on startup I recently noticed that DNS overwrite does not happen. There are messages in logs: "No DNS overwrite for ", but I definitely have configured DNS overwrithng. I think it's because DNS overwriting config is not loaded when ma1sd starts up. Documented here: https://github.com/ma1uta/ma1sd/blob/master/docs/features/authentication.md#dns-overwrite and here: https://github.com/ma1uta/ma1sd/blob/master/docs/features/directory.md#dns-overwrite --- src/main/java/io/kamax/mxisd/config/MxisdConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/kamax/mxisd/config/MxisdConfig.java b/src/main/java/io/kamax/mxisd/config/MxisdConfig.java index f0d51ed..a7f8a45 100644 --- a/src/main/java/io/kamax/mxisd/config/MxisdConfig.java +++ b/src/main/java/io/kamax/mxisd/config/MxisdConfig.java @@ -359,6 +359,7 @@ public class MxisdConfig { getAuth().build(); getAccountConfig().build(); getDirectory().build(); + getDns().build(); getExec().build(); getFirebase().build(); getForward().build(); From be915aed947a6d38e5f26f0a7834d12e3a0799f2 Mon Sep 17 00:00:00 2001 From: Edgars Voroboks Date: Thu, 9 Jan 2020 20:14:56 +0200 Subject: [PATCH 2/2] Remove duplicates from identity store before email notifications I use LDAP for user store. I have set up "mail" and "otherMailbox" as threepid email attributes. When people get invited to rooms, they receive 2 (sometimes 3) invitation e-mails if they have the same e-mail address in LDAP "mail" and "otherMailbox" fields. I think it's a good idea to check identity store for duplicates before sending invitation e-mails. --- .../as/processor/event/MembershipEventProcessor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/kamax/mxisd/as/processor/event/MembershipEventProcessor.java b/src/main/java/io/kamax/mxisd/as/processor/event/MembershipEventProcessor.java index 5963dce..b57f79b 100644 --- a/src/main/java/io/kamax/mxisd/as/processor/event/MembershipEventProcessor.java +++ b/src/main/java/io/kamax/mxisd/as/processor/event/MembershipEventProcessor.java @@ -144,7 +144,13 @@ public class MembershipEventProcessor implements EventTypeProcessor { .collect(Collectors.toList()); log.info("Found {} email(s) in identity store for {}", tpids.size(), inviteeId); - for (_ThreePid tpid : tpids) { + log.info("Removing duplicates from identity store"); + List<_ThreePid> uniqueTpids = tpids.stream() + .distinct() + .collect(Collectors.toList()); + log.info("There are {} unique email(s) in identity store for {}", uniqueTpids.size(), inviteeId); + + for (_ThreePid tpid : uniqueTpids) { log.info("Found Email to notify about room invitation: {}", tpid.getAddress()); Map properties = new HashMap<>(); profiler.getDisplayName(sender).ifPresent(name -> properties.put("sender_display_name", name));