-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* "enrich" messages * display text and placeholder-emoji * download emoji-archive and unpack * display correct images * display emoji with the correct size * start multi-unit emoji decoding * support standard (looking at you, VS16) encoded multi-unit emojis * remove optional characters from emoji sequences and save them as new file * use removeAllSuchThat to filter optional characters * filter optional character from messages as well * prompt user to download emojis at startup * please linter * support notifications and massage-list-item * tests emojis are present * test correct creation of unicode runs * test emoji string has two emojis next to eachother * begin of decodeUnicodeRun test * test decodeUnicodeRun * test embedEmojisInto * please linter again * remove unneccessary asString * use local variable to convert runOrChar * test wether message display emojis correctly * test wether notifications display emojis correctly * refactoring * download emojis in background * please linter * assure emojis are present during testing * optimize findLongestRun by size cap * please linter + remove todo comment (loggedIn) + ci hashes * last ci hashes * please 5.2 * Credit OpenMoji * Update README.md * make screenshot tests expected failures * synchronous downloading and filename cache * Fix PR annotations * fixes for performance on mac, no more magic values, some formatting * please linter -.- * initialize filenames of TCUEmojiHelper to deal with asynchronous messages to filenames on first app start * fix areEmojisPresent * do not call super initialize in TCUEmojiHelper>>Initialize * load filenames on initialization to work across commits * properly load filenames on init * address remarks from PR, rename runs to something more specific * address hidden PR remarks * please linter * refactoring for PR * final PR fixes + comments + loading bar * fix typo * merge emoji changes together * force all emojis to be present * update filename cache after downloading Co-authored-by: Raphael Kunert <[email protected]> Co-authored-by: rsommerfeld <[email protected]>
- Loading branch information
1 parent
9b337de
commit 4276f5b
Showing
85 changed files
with
509 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/TelegramClient-Core.package/TCCWindowsClient.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/TelegramClient-UI.package/TCUChatListItem.class/instance/lastMessageText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
accessing | ||
lastMessageText | ||
|
||
^ TCUEmojiHelper embedEmojisInto: | ||
(self chat lastMessage condensedIntoOneLine | ||
truncateWithElipsisTo: self class defaultMessagePreviewLength) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/TelegramClient-UI.package/TCUEmojiHelper.class/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
A TCUEmojiHelper is a helper class for downloading emojis and decoding a string into a Text with embedded emojis. | ||
|
9 changes: 9 additions & 0 deletions
9
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/add.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
unicode matching | ||
add: aCharacter to: aCharAndEmojiCollection | ||
|
||
(aCharacter isOctetCharacter) ifTrue: [ | ||
aCharAndEmojiCollection add: aCharacter. | ||
] ifFalse: [ | ||
self addEmojiCodePoint: aCharacter codePoint printStringHex to: aCharAndEmojiCollection. | ||
]. | ||
^ aCharAndEmojiCollection |
8 changes: 8 additions & 0 deletions
8
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/addEmojiCodePoint.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
unicode matching | ||
addEmojiCodePoint: aHexString to: aCharAndEmojisCollection | ||
|
||
(aCharAndEmojisCollection isEmpty or: [aCharAndEmojisCollection last isCharacter]) ifTrue: [ | ||
aCharAndEmojisCollection add: OrderedCollection new | ||
]. | ||
aCharAndEmojisCollection last add: aHexString. | ||
^ aCharAndEmojisCollection |
6 changes: 6 additions & 0 deletions
6
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/areEmojisPresent.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
downloading | ||
areEmojisPresent | ||
|
||
^ self defaultDirectory exists | ||
and: [self defaultDirectory hasFiles] | ||
and: [self defaultDirectory fileNames size >= self defaultMinimumEmojiAmount] |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/defaultDirectory.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default values | ||
defaultDirectory | ||
|
||
^ FileDirectory default directoryNamed: self defaultFolderName |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/defaultEmojiFileExtension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default values | ||
defaultEmojiFileExtension | ||
|
||
^ '.png' |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/defaultFolderName.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default values | ||
defaultFolderName | ||
|
||
^ 'emojis' |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/defaultMaxEmojiLength.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default values | ||
defaultMaxEmojiLength | ||
|
||
^ 10 |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/defaultMinimumEmojiAmount.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default values | ||
defaultMinimumEmojiAmount | ||
|
||
^ 3678 |
7 changes: 7 additions & 0 deletions
7
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/defaultOptionalCharacters.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
default values | ||
defaultOptionalCharacters | ||
|
||
"Emoji are encoded differently, by different devices, applications and operating systems. | ||
The ground truth though lies close to an encoding without VARIATION SELECTOR-16 characters. | ||
Thats why we collect them here as optional characters." | ||
^ OrderedCollection newFrom: {'FE0F'} |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/defaultTextHeight.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default values | ||
defaultTextHeight | ||
|
||
^ TextStyle defaultFont pointSize * 2 |
16 changes: 16 additions & 0 deletions
16
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/downloadArchive.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
downloading | ||
downloadArchive | ||
|
||
| intermediatePath response | | ||
intermediatePath := FileDirectory default / 'emoji.zip'. | ||
FileStream fileNamed: intermediatePath fullName do: [ :stream | | ||
response := WebClient httpGet: self downloadUrl. | ||
stream | ||
binary; | ||
nextPutAll: response content. | ||
]. | ||
self defaultDirectory assureExistence. | ||
(ZipArchive new readFrom: intermediatePath fullName) | ||
extractAllTo: self defaultDirectory; | ||
close. | ||
(FileDirectory default / 'emoji.zip') delete. |
5 changes: 5 additions & 0 deletions
5
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/downloadUrl.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
downloading | ||
downloadUrl | ||
|
||
"Credits to OpenEmoji (https://openmoji.org)" | ||
^ 'https://github.com/hfg-gmuend/openmoji/releases/download/13.0.0/openmoji-72x72-color.zip' |
14 changes: 14 additions & 0 deletions
14
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/embedEmojisInto..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
utility | ||
embedEmojisInto: aString | ||
|
||
| charsAndEmojis | | ||
charsAndEmojis := self splitCharsAndEmojisIn: (self reencodeString: aString). | ||
^ charsAndEmojis | ||
inject: Text new | ||
into: [:aggregatedText :charOrEmojis | | ||
(charOrEmojis isCharacter) ifTrue: [ | ||
aggregatedText , charOrEmojis asText. | ||
] ifFalse: [ | ||
aggregatedText , (self textFrom: (self removeOptionalCharactersFrom: charOrEmojis)) | ||
] | ||
] |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/emojiExists..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
utility | ||
emojiExists: aString | ||
|
||
^ self fileNames includes: aString , self defaultEmojiFileExtension |
17 changes: 17 additions & 0 deletions
17
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/ensureEmojisArePresent.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
downloading | ||
ensureEmojisArePresent | ||
|
||
self areEmojisPresent ifFalse: [ | ||
'Downloading Emojis' | ||
displayProgressAt: Display center | ||
from: 0 | ||
to: 3 | ||
during: [ :bar | | ||
self downloadArchive. | ||
bar value: 1. | ||
self removeOptionalCharacters. | ||
bar value: 2. | ||
self loadFileNames. | ||
bar value: 3. | ||
] | ||
]. |
7 changes: 7 additions & 0 deletions
7
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/fileNameFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
utility | ||
fileNameFor: anEmoji | ||
|
||
^ (anEmoji | ||
inject: String new | ||
into: [:name :unit | name , unit , '-']) | ||
allButLast |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/fileNames..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
fileNames: aCollection | ||
|
||
fileNames := aCollection |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/fileNames.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
fileNames | ||
|
||
^ fileNames |
10 changes: 10 additions & 0 deletions
10
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/findFirstEmojiLengthIn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
utility | ||
findFirstEmojiLengthIn: anEmojiSequence | ||
|
||
anEmojiSequence size > self defaultMaxEmojiLength ifTrue: [ | ||
^ self findFirstEmojiLengthIn: (anEmojiSequence first: self defaultMaxEmojiLength) | ||
]. | ||
(anEmojiSequence size <= 1 or: [self emojiExists: (self fileNameFor: anEmojiSequence)]) ifTrue: [ | ||
^ anEmojiSequence size | ||
]. | ||
^ self findFirstEmojiLengthIn: anEmojiSequence allButLast |
15 changes: 15 additions & 0 deletions
15
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/formFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
utility | ||
formFor: aString | ||
|
||
| fileName form | | ||
fileName := aString , self defaultEmojiFileExtension. | ||
|
||
(self defaultDirectory | ||
fileExists: fileName) | ||
ifTrue: [ | ||
form := Form fromBinaryStream: (self defaultDirectory fileNamed: fileName). | ||
] ifFalse: [ | ||
form := MenuIcons squeakLogoIcon. | ||
]. | ||
form := form scaledToHeight: self defaultTextHeight. | ||
^ form |
6 changes: 6 additions & 0 deletions
6
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class initialization | ||
initialize | ||
|
||
self | ||
fileNames: OrderedCollection new; | ||
loadFileNames. |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/loadFileNames.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
downloading | ||
loadFileNames | ||
|
||
self fileNames: self defaultDirectory fileNames |
5 changes: 5 additions & 0 deletions
5
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/promptDownload.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
downloading | ||
promptDownload | ||
|
||
UIManager default inform: 'Emojis are not present in this image. They will be downloaded now.'. | ||
self ensureEmojisArePresent. |
6 changes: 6 additions & 0 deletions
6
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/reencodeString..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
utility | ||
reencodeString: aString | ||
|
||
"The Json library does not handle UTF-16 correctly. Reencode to work around this" | ||
"Note how JSON>>unescapeUnicode only looks at the next 4 characters after \u" | ||
^ (aString convertToEncoding: 'UTF-16') convertFromEncoding: 'UTF-16' |
16 changes: 16 additions & 0 deletions
16
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/removeOptionalCharacters.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
downloading | ||
removeOptionalCharacters | ||
|
||
"remove characters not sent by every client from all filenames" | ||
| filenames | | ||
filenames := self defaultDirectory fileNames. | ||
|
||
filenames do: [ :filename | | ||
| newFileName splitCollection | | ||
splitCollection := self removeOptionalCharactersFrom: (self splitFileName: filename). | ||
newFileName := (self fileNameFor: splitCollection) , self defaultEmojiFileExtension. | ||
(self defaultDirectory fileExists: newFileName) ifFalse: [ | ||
self defaultDirectory copyFileNamed: filename toFileNamed: newFileName. | ||
self defaultDirectory deleteFileNamed: filename. | ||
]. | ||
]. |
6 changes: 6 additions & 0 deletions
6
...ges/TelegramClient-UI.package/TCUEmojiHelper.class/class/removeOptionalCharactersFrom..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
utility | ||
removeOptionalCharactersFrom: aCollection | ||
|
||
"OpenMoji includes some optional characters in their filenames" | ||
"not all clients send them, so we remove them to ease matching" | ||
^ aCollection removeAllSuchThat: [ :code | self defaultOptionalCharacters includes: code] |
8 changes: 8 additions & 0 deletions
8
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/splitCharsAndEmojisIn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
unicode matching | ||
splitCharsAndEmojisIn: aString | ||
|
||
^ aString | ||
inject: OrderedCollection new | ||
into: [ :charsAndEmojis :char | | ||
self add: char to: charsAndEmojis. | ||
] |
4 changes: 4 additions & 0 deletions
4
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/splitFileName..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
downloading | ||
splitFileName: aString | ||
|
||
^ ((aString subStrings: '.') first subStrings: '-') asOrderedCollection |
7 changes: 7 additions & 0 deletions
7
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/textFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
utility | ||
textFor: aString | ||
|
||
"we are using value: 1 here as the method 'startOfHeader' isn't available on 5.2" | ||
^ Text | ||
string: (Character value: 1) asString | ||
attribute: (TextAnchor new anchoredMorph: (self formFor: aString)) |
11 changes: 11 additions & 0 deletions
11
packages/TelegramClient-UI.package/TCUEmojiHelper.class/class/textFrom..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
utility | ||
textFrom: anEmojiSequence | ||
|
||
| emojiLength | | ||
emojiLength := self findFirstEmojiLengthIn: anEmojiSequence. | ||
^ emojiLength > 0 ifTrue: [ | ||
(self textFor: (self fileNameFor: (anEmojiSequence first: emojiLength))) , | ||
(self textFrom: (anEmojiSequence allButFirst: emojiLength)) | ||
] ifFalse: [ | ||
Text new | ||
] |
34 changes: 34 additions & 0 deletions
34
packages/TelegramClient-UI.package/TCUEmojiHelper.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"class" : { | ||
"add:to:" : "pk 7/11/2021 19:13", | ||
"addEmojiCodePoint:to:" : "pk 7/17/2021 09:51", | ||
"areEmojisPresent" : "pk 7/17/2021 10:18", | ||
"defaultDirectory" : "pk 7/9/2021 16:10", | ||
"defaultEmojiFileExtension" : "pk 7/10/2021 16:01", | ||
"defaultFolderName" : "RK 6/29/2021 11:44", | ||
"defaultMaxEmojiLength" : "pk 7/9/2021 16:03", | ||
"defaultMinimumEmojiAmount" : "pk 7/17/2021 10:18", | ||
"defaultOptionalCharacters" : "pk 7/6/2021 09:49", | ||
"defaultTextHeight" : " 7/17/2021 09:37:29", | ||
"downloadArchive" : "pk 7/17/2021 09:49", | ||
"downloadUrl" : "RK 6/29/2021 11:30", | ||
"embedEmojisInto:" : "pk 7/11/2021 19:17", | ||
"emojiExists:" : "pk 7/11/2021 19:20", | ||
"ensureEmojisArePresent" : "pk 7/17/2021 10:54", | ||
"fileNameFor:" : "pk 7/10/2021 16:33", | ||
"fileNames" : "pk 7/10/2021 15:35", | ||
"fileNames:" : "pk 7/10/2021 15:35", | ||
"findFirstEmojiLengthIn:" : "pk 7/17/2021 09:54", | ||
"formFor:" : "pk 7/10/2021 16:01", | ||
"initialize" : "pk 7/10/2021 16:34", | ||
"loadFileNames" : "pk 7/10/2021 15:36", | ||
"promptDownload" : "pk 7/17/2021 09:47", | ||
"reencodeString:" : "pk 7/11/2021 19:19", | ||
"removeOptionalCharacters" : "pk 7/10/2021 16:23", | ||
"removeOptionalCharactersFrom:" : "pk 7/17/2021 09:55", | ||
"splitCharsAndEmojisIn:" : "pk 7/17/2021 09:52", | ||
"splitFileName:" : "pk 7/10/2021 16:12", | ||
"textFor:" : "pk 7/10/2021 16:34", | ||
"textFrom:" : "pk 7/17/2021 09:58" }, | ||
"instance" : { | ||
} } |
Oops, something went wrong.