<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -19,6 +19,7 @@ setup(
     install_requires = [
         #'TwistedCore&gt;=8.2.0',
         'py-Growl&gt;=0.0.7',
+        'simplejson&gt;=2.0.0',
     ],
     dependency_links = [
         'http://tmrc.mit.edu/mirror/twisted/Core/8.2/TwistedCore-8.2.0.tar.bz2',</diff>
      <filename>setup.py</filename>
    </modified>
    <modified>
      <diff>@@ -2,26 +2,31 @@ from twisted.words.protocols.jabber import client
 from twisted.words.protocols.jabber.jid import JID
 from twisted.words.xish import domish, xmlstream
 from twisted.internet.defer import Deferred
+from twisted.web.client import getPage
 
 from Growl import GrowlNotifier, Image
 
 import string, base64
+import simplejson
 
 avatar_cache = dict()
 
 def sendGrowl(message, icon=None):
     g = GrowlNotifier(notifications=['yapper'])
     g.register()
-    if message[0] == '!':
-        sticky = True
-        message = message[1:]
+    if type(message) is dict:
+        g.notify('yapper', message.get('title', ''), message['text'], sticky=message.get('sticky', False), icon=icon)
     else:
-        sticky = False
-    if message.count(':') &gt; 0:
-        title, message = string.split(message, ':', 1)
-    else:
-        title = ''
-    g.notify('yapper', title.strip(), message.strip(), sticky=sticky, icon=icon)
+        if message[0] == '!':
+            sticky = True
+            message = message[1:]
+        else:
+            sticky = False
+        if message.count(':') &gt; 0:
+            title, message = string.split(message, ':', 1)
+        else:
+            title = ''
+        g.notify('yapper', title.strip(), message.strip(), sticky=sticky, icon=icon)
 
 def getAvatar(stream, jid):
     if jid in avatar_cache:
@@ -66,11 +71,15 @@ def receivedMessage(stream, x):
     for e in x.elements():
         if e.name == &quot;body&quot; and x.hasAttribute('type') and x['type'] == 'chat':
             message = str(e)
-            result = getAvatar(stream, x['from'])
-            if isinstance(result, Deferred):
-                result.addCallback(lambda x: sendGrowl(message, x))
+            avatar_result = getAvatar(stream, x['from'])
+            if message.strip()[0] == '{':
+                message = simplejson.loads(message)
+            if type(message) is dict and 'icon' in message:
+                getPage(message['icon']).addCallback(lambda x: sendGrowl(message, Image.imageWithData(x)))
+            elif isinstance(avatar_result, Deferred):
+                avatar_result.addCallback(lambda x: sendGrowl(message, x))
             else:
-                sendGrowl(message, result)
+                sendGrowl(message, avatar_result)
             
 def receivedPresence(stream, x):
     if x.hasAttribute('type') and x['type'] == 'subscribe':</diff>
      <filename>yapper/core.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c96fde260a0d861a363d6221f86ad3109cf3b4af</id>
    </parent>
  </parents>
  <author>
    <name>Jeff Lindsay</name>
    <email>progrium@gmail.com</email>
  </author>
  <url>http://github.com/progrium/yapper/commit/05a5571feb28637147be60dfbceebce7206ea7bf</url>
  <id>05a5571feb28637147be60dfbceebce7206ea7bf</id>
  <committed-date>2009-06-27T09:11:20-07:00</committed-date>
  <authored-date>2009-06-27T09:11:20-07:00</authored-date>
  <message>added json with remote icons. too easy!</message>
  <tree>9d90ee8cf031fb21d0b555a16dc079537d91f18a</tree>
  <committer>
    <name>Jeff Lindsay</name>
    <email>progrium@gmail.com</email>
  </committer>
</commit>
