diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-17 23:24:44 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-17 23:24:44 -0500 |
commit | 4fd7f9d75e4edd42f559fc8653f8f82bf275e865 (patch) | |
tree | e0c9c1c2b7d2002d48bc094601424f3729db59b7 /emojis.cpp | |
parent | 744e42892d3da3247df4e04f0d97e93e6d50799a (diff) | |
download | abaddon-portaudio-4fd7f9d75e4edd42f559fc8653f8f82bf275e865.tar.gz abaddon-portaudio-4fd7f9d75e4edd42f559fc8653f8f82bf275e865.zip |
put tooltips on reactions
Diffstat (limited to 'emojis.cpp')
-rw-r--r-- | emojis.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -25,6 +25,7 @@ bool EmojiResource::Load() { if (shortcode_strlen > 0) { std::fread(shortcode.data(), shortcode_strlen, 1, m_fp); m_shortcode_index[shortcode] = pattern_hex; + m_pattern_shortcode_index[pattern_hex] = shortcode; } std::fread(&len, 4, 1, m_fp); @@ -120,6 +121,13 @@ void EmojiResource::ReplaceEmojis(Glib::RefPtr<Gtk::TextBuffer> buf, int size) { } } +std::string EmojiResource::GetShortCodeForPattern(const Glib::ustring &pattern) { + auto it = m_pattern_shortcode_index.find(pattern); + if (it != m_pattern_shortcode_index.end()) + return it->second; + return ""; +} + const std::vector<Glib::ustring> &EmojiResource::GetPatterns() const { return m_patterns; } |