Merge pull request #630 from robintown/matryoshka-baseurl
Make avatars work in matryoshka mode
This commit is contained in:
commit
e182dd50f2
2 changed files with 8 additions and 4 deletions
|
@ -35,12 +35,14 @@ export interface UrlParams {
|
||||||
isPtt: boolean;
|
isPtt: boolean;
|
||||||
// Whether to use end-to-end encryption
|
// Whether to use end-to-end encryption
|
||||||
e2eEnabled: boolean;
|
e2eEnabled: boolean;
|
||||||
// The user's ID (only used in Matroska mode)
|
// The user's ID (only used in matryoshka mode)
|
||||||
userId: string | null;
|
userId: string | null;
|
||||||
// The display name to use for auto-registration
|
// The display name to use for auto-registration
|
||||||
displayName: string | null;
|
displayName: string | null;
|
||||||
// The device's ID (only used in Matroska mode)
|
// The device's ID (only used in matryoshka mode)
|
||||||
deviceId: string | null;
|
deviceId: string | null;
|
||||||
|
// The base URL of the homeserver to use for media lookups in matryoshka mode
|
||||||
|
baseUrl: string | null;
|
||||||
// The BCP 47 code of the language the app should use
|
// The BCP 47 code of the language the app should use
|
||||||
lang: string | null;
|
lang: string | null;
|
||||||
}
|
}
|
||||||
|
@ -92,6 +94,7 @@ export const getUrlParams = (
|
||||||
userId: getParam("userId"),
|
userId: getParam("userId"),
|
||||||
displayName: getParam("displayName"),
|
displayName: getParam("displayName"),
|
||||||
deviceId: getParam("deviceId"),
|
deviceId: getParam("deviceId"),
|
||||||
|
baseUrl: getParam("baseUrl"),
|
||||||
lang: getParam("lang"),
|
lang: getParam("lang"),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -80,10 +80,11 @@ export const widget: WidgetHelpers | null = (() => {
|
||||||
// We need to do this now rather than later because it has capabilities to
|
// We need to do this now rather than later because it has capabilities to
|
||||||
// request, and is responsible for starting the transport (should it be?)
|
// request, and is responsible for starting the transport (should it be?)
|
||||||
|
|
||||||
const { roomId, userId, deviceId } = getUrlParams();
|
const { roomId, userId, deviceId, baseUrl } = getUrlParams();
|
||||||
if (!roomId) throw new Error("Room ID must be supplied");
|
if (!roomId) throw new Error("Room ID must be supplied");
|
||||||
if (!userId) throw new Error("User ID must be supplied");
|
if (!userId) throw new Error("User ID must be supplied");
|
||||||
if (!deviceId) throw new Error("Device ID must be supplied");
|
if (!deviceId) throw new Error("Device ID must be supplied");
|
||||||
|
if (!baseUrl) throw new Error("Base URL must be supplied");
|
||||||
|
|
||||||
// These are all the event types the app uses
|
// These are all the event types the app uses
|
||||||
const sendState = [
|
const sendState = [
|
||||||
|
@ -119,7 +120,7 @@ export const widget: WidgetHelpers | null = (() => {
|
||||||
},
|
},
|
||||||
roomId,
|
roomId,
|
||||||
{
|
{
|
||||||
baseUrl: "",
|
baseUrl,
|
||||||
userId,
|
userId,
|
||||||
deviceId,
|
deviceId,
|
||||||
timelineSupport: true,
|
timelineSupport: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue