* return copy;
* }
* ]|
- * If the returned #GDBusMessage is different from @message and the
- * serial number is unset (e.g. zero), then @message's serial number
- * will be used on the returned message (so in this case the returned
- * message must be unlocked). Additionally, if the returned message
- * cannot be sent on @connection, then a warning is logged to
- * <emphasis>standard error</emphasis>.
+ * If the returned #GDBusMessage is different from @message and cannot
+ * be sent on @connection (it could use features, such as file
+ * descriptors, not compatible with @connection), then a warning is
+ * logged to <emphasis>standard error</emphasis>. Applications can
+ * check this ahead of time using g_dbus_message_to_blob() passing a
+ * #GDBusCapabilityFlags value obtained from @connection.
*
* Returns: (transfer full) (allow-none): A #GDBusMessage that will be freed with
* g_object_unref() or %NULL to drop the message. Passive filter
*
* Copies @message. The copy is a deep copy and the returned
* #GDBusMessage is completely identical except that it is guaranteed
- * to not be locked and the serial will be set to 0.
+ * to not be locked.
*
* This operation can fail if e.g. @message contains file descriptors
* and the per-process or system-wide open files limit is reached.
ret->flags = message->flags;
ret->byte_order = message->byte_order;
ret->major_protocol_version = message->major_protocol_version;
+ ret->serial = message->serial;
#ifdef G_OS_UNIX
if (message->fd_list != NULL)
*/
if (data != NULL)
{
- guint32 old_serial;
GDBusMessage *old_message;
guchar *new_blob;
gsize new_blob_size;
GError *error;
old_message = data->message;
- old_serial = g_dbus_message_get_serial (old_message);
data->message = _g_dbus_worker_emit_message_about_to_be_sent (worker, data->message);
if (data->message == old_message)
{
else
{
/* filters altered the message -> reencode */
-
- if (g_dbus_message_get_serial (data->message) == 0)
- g_dbus_message_set_serial (data->message, old_serial);
-
error = NULL;
new_blob = g_dbus_message_to_blob (data->message,
&new_blob_size,
g_assert_cmpint (G_OBJECT (m)->ref_count, ==, 1);
g_assert_cmpint (G_OBJECT (copy)->ref_count, ==, 1);
- g_assert_cmpint (g_dbus_message_get_serial (copy), ==, 0);
+ g_assert_cmpint (g_dbus_message_get_serial (copy), ==, g_dbus_message_get_serial (m));
g_assert_cmpint (g_dbus_message_get_byte_order (copy), ==, g_dbus_message_get_byte_order (m));
g_assert_cmpint (g_dbus_message_get_flags (copy), ==, g_dbus_message_get_flags (m));
g_assert_cmpint (g_dbus_message_get_message_type (copy), ==, g_dbus_message_get_message_type (m));