Bug 62572

Summary: JingleSession::terminated should use a GError
Product: Wocky Reporter: Will Thompson <will>
Component: GeneralAssignee: Telepathy bugs list <telepathy-bugs>
Status: NEW --- QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Will Thompson 2013-03-20 19:49:11 UTC
Right now, the WockyJingleSession::terminated has three arguments, two of which are a member of the WockyJingleReason enum and a human-readable string.

Meanwhile, _on_initiate_reply() passes NULL as the GError parameter for wocky_porter_send_iq_finish() and wocky_stanza_extract_errors(), and ends the session with REASON_UNKNOWN if either of them fails. It would be nice if the application could (optionally) get more details about what happened.

So I suggest:

* Create a GError domain for WockyJingleReason (not sure what name the quark macro should have. WOCKY_JINGLE_REASON would work but might be confusing since WOCKY_TYPE_JINGLE_REASON also exists but WOCKY_JINGLE_REASON is not a cast macro);
* Make ::terminated include a GError *, which may be NULL;
* Make the current cases where UNKNOWN is used in place of a better error use that error, and the cases where it is used to mean "no error" use NULL for the GError *.

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.