Merge pull request #236 from dozro/fix/sticker-add-encrypted-sticker
Improve sticker handling and update documentation on limitations
This commit is contained in:
4 files changed
+12
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
sable: patch
|
||||
---
|
||||
|
||||
disabling quick add for encrypted sticker, this mitigates the issue of being unable to use quick to add encrypted sticker
|
||||
@@ -18,3 +18,6 @@ devAssets
|
||||
*.tfbackend
|
||||
!*.tfbackend.example
|
||||
crash.log
|
||||
|
||||
# the following line was added with the "git ignore" tool by itsrye.dev, version 0.1.0
|
||||
.lh
|
||||
@@ -825,7 +825,9 @@ function MessageInternal(
|
||||
</Text>
|
||||
</MenuItem>
|
||||
)}
|
||||
{/* Only show "Add to User Sticker Pack" if the sticker isn't already in the default pack and isn't encrypted */}
|
||||
{isStickerMessage &&
|
||||
mEvent.getContent().url &&
|
||||
!doesStickerExistInDefaultPack(mx, mEvent.getContent().url) && (
|
||||
<MenuItem
|
||||
size="300"
|
||||
@@ -835,7 +837,7 @@ function MessageInternal(
|
||||
addStickerToDefaultPack(
|
||||
mx,
|
||||
`sticker-${mEvent.getId()}`,
|
||||
mEvent.getContent().url,
|
||||
mEvent.getContent().url ?? mEvent.getContent().file?.url ?? '',
|
||||
mEvent.getContent().body,
|
||||
mEvent.getContent().info
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import { IImageInfo } from '$types/matrix/common';
|
||||
import { MatrixClient } from 'matrix-js-sdk';
|
||||
|
||||
// Utility function to add a sticker to the default sticker pack
|
||||
// For now this only works for unencrypted stickers
|
||||
export async function addStickerToDefaultPack(
|
||||
mx: MatrixClient,
|
||||
shortcode: string,
|
||||
|
||||
Reference in new issue
Block a user