Bug 21796

Summary: get_contact_statuses should not be allowed to fail
Product: Telepathy Reporter: Will Thompson <will>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: xclaesse
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
URL: http://cgit.collabora.com/git/user/xclaesse/telepathy-glib.git/log/?h=next-presence
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 31668    
Attachments: TpPresenceMixinGetContactStatusesFunc: remove the GError argument

Description Will Thompson 2009-05-18 07:03:50 UTC
The Presence mixin's get_contact_statuses callback can raise a GError, but there's no real reason for it to do so, particularly now we have "unknown". We should deprecate raising an error; first, we need to make all code calling it first validate the handles.
Comment 1 Xavier Claessens 2012-07-11 14:18:12 UTC
Created attachment 64110 [details] [review]
TpPresenceMixinGetContactStatusesFunc: remove the GError argument

It is useless since handles are already guaranteed to be valid.
Comment 2 Will Thompson 2012-07-11 14:35:30 UTC
Comment on attachment 64110 [details] [review]
TpPresenceMixinGetContactStatusesFunc: remove the GError argument

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

::: telepathy-glib/presence-mixin.c
@@ +976,2 @@
>  
> +  g_hash_table_iter_init (&iter, contact_statuses);

tp-glib should still check whether contact_statuses is NULL, rather than just crashing if the CM returns NULL. (Maybe it should fill in "unknown" for all handles if the CM returns NULL? Or just leave it out of the attribute dictionary.)
Comment 3 Xavier Claessens 2012-09-06 10:54:52 UTC
Branch updated
Comment 4 Simon McVittie 2012-09-06 11:20:34 UTC
Looks fine for next.
Comment 5 Xavier Claessens 2012-09-06 11:31:18 UTC
Thanks, merged.

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.