Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] [API] expose emoji convertion #11348

Closed
6543 opened this issue May 9, 2020 · 4 comments
Closed

[Feature] [API] expose emoji convertion #11348

6543 opened this issue May 9, 2020 · 4 comments

Comments

@6543
Copy link
Member

6543 commented May 9, 2020

#11032 added UTF-8 emoji support - add api to fully use this in clients

proposal: for miscellaneous

add POST /emoji/utf to convert an alias to utf
and POST /emoji/alias to get (first alias or alias list?)

idears and thoughts are welcome :)

@6543
Copy link
Member Author

6543 commented May 9, 2020

modules/emoji/emoji.go has:

// FromCode retrieves the emoji data based on the provided unicode code (ie,
// "\u2618" will return the Gemoji data for "shamrock").
func FromCode(code string) *Emoji {

// FromAlias retrieves the emoji data based on the provided alias in the form
// "alias" or ":alias:" (ie, "shamrock" or ":shamrock:" will return the Gemoji
// data for "shamrock").
func FromAlias(alias string) *Emoji {

// ReplaceCodes replaces all emoji codes with the first corresponding emoji
// alias (in the form of ":alias:") (ie, "\u2618" will be converted to
// ":shamrock:").
func ReplaceCodes(s string) string {

// ReplaceAliases replaces all aliases of the form ":alias:" with its
// corresponding unicode value.
func ReplaceAliases(s string) string {

@silverwind
Copy link
Member

Can't clients just use a existing client-side library that does this conversation (which is mostly the same across libraries)?

@septatrix
Copy link

Can't clients just use a existing client-side library that does this conversation (which is mostly the same across libraries)?

Yes I agree, AFAIK we use the aliases from the github gemoji gem or more specifialy the aliases from the included json file https://github.com/github/gemoji/blob/master/db/emoji.json. Using the JSON file to get the corresponding data is easy in most languages and should not require an extra API endpoint.

@6543
Copy link
Member Author

6543 commented May 15, 2020

closed because clients can handle it itself ...

@6543 6543 closed this as completed May 15, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants