meebey / smuxi

Smuxi is an user-friendly and free IRC client for Linux, Windows and Mac OS X based on GNOME / GTK+
https://smuxi.im/
GNU General Public License v2.0
172 stars 46 forks source link

Show an image in the frontend when given an image message part #206

Closed carlosmn closed 9 years ago

carlosmn commented 9 years ago

This is the base for an emoji branch I've been carrying locally for a while. This is just the bit to show the image, rather than the full implementation, as they're somewhat different concerns.

Right now, this assumes that the engine knows where the images are located, though this is clearly only going to work for a local engine. We will need an image provider (or multiple) of some sort on the frontend which knows how to translate a relative path from the engine.

This still doesn't have the url-handling ones (which would be used for e.g. twitter), as that's not something I have in my fork yet. I think we should be able to use Gdk.Pixbuf(Stream) or Gtk.Pixbuf(byte[]) with the data from the server. This however raises the question of whether we want to wait for an image from the net while rendering (I hear sometimes the Internet isn't quick).

carlosmn commented 9 years ago

After some discussion on IRC, we'll using smuxi-emoji:// as the image's URI so the frontend knows to search in its own paths.

We already have some code to download and cache icons, so we'll need to extract https://github.com/meebey/smuxi/blob/master/src/Frontend-GNOME/Views/Chats/ProtocolChatView.cs#L217 and make it more generic.

carlosmn commented 9 years ago

Currently the emoji path is hard-coded to some I have locally, but we need to figure out a source of redistributable emoji since most sets are not under a free license.

There's emojindex (https://github.com/emojidex) which are redistributable. However they are not under a Free license (https://www.emojidex.com/emojidex/emojidex_open_license) but it should be close enough.

carlosmn commented 9 years ago

Emojione (https://github.com/Ranks/emojione) has some emoji under a free license. But we'll likely use their CDN to download them on first use. We'll need to generate the mapping between the short name and the unicode codepoint from their json file and then use the IconCache to download them.

meebey commented 9 years ago

also travis-ci needs attention: Emojione.cs(34,17): error CS0103: The name map' does not exist in the current context Emojione.cs(35,24): error CS0165: Use of unassigned local variableval'

meebey commented 9 years ago

Looks like you forgot to add GeneratedEmojione.cs to the repository.