/*
 * call-seq:
 *      update(summ, msg, icon)
 *
 * summ = The new summary text (required)
 *
 * msg = The new body text or nil
 *
 * icon = The new icon or nil
 *
 * This won't send the update out and display it on the screen.
 * For that, you will need to call the Notification#show method.
 *
 * Returns TRUE if ok, FALSE otherwise
 */
static VALUE
_wrap_notification_update(VALUE self, VALUE summ, VALUE msg, VALUE icon)
{
  NotifyNotification *n = NOTIFY_NOTIFICATION(RVAL2GOBJ(self));
  char *nsumm = NIL_P(summ) ? NULL : StringValuePtr(summ);
  char *nmsg = NIL_P(msg) ? NULL : StringValuePtr(msg);
  char *nicon = NIL_P(icon) ? NULL : StringValuePtr(icon);

#ifdef DEBUG
  if(NOTIFY_IS_NOTIFICATION(n))
    rb_warn("update, ok");
  else
    rb_warn("update, no ok");
#endif

  if(nsumm == NULL || *nsumm == '\0')
    rb_raise(rb_eArgError, "REQUIRED: the `summ` field");

  if(notify_notification_update(n, nsumm, nmsg, nicon) == TRUE)
    return Qtrue;

  return Qfalse;
}