Saturday, April 28, 2012

GSoC: The start of something ....

Okay, this is a little late considering the list of accepted proposals was published on Tuesday (Monday for some), but I've been a little busy with Uni work lately.

So, I think drdanz covered the official description of my project in his blog, which was to
"...create a completely asynchronous modular and extensible system that enriches messages before they’re displayed to the user. These includes embedding images and videos from links, Translating messages, (re)-formatting them nicely, reading out loud etc."

Let me go into a bit of detail on what that actually means. Let's take for example the the Image plugin in Kopete: when a user sends a link to an image it downloads downloads, scales and embeds the image directly in the chat window. Before my friends found out about this and abused it (and even afterwards when they eventually got bored of it), this was a very useful plugin. It made the conversation much more interesting to look at (instead of being a dull wall of text and timestamps), and it meant that most times I didn't have to actually click on it and open a browser to see what they meant.

I wanted this functionality in KTp, so I quickly tweaked/hacked the code that processes incomming messages in ktp-text-ui to stick the link in an <img> tag. So the end result looked like this:
And a another screenshot here.

I apologize for all the memes, but they're the only 2 screenshots I have of it and I honestly don't have the time to search through all the branches in all the clone/scratch repos to look for that code again.

But suffice to say, it had a few drawbacks like the fact that you couldn't disable them. And the code consisted mostly of a hack, so it clearly wasn't in a state to ship. 

Rather than keeping it in a branch and rebase-ing after every update so it stays just for me, I thought I may as well do this properly and make something useful for everyone.

Thus the idea of a plugin based Message Filter system was born. 
I noticed that there were quite a few things that would be useful for a text-ui to do besides just embed images. A lot of clients like gtalk and facebook do embed things to make their chat more interesting for people. 

So, inspired by the them and the existing plugins in Kopete, I came up with a list of 'filters' I could build. (I'm copy-pasting this list straight from my proposal - if the people reviewing it could understand what they meant, I'm sure you guys can ;-)
  • Web Integration 
    • Bookmarks - automatically make bookmarks of recieved links
    • Image - embed previews of links to images in chat
    • YouTube - embed or generate previews for youtube links in chat
    • Bugzilla - (or other KDE specific stuff) show title and description of link to bug
    • Wikipedia - Embed first paragraph (and image) from links to Wikipedia
    • Description - Embed title and image (like facebook and google+ does when sharing) of an any incoming link.
    • Mailto - Replace email addresses in messages with appropriate mailto: links.
  • Accessibility
    • Translator - translates incoming and outgoing messages to predefined languages
    • Jouvie plugin - option to automatically read out messages
  • Extensibility
    • Pipes - pipe messages through external program
    • Auto-Replace plugin - replace user defined keywords in messages
    • Search Commands - replaces commands like ‘lmgtfy:dbus tubes’ with ‘’ before sending.
  • Enhanced Display
    • Highlight - highlight messages based on criteria
    • Latex - renders incoming latex in window 
    • GTalk Formatting - turn “_this_ -or- *this*” into “this or this”

Right, I have some stuff working so far, which I'll blog about later. So hopefully by the end of this project your chat window would be much more 'enriched'.

PS: Feel free to suggest some relatively easy that could be added to that list. (On the off chance that I might finish early).