From 35a3dedeb8b9670721bd363031083cc2c90fa085 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 29 May 2017 06:38:49 -1000 Subject: Implement custom emoji rendering and uploading --- lib/app.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/app.js') diff --git a/lib/app.js b/lib/app.js index 825bd91..10a8a07 100644 --- a/lib/app.js +++ b/lib/app.js @@ -38,6 +38,7 @@ function App(sbot, config) { this._getAbout.bind(this)) this.unboxContent = memo({cache: lru(100)}, sbot.private.unbox) this.reverseNameCache = lru(500) + this.reverseEmojiNameCache = lru(500) this.unboxMsg = this.unboxMsg.bind(this) @@ -233,6 +234,10 @@ App.prototype.getReverseNameSync = function (name) { return id } +App.prototype.getReverseEmojiNameSync = function (name) { + return this.reverseEmojiNameCache.get(name) +} + App.prototype.getNameSync = function (name) { var about = this.aboutCache.get(name) return about && about.name -- cgit v1.2.3