update location event types (#8022)

* update types

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix tests

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* trigger

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2022-03-10 19:03:31 +01:00 committed by GitHub
parent a4b2e0c0d8
commit e96d9157a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 39 additions and 35 deletions

View file

@ -41,10 +41,9 @@ export const shareLocation = (
) => async (uri: string, ts: number) => {
if (!uri) return false;
try {
const text = textForLocation(uri, ts, null);
const threadId = relation?.rel_type === RelationType.Thread ? relation.event_id : null;
const assetType = shareType === LocationShareType.Pin ? LocationAssetType.Pin : LocationAssetType.Self;
await client.sendMessage(roomId, threadId, makeLocationContent(text, uri, ts, null, assetType));
await client.sendMessage(roomId, threadId, makeLocationContent(undefined, uri, ts, undefined, assetType));
} catch (e) {
logger.error("We couldn't send your location", e);