|
| 1 | +diff --git a/ACKNOWLEDGMENTS.md b/ACKNOWLEDGMENTS.md |
| 2 | +index aed1048..e4c1f50 100644 |
| 3 | +--- a/ACKNOWLEDGMENTS.md |
| 4 | ++++ b/ACKNOWLEDGMENTS.md |
| 5 | +@@ -745,30 +745,6 @@ Signal Desktop makes use of the following open source projects. |
| 6 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 7 | + SOFTWARE. |
| 8 | + |
| 9 | +-## emoji-datasource-apple |
| 10 | +- |
| 11 | +- The MIT License (MIT) |
| 12 | +- |
| 13 | +- Copyright (c) 2013 Cal Henderson |
| 14 | +- |
| 15 | +- Permission is hereby granted, free of charge, to any person obtaining a copy |
| 16 | +- of this software and associated documentation files (the "Software"), to deal |
| 17 | +- in the Software without restriction, including without limitation the rights |
| 18 | +- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 19 | +- copies of the Software, and to permit persons to whom the Software is |
| 20 | +- furnished to do so, subject to the following conditions: |
| 21 | +- |
| 22 | +- The above copyright notice and this permission notice shall be included in all |
| 23 | +- copies or substantial portions of the Software. |
| 24 | +- |
| 25 | +- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 26 | +- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 27 | +- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 28 | +- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 29 | +- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 30 | +- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 31 | +- SOFTWARE. |
| 32 | +- |
| 33 | + ## emoji-regex |
| 34 | + |
| 35 | + Copyright Mathias Bynens <https://mathiasbynens.be/> |
| 36 | +diff --git a/app/protocol_filter.ts b/app/protocol_filter.ts |
| 37 | +index 68dceea..4b35bb1 100644 |
| 38 | +--- a/app/protocol_filter.ts |
| 39 | ++++ b/app/protocol_filter.ts |
| 40 | +@@ -59,6 +59,7 @@ function _createFileHandler({ |
| 41 | + const allowedRoots = [ |
| 42 | + userDataPath, |
| 43 | + installPath, |
| 44 | ++ "@noto-emoji-pngs@", |
| 45 | + getAvatarsPath(userDataPath), |
| 46 | + getBadgesPath(userDataPath), |
| 47 | + getDraftPath(userDataPath), |
| 48 | +diff --git a/package.json b/package.json |
| 49 | +index 3a6ac26..40cdb25 100644 |
| 50 | +--- a/package.json |
| 51 | ++++ b/package.json |
| 52 | +@@ -130,7 +130,6 @@ |
| 53 | + "dashdash": "2.0.0", |
| 54 | + "direction": "1.0.4", |
| 55 | + "emoji-datasource": "15.1.2", |
| 56 | +- "emoji-datasource-apple": "15.1.2", |
| 57 | + "emoji-regex": "10.4.0", |
| 58 | + "encoding": "0.1.13", |
| 59 | + "fabric": "4.6.0", |
| 60 | +diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml |
| 61 | +index ba2f205..705e454 100644 |
| 62 | +--- a/pnpm-lock.yaml |
| 63 | ++++ b/pnpm-lock.yaml |
| 64 | +@@ -169,9 +169,6 @@ importers: |
| 65 | + emoji-datasource: |
| 66 | + specifier: 15.1.2 |
| 67 | + version: 15.1.2 |
| 68 | +- emoji-datasource-apple: |
| 69 | +- specifier: 15.1.2 |
| 70 | +- version: 15.1.2 |
| 71 | + emoji-regex: |
| 72 | + specifier: 10.4.0 |
| 73 | + version: 10.4.0 |
| 74 | +@@ -4790,9 +4787,6 @@ packages: |
| 75 | + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} |
| 76 | + engines: {node: '>=12'} |
| 77 | + |
| 78 | +- emoji-datasource-apple@15.1.2: |
| 79 | +- resolution: {integrity: sha512-32UZTK36x4DlvgD1smkmBlKmmJH7qUr5Qut4U/on2uQLGqNXGbZiheq6/LEA8xRQEUrmNrGEy25wpEI6wvYmTg==} |
| 80 | +- |
| 81 | + emoji-datasource@15.1.2: |
| 82 | + resolution: {integrity: sha512-tXAqGsrDVhgCRpFePtaD9P4Z8Ro2SUQSL/4MIJBG0SxqQJaMslEbin8J53OaFwEBu6e7JxFaIF6s4mw9+8acAQ==} |
| 83 | + |
| 84 | +@@ -14929,8 +14923,6 @@ snapshots: |
| 85 | + |
| 86 | + emittery@0.13.1: {} |
| 87 | + |
| 88 | +- emoji-datasource-apple@15.1.2: {} |
| 89 | +- |
| 90 | + emoji-datasource@15.1.2: {} |
| 91 | + |
| 92 | + emoji-regex@10.4.0: {} |
| 93 | +diff --git a/ts/components/conversation/Emojify.tsx b/ts/components/conversation/Emojify.tsx |
| 94 | +index f0b1115..7613230 100644 |
| 95 | +--- a/ts/components/conversation/Emojify.tsx |
| 96 | ++++ b/ts/components/conversation/Emojify.tsx |
| 97 | +@@ -35,8 +35,15 @@ function getImageTag({ |
| 98 | + } |
| 99 | + |
| 100 | + let srcSet: string | undefined; |
| 101 | ++ const emojiToNotoName = (emoji: string): string => |
| 102 | ++ `emoji_u${ |
| 103 | ++ [...emoji] |
| 104 | ++ .filter(c => c != "\ufe0f") |
| 105 | ++ .map(c => c.codePointAt(0)?.toString(16).padStart(4, "0")) |
| 106 | ++ .join("_") |
| 107 | ++ }.png`; |
| 108 | + if (sizeClass != null && JUMBO_SIZES.has(sizeClass)) { |
| 109 | +- srcSet = `emoji://jumbo?emoji=${encodeURIComponent(match)} 2x, ${img}`; |
| 110 | ++ srcSet = `file://@noto-emoji-pngs@/${emojiToNotoName(match)} 2x, ${img}`; |
| 111 | + } |
| 112 | + |
| 113 | + return ( |
| 114 | +diff --git a/ts/components/emoji/lib.ts b/ts/components/emoji/lib.ts |
| 115 | +index 9753017..cf51d3d 100644 |
| 116 | +--- a/ts/components/emoji/lib.ts |
| 117 | ++++ b/ts/components/emoji/lib.ts |
| 118 | +@@ -102,7 +102,10 @@ const ROOT_PATH = get( |
| 119 | + ); |
| 120 | + |
| 121 | + const makeImagePath = (src: string) => { |
| 122 | +- return `${ROOT_PATH}node_modules/emoji-datasource-apple/img/apple/64/${src}`; |
| 123 | ++ const datasourceToNoto = (name: string): string => |
| 124 | ++ `emoji_u${name.slice(0,-4).split("-").filter(c => c != "fe0f").join("_")}.png`; |
| 125 | ++ |
| 126 | ++ return `@noto-emoji-pngs@/${datasourceToNoto(src)}`; |
| 127 | + }; |
| 128 | + |
| 129 | + const imageQueue = new PQueue({ |
0 commit comments