Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Define a new Synapse module that can manipulate user directory search results #9259

Closed
wants to merge 6 commits into from

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Jan 28, 2021

This PR creates a new Synapse module type that is intended to interact with the user directory. In its current state, the only method that can be overridden is get_search_query_ordering which, given a database type, will return SQL that defines how user directory search results should be ordered.

The motivation for this is that DINUM would like to be able to return users with a specific string in their displayname higher than other results. It could potentially be used by others to manipulate search results in whichever way they wish, though admittedly in a limited way currently. There is potential to expand this module to manipulate other areas of the user directory search in the future though.

DINUM's instance of the module is located here, and should be considered during review.

Note: I'm aware that having a module pass direct SQL to Synapse is a bit dangerous, however so are the abilities of many other modules. Modules aren't meant to be installed willy-nilly.

I'm also aware that it's a bit gross to request part of an SQL query from a module. I didn't want to allow the module to manipulate the return values from the query however, as that would require a much more generic method of processing the results of the query.

Reviewable commit-by-commit.

@anoadragon453 anoadragon453 added the Z-Time-Tracked Element employees should track their time spent on this issue/PR. label Jan 28, 2021
@anoadragon453 anoadragon453 force-pushed the anoa/custom_user_directory_search branch 3 times, most recently from 3f37bfd to 7a2619a Compare February 4, 2021 18:21
@anoadragon453 anoadragon453 force-pushed the anoa/custom_user_directory_search branch from 7a2619a to 62ac4a8 Compare February 8, 2021 16:07
@anoadragon453 anoadragon453 requested a review from a team February 8, 2021 16:18
@anoadragon453 anoadragon453 marked this pull request as ready for review February 8, 2021 16:19
@anoadragon453 anoadragon453 removed the request for review from a team February 8, 2021 19:03
@anoadragon453
Copy link
Member Author

This PR has been superseded by #9383.

@anoadragon453 anoadragon453 deleted the anoa/custom_user_directory_search branch February 12, 2021 22:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z-Time-Tracked Element employees should track their time spent on this issue/PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant