Add on/off switch for 3PID in directory lookups

This commit is contained in:
Max Dor
2018-08-15 11:25:41 +02:00
parent 1ab8a27fda
commit feb37112b2
3 changed files with 35 additions and 5 deletions

View File

@@ -25,6 +25,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
@Configuration
@ConfigurationProperties("directory")
public class DirectoryConfig {
@@ -34,6 +36,7 @@ public class DirectoryConfig {
public static class Exclude {
private boolean homeserver;
private boolean threepid;
public boolean getHomeserver() {
return homeserver;
@@ -44,6 +47,14 @@ public class DirectoryConfig {
return this;
}
public boolean getThreepid() {
return threepid;
}
public void setThreepid(boolean threepid) {
this.threepid = threepid;
}
}
private Exclude exclude = new Exclude();
@@ -56,4 +67,12 @@ public class DirectoryConfig {
this.exclude = exclude;
}
@PostConstruct
public void buid() {
log.info("--- Directory config ---");
log.info("Exclude:");
log.info("\tHomeserver: {}", getExclude().getHomeserver());
log.info("\t3PID: {}", getExclude().getThreepid());
}
}