commit 5d7811b7b2f08b9215e771975f941681c870210b
Author: Ken VanDine <ken.vandine@canonical.com>
Date:   Tue Jan 19 10:53:02 2010 -0500

     * Adds support for the "x-canonical-append" hint from notify-osd, which appends notifications when possible.  bz# 607446
     * Only attach the notification to the status icon if the status icon is displayed.

diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index 2dabc54..caaf54b 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -158,13 +158,20 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
 		if (priv->event->message != NULL)
 			message_esc = g_markup_escape_text (priv->event->message, -1);
 
-		if (priv->notification) {
+		if ((priv->notification) && (!empathy_notify_manager_has_capability (priv->notify_mgr,
+							EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND))) {
 			notify_notification_update (priv->notification,
 						    priv->event->header, message_esc,
 						    NULL);
 		} else {
-			priv->notification = notify_notification_new_with_status_icon
-				(priv->event->header, message_esc, NULL, priv->icon);
+			if (gtk_status_icon_get_visible (priv->icon)) {
+				priv->notification = notify_notification_new_with_status_icon
+					(priv->event->header, message_esc, "notification-message-im", priv->icon);
+			} else {
+				priv->notification = notify_notification_new
+					(priv->event->header, message_esc, "notification-message-im", NULL);
+			}
+
 			notify_notification_set_timeout (priv->notification,
 							 NOTIFY_EXPIRES_DEFAULT);
 
@@ -192,6 +199,11 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
 			g_object_unref (pixbuf);
 		}
 
+		if (empathy_notify_manager_has_capability (priv->notify_mgr, 
+								EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND)) {
+			notify_notification_set_hint_string (priv->notification,
+				EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND, "");
+		}
 		notify_notification_show (priv->notification, NULL);
 
 		g_free (message_esc);
