diff options
author | Alban Crequy <alban.crequy@collabora.co.uk> | 2010-10-06 13:12:32 +0200 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-01-31 15:31:11 +0000 |
commit | 4d93cc858c3ecc70ae6704fb6e4b68dc9af5420a (patch) | |
tree | e7e56d1b359246d7f78f3efbf0fc6d782f17ab24 | |
parent | ab058c4a3167fdc7cc5157572f348d6dc6725c98 (diff) | |
download | dbus-4d93cc858c3ecc70ae6704fb6e4b68dc9af5420a.tar.gz |
Implement message type in match_rule_to_string
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=24307
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r-- | bus/signals.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/bus/signals.c b/bus/signals.c index 51c2216c..c85a88df 100644 --- a/bus/signals.c +++ b/bus/signals.c @@ -135,9 +135,36 @@ match_rule_to_string (BusMatchRule *rule) if (rule->flags & BUS_MATCH_MESSAGE_TYPE) { - /* FIXME make type readable */ - if (!_dbus_string_append_printf (&str, "type='%d'", rule->message_type)) - goto nomem; + if (rule->message_type == DBUS_MESSAGE_TYPE_INVALID) + { + if (!_dbus_string_append_printf (&str, "type='INVALID'")) + goto nomem; + } + else if (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_CALL) + { + if (!_dbus_string_append_printf (&str, "type='method_call'")) + goto nomem; + } + else if (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_RETURN) + { + if (!_dbus_string_append_printf (&str, "type='method_return'")) + goto nomem; + } + else if (rule->message_type == DBUS_MESSAGE_TYPE_ERROR) + { + if (!_dbus_string_append_printf (&str, "type='error'")) + goto nomem; + } + else if (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL) + { + if (!_dbus_string_append_printf (&str, "type='signal'")) + goto nomem; + } + else + { + if (!_dbus_string_append_printf (&str, "type='%d'", rule->message_type)) + goto nomem; + } } if (rule->flags & BUS_MATCH_INTERFACE) |