Bug 55096 - Provide GVariant-based access to TpMessage
Summary: Provide GVariant-based access to TpMessage
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks: 30422
  Show dependency treegraph
 
Reported: 2012-09-19 14:42 UTC by Simon McVittie
Modified: 2012-09-26 12:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
tp_message_dup_part: add (3.58 KB, patch)
2012-09-19 14:43 UTC, Simon McVittie
Details | Splinter Review
tp_message_set_variant: add (4.10 KB, patch)
2012-09-19 14:44 UTC, Simon McVittie
Details | Splinter Review

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.