tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

[Enhancement] "Replace emoji" should replace emoji without hyphen dashes :)

Open ADTC opened this issue 11 years ago • 25 comments

I don't add the hyphen to the smiley text :) to make it :-). Telegram Desktop currently only replaces the second one, but I would like it to replace the first one too.

I would love to make this change myself but I might break something not knowing anything more than basics of C++ and not knowing even the basics of Objective-C++. But I did some searches, and looks like you only need to copy-paste-reindent a bunch of lines here:

Add support:

Related issue: #116

_Sidenote:_ The findEmoji method looks like a maintenance nightmare... isn't there a better way, like some sort of a hash map with key-value pairs?

ADTC avatar Dec 09 '14 05:12 ADTC

:+1: because almost every other chat program I've used that does this doesn't require the hyphen nose.

Also, I totally agree that a hash/dictionary of some kind would probably be a much better way to implement this.

Sidenote: The ability to choose whether we see the iOS or Android emoji set would be awesome, but I'm sure that's extremely low priority. :wink:

joshsleeper avatar Feb 26 '15 23:02 joshsleeper

Yeah the current implementation is a dirty hack, but to change it to a hash/dictionary there must be some way to deal with keys of variable lengths.

About your sidenote, this project is for the desktop app. I don't think I would want to see a particular brand of mobile emoji :smile:

ADTC avatar Feb 27 '15 00:02 ADTC

@ADTC Oh I know this is the desktop app haha. Am I crazy, or are the default emoji used in Telegram right now (including the desktop app) the same as the ones iOS uses? That's the only reason I mentioned it. That said, desktop app or not, I still don't see anything wrong with having a toggle in the settings to choose which you prefer. :smile:

joshsleeper avatar Feb 27 '15 03:02 joshsleeper

I don't know man, but to me it looks like the exact set of emoji used in WhatsApp. I'm not sure if the set of emoji that WhatsApp uses on its Android client is actually borrowed from iOS... is it?

Telegram Desktop: Telegram Desktop Emots

WhatsApp Android: WhatsApp Android Emots

ADTC avatar Feb 27 '15 16:02 ADTC

http://emojipedia.org/apple-emoji-list/

Certainly looks like it! So it looks like use of that emoji set is just decently widespread, that's all. I'd still love support for the Android emoji at some point, but like I said, low priority.

joshsleeper avatar Feb 27 '15 20:02 joshsleeper

I had no clue that WhatsApp Android is using Apple emoji. I thought it's WhatsApp's own (since I never saw them anywhere else before). I love them and how they look. To be honest, I don't like Android emoji.. they look crap (unless you can show me pics of them looking awesome) :smile:

ADTC avatar Feb 28 '15 03:02 ADTC

Yea haha. Lucky for you I wasn't asking for mandatory Android emoji. You can keep your damned iOS/WhatsApp emoji as long as you'd like even they fulfilled my wish! :wink:

joshsleeper avatar Mar 02 '15 07:03 joshsleeper

Also, just fyi there's a pull request that (partially?) handles nose-less smilies. Linked to it above.

joshsleeper avatar Mar 02 '15 22:03 joshsleeper

Wait, if we have that 2D array map replaces[] in Telegram/SourceFiles/_other/genemoji.cpp, why do we still have the mess that is findEmoji in Telegram/SourceFiles/gui/emoji_config.cpp? Which one is actually used?

ADTC avatar Mar 03 '15 04:03 ADTC

After studying the code, I now understand that Telegram/SourceFiles/gui/emoji_config.cpp is actually an automatically generated source file, and Telegram/SourceFiles/_other/genemoji.cpp is the C++ program that generates this.

So we don't need to modify findEmoji, we only need to add the new mappings to replaces[] (as bjaskj did) and re-generate the emoji_config.cpp source file. Is that right?

Also I noticed that there's another replaces[] 2D array in Telegram/SourceFiles/boxes/emojibox.cpp. I think this is related to the "List of supported emojis" box shown in Settings (when View list is clicked). We should make sure this list is complete.

ADTC avatar Mar 03 '15 04:03 ADTC

I'd like to add to the discussion by suggesting that we not only add new mappings but the ability to and and remove new mappings.

arethsu avatar Jul 07 '15 16:07 arethsu

@SharpMelon How would it be helpful to let the user configure mappings? :)

ADTC avatar Jul 08 '15 07:07 ADTC

@ADTC I use emojis other than those currently available for automatic replacement.

Emoji Value
:smile: :)
:sparkles: ***
:expressionless: :l
:purple_heart: <3

Surely I may be one of few with such a need.

arethsu avatar Jul 08 '15 12:07 arethsu

Is there any way to customize the list of replacements?

gandalfsaxe avatar Aug 02 '15 15:08 gandalfsaxe

Hello everyone , i can not find the directory : Telegram/SourceFiles/... . can u help me?!

S4JJ4D avatar Sep 18 '15 09:09 S4JJ4D

@S4JJ4D https://github.com/telegramdesktop/tdesktop/tree/master/Telegram/SourceFiles

auchri avatar Sep 18 '15 09:09 auchri

@auchri Thank you ^_^ , are telegram sourcefiles stored in my computer too? i mean i would like to access those files and modify them if possible, but i can't find them ...

btw I'm new to programming and i just know basic C language.

S4JJ4D avatar Sep 18 '15 09:09 S4JJ4D

@S4JJ4D no :) That folder contains the source files, which are compiled to the binary, which is on your computer

auchri avatar Sep 18 '15 09:09 auchri

@auchri . when i type ":-)" in telegram it automatically changes to a specific emoji, all i want is to replace ":-)" with ":)" . is there any possible way to do that?!

there is a directory in the attached photo : /Users/antanubis/Tbuild/tdesktop/Telegram/... and as u see there is an cpp file in there, but this directory does not exist in my computer. screen shot 2015-09-18 at 1 57 31 pm

S4JJ4D avatar Sep 18 '15 09:09 S4JJ4D

See #780

auchri avatar Nov 01 '15 11:11 auchri