Oops, the tests won't work if we don't export the functions

This commit is contained in:
David Baker 2021-01-21 22:42:12 +00:00
parent 0a90c982c7
commit ba45b47240
2 changed files with 5 additions and 3 deletions

View file

@ -26,13 +26,15 @@ export function voipUserMapperEnabled(): boolean {
return SdkConfig.get()['voip_mxid_translate_pattern'] !== undefined;
}
function userToVirtualUser(userId: string, templateString?: string): string {
// only exported for tests
export function userToVirtualUser(userId: string, templateString?: string): string {
if (templateString === undefined) templateString = SdkConfig.get()['voip_mxid_translate_pattern'];
if (!templateString) return null;
return templateString.replace('${mxid}', encodeURIComponent(userId).replace(/%/g, '=').toLowerCase());
}
function virtualUserToUser(userId: string, templateString?: string): string {
// only exported for tests
export function virtualUserToUser(userId: string, templateString?: string): string {
if (templateString === undefined) templateString = SdkConfig.get()['voip_mxid_translate_pattern'];
if (!templateString) return null;