Merge pull request #71 from q-wertz/master

Force MatrixID to be lowercase
This commit is contained in:
ma1uta
2020-11-29 08:22:45 +00:00
committed by GitHub

View File

@@ -117,11 +117,15 @@ public abstract class LdapBackend {
public String buildMatrixIdFromUid(String uid) {
String uidType = getCfg().getAttribute().getUid().getType();
String localpart = uid;
String localpart = uid.toLowerCase();
if (!StringUtils.equals(uid, localpart)) {
log.info("UID {} from LDAP has been changed to lowercase to match the Synapse specifications", uid);
}
if (StringUtils.equals(UID, uidType)) {
if(getCfg().isActiveDirectory()) {
localpart = new UPN(uid).getMXID();
localpart = new UPN(uid.toLowerCase()).getMXID();
}
return "@" + localpart + ":" + mxCfg.getDomain();