Tox / Tox-Client-Standard

A standard for Tox client interoperability and security
https://www.gitbook.com/book/tox/tox-client-standard/details
49 stars 15 forks source link

Emoticons standard format ? #30

Open SkyzohKey opened 8 years ago

SkyzohKey commented 8 years ago

Introduction: The TCS should include a chapter on the emoticons packs storage. The emoticons packs would be stored in ~/.config/tox/emoticons/. This would permit differents clients to use the same packs and aswell save user's disk-space by not having 10 copy of the same emoticons packs.

I think we should make a strict format in order to ensure a good clients compatibility. See the following examples.

PoC for emoticon pack structure:

~/.config/tox/ || %APPDATA%/tox/ || ~/Library/Application Support/Tox/
emoticons/
-| twitter_emoji/
  -| package.json // A file that would map each image to the corresponding text-smiley.
  -| preview.png  // An image that would be used to preview a specific pack in clients.
  -| License      // The emoticon pack license.
  -| images/      // Here stands all the emoticons mapped in `package.json`
    -| smile.png
    -| blush.png
    -| thumbleweed.gif
    -| ...

A package.json file would look like this:

@field  author       The author of the emoticon pack.
@field  description  The description of the emoticon pack.
@field  url          The url from where the pack is available for downloading.
@field  license      The license of the emoticon pack.
@fiels  type         The pack type. Accepts "png", "gif", "mixed".
                     -- Where "mixed" is both "png" and "gif".
@field  map          A JSON array mapping images to strings.
{
  "author": "Pack author",
  "description": "Lorem impsum dolores sit amet.",
  "url": "https://url2download.thepack.tld",
  "license": {
    "type": "MIT",
    "online": "https://opensource.org/licenses/MIT"
  },
  "type": "mixed",

  "map": {
    "smile.png": [
      ":)",
      ":-)",
      "(smile)"
    ],
    "blush.png": [
      ":blush:",
      ":$"
    ],
    "thumbleweed.gif": ":thumbleweed:"
  }
}

Conclusion: I think that we should stop to make clients without carying of compatibility with others and define formats for emoticons, stickers, friends profiles, avatars, clients settings, etc. All of this would be stored in the ~/.config/tox/ folder to centralize all the Tox's stuffs inside a single folder.
This would permit to just copy the tox/ dir to get the same Tox on another computer.

Zer0-One commented 8 years ago

On one hand, I like the idea of using JSON for a manifest, because you can then use a JSON schema to ensure that the document is properly formatted, and most libraries will probably handle all of that automagically. On the other hand, some clients aren't going to want to implement JSON. Can we simplify package.json into a format that we can more easily parse line by line?

Also, I don't think clients are going to want to read emoticons out of an archive by themselves, so you should probably specify twitter_emoji instead of twitter_emoji.zip, or specify where the archive is meant to be extracted.

SkyzohKey commented 8 years ago

Yeah, i'll edit with the folder type instead of .zip. Maybe that clients could perform the extraction themselves when the user drag&drop the .zip pack on the window then place the output folder in the emoticons/ folder.

About JSON: Maybe YAML so ?

ProMcTagonist commented 8 years ago

qTox currently uses the KDE emoticon format, which I think is actually a freedesktop thing. Something to take into account. I don't see much emoticon usage in other applications so I don't think incredible harm would come from switching to an internal format, except in the (rare?) case where someone has system emoticons and wants them to show up in Tox. We have to decide if we care about that or not.

Also,

we should ... define formats for emoticons, stickers, friends profiles, avatars, clients settings, etc.

Agreed. Been working on it for stickers, so I'll be lurking and copying any great ideas from here over to the article spec.