In the context of ActivityPub, we want to be able to use the user picker to suggest users from the fediverse.
In addition, we want to be able to use the user picker to suggest users, groups, and users from the fediverse when using the mention macro.
Hence, it is interesting to allow the user picker to propose results from different sources of groups or users, and to allow these sources to be contributed to by extension.
I propose to introduce an UIXP used to call specific documents dedicated to the search of actors of a given kind (e.g., users, groups…).
The user picker (
uorgsuggest.vm to get the list of suggestions.
- exactMatch (boolean): if true, return only exact matches
- input (string): the string used for the search
- wiki (
'global'or undeclared): if ‘global’, search for global users too
- media (
'json'or undeclared ): if ‘json’ returns the result in json, otherwise returns the result in xml.
- uorg: (
'user'or undeclared): if ‘user’ search for the users, otherwise search for the groups
The result of the query is a data structure (json or xml). The number of results is limited to 10.
The root is a
result tag containing multiple
rs tags. The
rs tag has multiple attributes:
- id: the url of the user or group
- icon: the url of the icon of the user of group
- info: the plain user name or the group name
The body of
rs tag is the compact serialized form of the user or group
The result is an array of objects.
Each object has the following fields:
- value: the compact serialized form of the user or group
- label: the plain user name or the group name
- icon: the url of the icon of the user or group
- url: the url of the user or group
Proposed Architecture Changes
The parameters of
uorgsuggest.vm stay the same but
uorg is used differently.
- if empty: returns the groups (for legacy reasons)
- if equals to ‘*’: returns the results of all the UIX.
- otherwise, the string is split and only the UIX with a parameter type contained in the split list are used to form the results.
users,groupsreturns the suggestions of users and groups
groupsreturns only the groups suggestions
- the empty string returns the groups suggestions too
users,activitypubreturns the suggestions for the wiki users and activitypub users.
The result stays the same but a new key, named
type is introduced. The type indicates from which UIX the results comes from.
The result of all the selected UIXs are merged, sorted by label, limited to the 10 first results, and possibly converted to XML, before being returned.
The UIXPs return only json results.
The conversion into XML is done only if needed after the results are merged and sorted.
- UIXP id:
- type = unique type
uorg parameter is empty,
users, the use of the user picker stays the same.
* or a specific set of types, the type of the returned value must be used to exploit the returned values in a relevant way.
The results for the users and groups are currently defined inside
They should probably be moved to two dedicated UIX.