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:
parent
a4b2e0c0d8
commit
e96d9157a9
9 changed files with 39 additions and 35 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue