Searching for custom emoji

merge-requests/30/head
Bob Mottram 2021-11-01 23:39:20 +00:00
parent 9bafdef7bf
commit 424ba85942
2 changed files with 7 additions and 8 deletions

View File

@ -905,8 +905,7 @@ def addHtmlTags(baseDir: str, httpPrefix: str,
customEmojiDict = \
loadJson(baseDir + '/emojicustom/emoji.json')
if customEmojiDict:
newEmojiDict = dict(emojiDict, **customEmojiDict)
emojiDict = newEmojiDict
emojiDict = dict(emojiDict, **customEmojiDict)
# print('TAG: looking up emoji for :' + wordStr2 + ':')
_addEmoji(baseDir, ':' + wordStr2 + ':', httpPrefix,

View File

@ -71,17 +71,17 @@ def htmlSearchEmoji(cssCache: {}, translate: {},
# does the lookup file exist?
if not os.path.isfile(emojiLookupFilename):
emojiForm += '<center><h5>' + \
translate['No results'] + '</h5></center>'
emojiForm += htmlFooter()
return emojiForm
if not os.path.isfile(customEmojiLookupFilename):
emojiForm += '<center><h5>' + \
translate['No results'] + '</h5></center>'
emojiForm += htmlFooter()
return emojiForm
emojiJson = loadJson(emojiLookupFilename)
if emojiJson:
if os.path.isfile(customEmojiLookupFilename):
customEmojiJson = loadJson(customEmojiLookupFilename)
newEmojiJson = dict(emojiJson, **customEmojiJson)
emojiDict = newEmojiJson
emojiJson = dict(emojiJson, **customEmojiJson)
results = {}
for emojiName, filename in emojiJson.items():
if searchStr in emojiName: