Esempio n. 1
0
static void
status_icon_notification_closed_cb (NotifyNotification *notification,
				    EmpathyStatusIcon  *icon)
{
	EmpathyStatusIconPriv *priv = GET_PRIV (icon);
	EmpathyNotificationClosedReason reason = 0;

#ifdef notify_notification_get_closed_reason
	reason = notify_notification_get_closed_reason (notification);
#endif
	if (priv->notification) {
		g_object_unref (priv->notification);
		priv->notification = NULL;
	}

	if (!priv->event) {
		return;
	}

	/* the notification has been closed by the user, see the
	 * DesktopNotification spec.
	 */
	if (reason == EMPATHY_NOTIFICATION_CLOSED_DISMISSED) {
		/* use an idle here, as this callback is called from a
		 * DBus signal handler inside libnotify, and we might call
		 * a *_run_* method when activating the event.
		 */
		g_idle_add ((GSourceFunc) activate_event, priv->event);
	} else {
		if (notification_server_supports_actions ()) {
			empathy_event_inhibit_updates (priv->event);
		}
	}
}
Esempio n. 2
0
static void
status_icon_notification_closed_cb (NotifyNotification *notification,
				    EmpathyStatusIcon  *icon)
{
	EmpathyStatusIconPriv *priv = GET_PRIV (icon);

	g_object_unref (notification);

	if (priv->notification == notification) {
		priv->notification = NULL;
	}

	if (!priv->event) {
		return;
	}

	/* inhibit other updates for this event */
	empathy_event_inhibit_updates (priv->event);
}