Remove 3PID type limitation

This commit is contained in:
Maxime Dor
2017-04-20 19:20:05 +02:00
parent 70222aad83
commit 0a70b903c3
8 changed files with 17 additions and 52 deletions

View File

@@ -20,7 +20,6 @@
package io.kamax.mxisd.lookup.provider
import io.kamax.mxisd.api.ThreePidType
import io.kamax.mxisd.config.LdapConfig
import io.kamax.mxisd.config.ServerConfig
import io.kamax.mxisd.lookup.SingleLookupRequest
@@ -61,7 +60,7 @@ class LdapProvider implements ThreePidProvider {
return 20
}
Optional<String> lookup(LdapConnection conn, ThreePidType medium, String value) {
Optional<String> lookup(LdapConnection conn, String medium, String value) {
Optional<String> queryOpt = ldapCfg.getMapping(medium)
if (!queryOpt.isPresent()) {
log.warn("{} is not a supported 3PID type for LDAP lookup", medium)
@@ -142,8 +141,7 @@ class LdapProvider implements ThreePidProvider {
for (ThreePidMapping mapping : mappings) {
try {
ThreePidType type = ThreePidType.valueOf(mapping.getMedium())
Optional<String> mxid = lookup(conn, type, mapping.getValue())
Optional<String> mxid = lookup(conn, mapping.getMedium(), mapping.getValue())
if (mxid.isPresent()) {
mapping.setMxid(mxid.get())
mappingsFound.add(mapping)