Bug 55096

Summary: Provide GVariant-based access to TpMessage
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: medium CC: guillaume.desmottes
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 30422    
Attachments: tp_message_dup_part: add
tp_message_set_variant: add

Description Simon McVittie 2012-09-19 14:42:57 UTC
+++ This bug was initially created as a clone of Bug #30422 +++
Comment 1 Simon McVittie 2012-09-19 14:43:30 UTC
Created attachment 67390 [details] [review]
tp_message_dup_part: add
Comment 2 Simon McVittie 2012-09-19 14:44:45 UTC
Created attachment 67391 [details] [review]
tp_message_set_variant: add
Comment 3 Guillaume Desmottes 2012-09-26 11:21:58 UTC
Comment on attachment 67390 [details] [review]
tp_message_dup_part: add

Review of attachment 67390 [details] [review]:
-----------------------------------------------------------------

::: tests/dbus/cm-message.c
@@ +96,5 @@
>        "Badger");
>  
> +  part_vardict = tp_message_dup_part (msg, 1);
> +  g_assert_cmpstr (g_variant_get_type_string (part_vardict), ==, "a{sv}");
> +  valid = g_variant_lookup (part_vardict, "content-type", "s", &s);

you have to use "&s" as type if you don't want g_value_lookup() to copy the string for you.

@@ +99,5 @@
> +  g_assert_cmpstr (g_variant_get_type_string (part_vardict), ==, "a{sv}");
> +  valid = g_variant_lookup (part_vardict, "content-type", "s", &s);
> +  g_assert (valid);
> +  g_assert_cmpstr (s, ==, "text/plain");
> +  valid = g_variant_lookup (part_vardict, "content", "s", &s);

same here.
Comment 4 Guillaume Desmottes 2012-09-26 11:23:01 UTC
Comment on attachment 67391 [details] [review]
tp_message_set_variant: add

Review of attachment 67391 [details] [review]:
-----------------------------------------------------------------

++
Comment 6 Simon McVittie 2012-09-26 12:47:11 UTC
++
Comment 7 Guillaume Desmottes 2012-09-26 12:52:41 UTC
Merged to master for 0.19.10 (or 0.20.0 depending on which one we release).

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.