Remove the client side filtering from the room dir
This removes the ability for the client to filter remote room directories by network, since the /thirdparty/protocols API does not yet work for remote servers. They would only get the main list now though anyway, so there is no point in us continuing to support it.
This commit is contained in:
23
src/utils/DirectoryUtils.js
Normal file
23
src/utils/DirectoryUtils.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// Find a protocol 'instance' with a given instance_id
|
||||
// in the supplied protocols dict
|
||||
export function instanceForInstanceId(protocols, instance_id) {
|
||||
if (!instance_id) return null;
|
||||
for (const proto of Object.keys(protocols)) {
|
||||
if (!protocols[proto].instances) continue;
|
||||
for (const instance of protocols[proto].instances) {
|
||||
if (instance.instance_id == instance_id) return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// given an instance_id, return the name of the protocol for
|
||||
// that instance ID in the supplied protocols dict
|
||||
export function protocolNameForInstanceId(protocols, instance_id) {
|
||||
if (!instance_id) return null;
|
||||
for (const proto of Object.keys(protocols)) {
|
||||
if (!protocols[proto].instances) continue;
|
||||
for (const instance of protocols[proto].instances) {
|
||||
if (instance.instance_id == instance_id) return proto;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user