Jump to page content

HTML form controls in Adium (and iChat)

Latest information | Introduction | How it works | How long do the effects last? | FAQ | Credits

Latest information

(As of 24th June 2005) Apparently, this issue has now been resolved in the latest versions of Adium. However, Apple’s own iChat AV still has the same problem (as confirmed by macmcseboy), meaning that you can still toy with iChat users. Quite which current AIM clients still send unescaped messages I have absolutely no idea; I confirmed the problem in iChat by messaging macmcseboy using classical AIM 4.3.1232 (which is old enough to be found in a museum); he was using iChat AV 3.0 (build 388). The fun is not over yet though.

To save rewriting the entire page (and preserve its historical value if and when iChat AV is also fixed), substitute “iChat AV” or “older Adia” for “Adium” in all the text that follows; the two programs share the exact same problem.

Introduction

This is a harmless known issue with the Adium instant-messaging client, which can be employed by AIM users to good effect, to amuse their Adium-using friends. Due to the way AIM and Adium work, it is possible to type HTML into AIM, and have Web form controls appear in the other users’ Adium windows. A fun way to astonish your friends.

Because many of you won’t know any HTML, I have shown some code examples below. Sections in code face are what you type into AIM instant messages, and sections of code in red type demonstrate where you can put in custom text (you do not need to actually type them in red). And you might want to read the FAQ.

Button <input type="button" value="Initiate self-destruct">
(button)
The value property specifies the text on the button; change it to say whatever you like.
Pop-up menu I prefer using <select> <option>Macintoshes</option> <option>PCs</option> </select>
(pop-up menu)
Each <option>…</option> item specifies one option on the menu; you can have as many as you like. The <select>…</select> tags enclose the list of menu options.
Text box <input type="text">
(text box)
To prefill the box with some text, add a value property to the tag, e.g.
<input type="text" value="some text">

If you want to put line breaks anywhere in your message, type <br> where you want the new line to start. For example, the following code goes down to a new line, and displays two text entry controls one after the other.
e.g. <br>Name: <input type="text"><br>Age: <input type="text">
(text boxes and line breaks)

How it works

AOL chose to use HTML for specifying the formatting of instant messages sent with AIM. Because AIM is a proprietary system, AOL must have felt that it has no need to convert (known as ‘escaping’) HTML entered in by the user into inactive HTML – the client software knows which HTML tags to process (those that AIM uses internally), which to delete, and which to display on the screen as typed. For example, Classic Mac AIM will delete any <table> tags from my instant messages, but it will leave <span> tags in exactly as typed. If I use tags such as <b>…</b>, it will actually interpret that internally and make the enclosed text bold, and delete the tags from the message. For example, AIM would display “<b>some bold text</b>” as “some bold text”.

Of course, Web developers trying to communicate over AIM to do their work will find it a real pain to enter HTML into it, due to AIM interpreting or deleting much of it. On Web pages, the way to quote HTML without the browser interpreting it, is to escape it. That is to say, you replace the special HTML symbols of < and > with the codes &lt; and &gt; (which stand for “less-than” and “greater-than”, which are the names of the symbols). Thus, to put “<b>some bold text</b>” on a Web page, the HTML would have to be “&lt;b&gt;some bold text&lt;/b&gt;” otherwise the browser would give you bold text and not HTML tags on the screen.

In order to give users the freedom to enter as much HTML as they want into instant messages, AIM should automatically escape all HTML entered by a user. For the most part, it doesn’t make a difference as the average user won’t be doing that. However, for those users who try to, things can go somewhat spoggly. The solution is to manually escape all HTML by hand, which gets very tedious very fast.

Now, how does this affect Adium? The creator of Adium didn’t want to have to write his own HTML parser to interpret and process all the HTML in instant messages, so instead he programmed Adium to use Apple’s own HTML rendering system, which is supplied with Mac OS. The problem stems from the fact that Apple’s HTML rendering system does not know how to handle AIM messages – it interprets each and every HTML tag it receives. Had AIM escaped all the tags that were typed in by the user, then the message would appear verbatim. Instead, any HTML you entered gets interpreted, and that includes form controls.

Adium does in fact escape all HTML entered into your own messages, which means that you cannot use this trick between two Adium clients – one client must be running AIM in order for HTML tags to be preserved for Adium to process. This also means that you can’t experiment and practice entering HTML tags by messaging yourself.

How long do the effects last?

The issue appears to be fixed in current Adium builds. However, it is still present in iChat AV. I imagine that it will be fixed in iChat too eventually, but I cannot say when. More realistically, the problem will be gone when there are no easily-accessible AIM clients left that can send broken instant messages in the first place! I am not sure that any current AIM clients still possess that issue.

FAQ

Q. Do you know of any tricks for use on users of AOL’s AIM client?
A. Not really, no – I only know about the tricks listed above. I assume that AOL’s clients make use of proprietary code for showing instant messages which have no provision for anything fun. You can, though, insert horizontal rules into messages with <hr> and maybe one or two other HTML elements, although probably nothing impressive. Have a play.

Q. Is it possible to use Adium to send other people such messages?
A. No, you have to be using an AIM client which does not escape outgoing HTML, such as those written by AOL (possibly only older versions now). If anyone tells me of any other client which can be used, I will make the information known here.

Q. How did you discover this?
A. I sent an Adium-using friend a message one day at work, and she exclaimed that it had made a “menu bar”. Curious as to what had happened, I asked her for a screenshot and she sent me one:

Adium displaying a pop-up menu

I can no longer remember what I typed in, but it didn’t come out quite like I intended!

Finally

Thanks to Gowron999 for taking all the screenshots for me. Aranor8 for informing me that it works in iChat AV too.