Skip to content

Commit

Permalink
Avoid including bridged user in directory lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
maxidorius committed Aug 15, 2019
1 parent a964b07 commit 6e9601c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static String findByDisplayName(String type, String domain) {
if (StringUtils.equals("sqlite", type)) {
return "select " + getUserId(type, domain) + ", displayname from profiles p where displayname like ?";
} else if (StringUtils.equals("postgresql", type)) {
return "select " + getUserId(type, domain) + ", displayname from profiles p where displayname ilike ?";
return "SELECT u.name,p.displayname FROM users u JOIN profiles p ON u.name LIKE concat('@',p.user_id,':%') WHERE u.is_guest = 0 AND u.appservice_id IS NULL AND p.displayname LIKE ?";
} else {
throw new ConfigurationException("Invalid Synapse SQL type: " + type);
}
Expand Down

0 comments on commit 6e9601c

Please sign in to comment.