diff -Nru telepathy-gabble-0.15.4/ChangeLog telepathy-gabble-0.16.0/ChangeLog --- telepathy-gabble-0.15.4/ChangeLog 2012-02-21 21:09:38.000000000 +0000 +++ telepathy-gabble-0.16.0/ChangeLog 2012-04-02 21:32:13.000000000 +0000 @@ -1,3 +1,934 @@ +commit 4291d1d472bc22ea1423e5ef2dc063eb1782ac15 +Author: Jonny Lamb +Date: 2012-04-02 17:05:53 -0400 + + version 0.16.0 + + Signed-off-by: Jonny Lamb + +commit b0112d03c77dfe4b506168ccffcc1eb4bb83d29f +Author: Jonny Lamb +Date: 2012-04-02 17:04:52 -0400 + + NEWS: summary for 0.16.0 + + Signed-off-by: Jonny Lamb + +commit 40322ddb3228a9687bee25ee4c85a5dffeccefe2 +Author: Jonny Lamb +Date: 2012-04-02 17:13:10 -0400 + + configure: update dependency on tp-glib + + Signed-off-by: Jonny Lamb + +commit 4d9133a523d95207699b3ede02b26e7e2c272fdd +Merge: 71dcf75 44582af +Author: Will Thompson +Date: 2012-04-02 17:50:28 +0100 + + Merge branch '47999-handle-ibb-errors' + +commit 44582af04f111e4ba855afceb814997fce812a4e +Author: Will Thompson +Date: 2012-03-28 14:53:43 +0100 + + bytestream-ibb: handle IQ send errors + + This is untested, but the existing tests still pass… + + https://bugs.freedesktop.org/show_bug.cgi?id=47999 + +commit b8f84c653318b18c5070085e66fca011f04bcb65 +Author: Will Thompson +Date: 2012-03-28 14:26:12 +0100 + + bytestream-ibb: correct send_data's return value. + + This function returns the number of messages sent, not a boolean. + +commit 71dcf75998ea8a332903def7b6513df5e4e6d819 +Author: Alban Crequy +Date: 2011-12-13 16:43:57 +0000 + + New test: connect/test-connection-params.py + + https://bugs.freedesktop.org/show_bug.cgi?id=43828 + +commit 45d81af51417a79bd2fd7c98b0980ba7e725dd5c +Author: Alban Crequy +Date: 2011-12-13 12:16:07 +0000 + + ContactList: downloading the roster at connection depends on a connection parameter + + https://bugs.freedesktop.org/show_bug.cgi?id=43828 + +commit deb67c35893b1770533eb48c4e7ec0840afc8926 +Author: Alban Crequy +Date: 2012-02-23 16:29:49 +0000 + + Update dependency on telepathy-glib + + https://bugs.freedesktop.org/show_bug.cgi?id=43826 + https://bugs.freedesktop.org/show_bug.cgi?id=43828 + +commit 687ec45023294d6003f987ff0dfc72986fdb7f46 +Author: Alban Crequy +Date: 2012-01-04 14:22:02 +0000 + + gabble_roster_unpublish_async: correct the source tag + +commit 5d7a8f948c504b842781e99f77bebcb94bf610a0 +Author: Alban Crequy +Date: 2012-01-04 14:21:42 +0000 + + gabble_roster_authorize_publication_async: correct the source tag + +commit 352d2da805561ec0164a6e800cd3c3e3bbc629f3 +Author: Simon McVittie +Date: 2012-03-09 13:38:04 +0000 + + Replace plugindir with an AC_ARG_VAR so it can be passed to configure + + This lets you configure the plugin directory: + + ./configure pluginexecdir='${libdir}/my-gabble-plugins' + + The directory-name variable has 'exec' in it because Automake installs + unknown directory names with 'exec' in their variable name during + "make install-exec", and other unknown directory names during + "make install-data". + + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + Reviewed-by: Jonny Lamb + +commit f06469da5cfc7c8dc750bce82099dde4b528a20b +Author: Simon McVittie +Date: 2012-03-09 13:35:37 +0000 + + Install non-ABI-stable libraries used by plugins to a private directory + + This avoids having Gabble and Salut, or old Gabble and a future stable + Wocky, fight over the libwocky.so symlink. + + If you're building for a tightly controlled platform where Gabble and + Salut are definitely using the same Wocky version, you can put them in the + normal libdir with + + ./configure pluginexeclibdir='${libdir}' + + or (when Salut has been updated with this change) make them share a private + library directory: + + ./configure pluginexeclibdir='${libdir}/telepathy/ytstenut-1.0' + + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + Reviewed-by: Jonny Lamb + +commit c535a29358002b3b48c3df7bedecfbf73ab4553f +Author: Simon McVittie +Date: 2012-03-09 12:42:10 +0000 + + Avoid non-portable use of += in configure.ac + + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + Reviewed-by: Jonny Lamb + +commit b942885bb6bca2e56b1a24737fcb8cf266d9cb61 +Author: Simon McVittie +Date: 2012-03-09 13:04:13 +0000 + + Avoid Wocky trying to install into --prefix=NONE + + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + Reviewed-by: Jonny Lamb + +commit 531bffcfaf8bed572259981d4d900e7f1e42e473 +Author: Simon McVittie +Date: 2012-03-09 12:41:46 +0000 + + configure.ac: remove apostrophe from a help message so syntax highlighting works + + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + Reviewed-by: Jonny Lamb + +commit fed5695cc026ab4076197de2a28a5f7bbe69dacb +Author: Simon McVittie +Date: 2012-03-09 12:24:44 +0000 + + telepathy-gabble.pc: link to Wocky + + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + Reviewed-by: Jonny Lamb + +commit c8da384dd9f311296145cdb49a2279f624502708 +Author: Jonny Lamb +Date: 2012-03-22 19:20:56 -0400 + + start on 0.15.6 + + Signed-off-by: Jonny Lamb + +commit b26a704c87968bc1db29a2917c2ca0bdf10ed999 +Author: Jonny Lamb +Date: 2012-03-22 19:09:06 -0400 + + version 0.15.5 + + Signed-off-by: Jonny Lamb + +commit b7350b195bae44bda93e767b7a8a5616c558102a +Author: Jonny Lamb +Date: 2012-03-22 18:52:51 -0400 + + configure: depend on telepathy-glib 0.17.7 + + Signed-off-by: Jonny Lamb + +commit b82352ce6eb3bab55e09f58ce07a3fd1d90ce319 +Merge: 21ec409 27fa0aa +Author: Marco Barisione +Date: 2012-03-22 17:52:20 +0000 + + Merge branch 'disable-voip' + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=47502 + Reviewed-by: Jonny Lamb + +commit 27fa0aa72eb61ecffb26998f535f66e4ae992ae6 +Author: Marco Barisione +Date: 2012-03-09 08:33:54 +0000 + + Allow to disable VoIP-related code with --disable-voip + +commit a69250eac91ac827ff90cf8a03d6540b68a5d001 +Author: Marco Barisione +Date: 2012-03-16 16:14:15 +0000 + + There is no need to include non-compiled files in EXTRA_DIST + + Automake makes sure that all the source files, even if they are not + being compiled at the moment, will be distributed when doing make dist. + +commit 21ec409017f58d1ff863cc8c26d42108931ecabb +Author: Olivier Crête +Date: 2012-03-16 14:18:25 -0400 + + CallStream: Replace want_send with the local sending state of the Stream + + Also require the newest telepathy-glib + +commit 78db4e43dcbc8e8fabe87e05a9231b3b6555116a +Author: Olivier Crête +Date: 2012-03-16 14:17:51 -0400 + + CallStream: Set local sending to true if a locally-created content wants to send + +commit b9926cf5413dde094ae134a84b349e26ffeabfa4 +Author: Olivier Crête +Date: 2012-03-13 19:01:35 -0400 + + Also check the sending state of non-initial streams + +commit a1414b8e991a4a51bb9cc09af29f4e3b56e23289 +Author: Olivier Crête +Date: 2012-03-13 18:44:30 -0400 + + tests: Expect new contents to be pending_start receiving + +commit 12e43de2942da80fb31e59ba334d5813af895fd6 +Author: Olivier Crête +Date: 2012-03-09 17:12:24 -0500 + + Fix unit tests to use the Telepathy candidate types + +commit 72e98283ca6a53b31f45a3fb410324bfba7ec1e1 +Author: Olivier Crête +Date: 2012-03-09 16:52:32 -0500 + + Convert Telepathy types to Jingle types correctly + +commit ceb7985d76f8d2c614344b4b6c68d152384b695b +Author: Olivier Crête +Date: 2012-03-09 16:45:47 -0500 + + Correctly convert JingleCandidateType to Telepathy types + +commit 8bbc8e408464f65f5cc93ff18109661f297b39d8 +Author: Jonny Lamb +Date: 2012-03-09 10:29:40 -0500 + + tube-iface: remove duplicated properties + + These wouldn't *have* to disappear, but GObject was complaining + because GabbleTubeIface:connection was implemented in TpBaseChannel as + type TpBaseConnection, when it was expecting a GabbleConnection. + + Stop crying, you baby. + + Signed-off-by: Jonny Lamb + +commit 0d57767b5f669d51049257bac918a98de798b9e0 +Author: Simon McVittie +Date: 2012-02-23 12:19:42 +0000 + + Link plugins in the same way on Unix as on Windows + + Reviewed-by: Olli Salli + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + +commit a167423acad1bbc41d764710fbc1de4347906da6 +Author: Simon McVittie +Date: 2012-02-23 12:01:26 +0000 + + Build Wocky as a version-specific shared library + + Reviewed-by: Olli Salli + Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46417 + +commit 9a52bb20676a5290b3778cecb9d5bbc74a928db7 +Author: Simon McVittie +Date: 2012-02-23 12:29:42 +0000 + + Use the standard EXEEXT variable rather than reinventing it + +commit 0a7c66f48e2a4f5f1b80237def4063fa952ccc71 +Merge: 52fac35 c8f08ce +Author: Will Thompson +Date: 2012-03-01 17:07:08 +0000 + + Merge branch 'detp-jingle' + + https://bugs.freedesktop.org/show_bug.cgi?id=46513 + + Conflicts: + src/ft-channel.c + +commit 52fac3507be8db06a9e1ae1b7a3c98a28d02da44 +Merge: 10785ff 491db17 +Author: Jonny Lamb +Date: 2012-02-29 15:02:55 -0500 + + Merge branch 'base-channels' + + Conflicts: + src/Makefile.am + src/tube-dbus.c + + Signed-off-by: Jonny Lamb + +commit c8f08ceb6e7f44303d1950a565e47f170129e524 +Author: Will Thompson +Date: 2012-02-29 13:22:22 +0000 + + CallStream style: add a missing blank line. + +commit de5eb4bebefa0d68d7ec081ed5845479c5aeae9e +Author: Will Thompson +Date: 2012-02-29 13:20:50 +0000 + + JingleMint: rename ::new-session to ::incoming-session + + This is Simon's idea, and it's a good one. It makes it clearly a + different signal to JingleFactory::new-session, too. + +commit f6d4a38fc058300dc2422f61f469ed6a86697ed8 +Author: Will Thompson +Date: 2012-02-29 13:14:05 +0000 + + JingleInfo: chain up at the end of dispose + + Simon noticed: + + > Surely dispose should chain up at the end, not the beginning? I see + > dispose and finalize as progressively breaking the functionality of + > the object's classes, most-derived first. + + Yup! + +commit cdc02ea04db52b24d84be250893b3bdc750baafe +Author: Will Thompson +Date: 2012-02-29 13:12:47 +0000 + + JingleSession: don't leak in initiate/accept callbacks + + Simon noticed: + + > "Send session-{initiate,accept} IQs using porter directly.", + > 72ea73343252: I think you're leaking sess in the callbacks, except in + > the early-return cases where the state has become inappropriate? + + He's quite right. + +commit 10785ffc0e61d98d6bc23b5281872d7268b3a3a1 +Author: Xavier Claessens +Date: 2012-02-29 11:26:31 +0100 + + Include config.h to have GLIB_DISABLE_DEPRECATION_WARNINGS defined + +commit a6ef0c0b9d2747baaaa049a6c441da7b94d65265 +Author: Will Thompson +Date: 2012-02-23 12:59:29 +0000 + + JingleSession: make _new() take a dialect. + + Everywhere that creates a new session knows the dialect it wants to use, + so let's pass it right into the constructor. + +commit da9f352766edf270c907421ea610549593c46325 +Author: Will Thompson +Date: 2012-02-20 15:24:12 +0000 + + Represent Jingle relays by a struct, not an aa{sv} + + This has the dual benefits of removing Telepathy data structures from + google-relay.c, and of simplifying the use of these structures in + gtalk-file-collection.c. + +commit 089a5f2de461d90f9089a68dc11ada1cfc6f58b1 +Author: Will Thompson +Date: 2012-02-20 12:35:02 +0000 + + Jingle*: stop including util.h + +commit ae1d315c9bae65a5dd9c1eacbdcda1aa2ec6408f +Author: Will Thompson +Date: 2012-02-20 12:32:12 +0000 + + JingleFactory: drop use of gabble_signal_connect_weak() + + Wocky doesn't have an equivalent of this function. It's relatively + little work to explicitly disconnect from the sessions' ::query-cap + signals, so let's do that. + +commit ca86afb5cde89cc1832ed002a59cef6f51916ef4 +Author: Will Thompson +Date: 2012-02-17 19:19:44 +0000 + + Remove unused JingleInitiator type. + + It would actually be better if a two-element version of this without the + INVALID element had been used throughout rather than booleans to + represent the direction of a session… but oh well. + +commit d88193074f1f1d9f4d618932821dbab36a474182 +Author: Will Thompson +Date: 2012-02-17 19:07:19 +0000 + + Move Jingle enums and typedefs to a new jingle-types.h + + For some reason the enums lived in jingle-factory.h before. + + We do need a separate header for the typedefs because some of the Jingle + headers are mutually dependent. + +commit ac9ee4a66f56f8c033f150eb5c8a4a9999e475e3 +Author: Will Thompson +Date: 2012-02-17 19:10:27 +0000 + + JingleFactory: correct TpChannelGroupChangeReason reference + +commit 003e72bc1d8cf70aa595f036ebcfb7e2a542efbb +Author: Will Thompson +Date: 2012-02-17 18:55:27 +0000 + + JingleFactory: drop GabbleConnection dependency. + + So with this patch, GabbleJingleFactory takes a construct-time + WockySession property rather than a GabbleConnection; GabbleJingleMint + only creats the factory when the porter (and hence session) becomes + available. + + With this, we've removed the core Jingle code's last significant + Gabble/Telepathy dependency. + +commit 745b27e041cb9db5b6a1eb920fdaf480a65d4762 +Author: Will Thompson +Date: 2012-02-17 18:35:05 +0000 + + JingleFactory: store WockySession as well as Porter + + This makes ::porter-available the only place in jingle-factory.c which + uses the connection non-trivially, laying the ground for removing it… + +commit 081f2e7776614e6e8147909c0e5ab9593a85f2dd +Author: Will Thompson +Date: 2012-02-17 18:28:08 +0000 + + JingleFactory: propagate caps queries out to Mint + +commit 4a27eccf389050be52eb4701263e832634fe63ca +Author: Will Thompson +Date: 2012-02-17 18:22:01 +0000 + + JingleFactory: move pre-initiate presence pushes to Mint + +commit 035f99f9c5ea8dbff493555921b6056756106215 +Author: Will Thompson +Date: 2012-02-17 18:18:44 +0000 + + JingleFactory: emit ::new-session for outgoing sessions too + +commit 46c47589c95f923453b9f4e3fe4aa6d648e8447b +Author: Will Thompson +Date: 2012-02-17 18:11:12 +0000 + + JingleFactory: explain why create_session() can't emit new-session + +commit ad631083a88dfdea01b2a9957eeff9594a97ed7b +Author: Will Thompson +Date: 2012-02-17 17:55:21 +0000 + + JingleFactory: move connection status monitoring to Mint + +commit b6ff8bff994babae4afb0e00b8d388b2c37cff8b +Author: Will Thompson +Date: 2012-02-17 17:49:12 +0000 + + JingleFactory: call stop() from dispose() + + This is currently redundant, but will prevent crashing in a hypothetical + situation where the factory gets disposed without anyone calling stop() + on it first. + +commit 3676e46472aad8a8205cf8618a15b45d07690e2e +Author: Will Thompson +Date: 2012-02-17 17:47:48 +0000 + + JingleFactory: refactor handler-unregistration to a method + + This will be used by the mint to stop the factory accepting new incoming + sessions when the connection starts disconnecting. + +commit 618234580dcb23f076d0cc75b69f2cbcc92b96a6 +Author: Will Thompson +Date: 2012-02-17 17:42:19 +0000 + + Wrap JingleFactory in a new class, JingleMint. + + The intention is to move all Gabble-specific code into JingleMint, + leaving only the pure angle-bracket distillate behind in JingleFactory, + which can then be moved to Wocky. But as of this commit, JingleMint is + basically an empty shell: it immediately creates a JingleFactory, and + proxies its ::new-session signal. + + As described in the comments, “mint” is meant in the “factory which + makes coins” sense. It seemed like a better name than + JingleFactoryFactory. + +commit 8b958fc8c845755832b44e00ffb30e235c82994e +Author: Will Thompson +Date: 2012-02-17 17:32:14 +0000 + + JingleFactory: add _new() method + +commit 77d5d99e9b608d080cc46c523880eccdc1d5360c +Author: Will Thompson +Date: 2012-02-17 13:59:35 +0000 + + JingleFactory: correct ::new-session's signature + + GabbleJingleSessions are not mere pointers: they are objects! + +commit f40f6c4db3079aa7b4befe70c8a709d49144cc6f +Author: Will Thompson +Date: 2012-02-17 12:07:07 +0000 + + Split Telepathy<->Jingle enum mapping out of Jingle code + +commit 51ec259c494d42c30adfb982646eda2805b2ec3d +Author: Will Thompson +Date: 2012-02-17 11:56:35 +0000 + + JingleMediaRtp: drop use of TP_ERRORS + + Depending on whether an illegal codec update comes from the network or + from the local system, we end up wanting either a WOCKY_XMPP_ERROR or a + TP_ERROR (to throw back over the wire or in a D-Bus method error, + respectively). Previously, this choice was made inside JingleMediaRtp; + this patch moves the conversion out to GabbleMediaStream. (The Call + codepaths all pass NULL for the GError **... great.) + +commit 729d3f4f06eba69e499805b004383aba521c7a35 +Author: Will Thompson +Date: 2012-02-17 10:41:17 +0000 + + Jingle*: spell out tp_clear_{boxed,pointer} + + Wocky doesn't have things like this. GLib, however, does have + g_clear_object() so we can use that in place of tp_clear_object. + +commit feb1266ce56e12359a9f2d6ff2325acd0c3a8b56 +Author: Will Thompson +Date: 2012-02-17 10:28:27 +0000 + + JingleSession: spell out tp_str_empty() + + Wocky doesn't have an equivalent function. + +commit b1be04b448e5860f7cadc27ac7a20a81367f4b3a +Author: Will Thompson +Date: 2012-02-17 10:26:53 +0000 + + Jingle*: use wocky_strdiff rather than tp_strdiff + +commit 10f9eccfb8e3e1e8f88315b41e6a60a26185db26 +Author: Will Thompson +Date: 2012-02-16 20:00:23 +0000 + + JingleSession: remove GabbleConnection property. + +commit dada0afc57d852209a78494c3af12e3704790f1c +Author: Will Thompson +Date: 2012-02-16 19:48:01 +0000 + + JingleSession: move pre-initiate presence pushes to Factory + + This change has the same rationale as the previous. + +commit 78629e08e943bcca2a0d28648c853f5ac50e93b5 +Author: Will Thompson +Date: 2012-02-16 18:02:50 +0000 + + JingleSession: delegate capability queries to factory + + The two remaining bits of code that use GabbleConnection inside + GabbleJingleSession use the caps cache and the roster. There is really + no good code for these inside Wocky just now (well, WockyRoster exists, + but it's not what Gabble uses so the point is moot). + + I've resigned myself to the fact that GabbleJingleFactory will have to + stick around in some form—not least to listen for ::porter-available, + and also to dig stun server parameters out of GabbleConnection. So I + think the best path to breaking GabbleJingleSession's Gabble addiction + is to add some signals which get handled by the Gabble-specific remnants + of the JingleFactory. + + Meanwhile, I noticed that the caps-checking code didn't actually work + for the bare-JID case, so fixed that up while moving the code. + +commit 28f25af9b2f95103bacb3ab3a005b6cb102950fc +Author: Will Thompson +Date: 2012-02-16 17:36:48 +0000 + + JingleSession: get own full JID from porter. + +commit e1a08344fcfaac717bd533c7ea990f82b3c3732d +Author: Will Thompson +Date: 2012-02-16 17:34:38 +0000 + + JingleSession: add a porter property. + +commit fd17643d8495e4f3fe87fe3660f7008ee1953eb7 +Author: Will Thompson +Date: 2012-02-16 17:26:31 +0000 + + JingleFactory: pass self to JingleSession + + This avoids the JingleSession having to go via its GabbleConnection to + get back to the JingleFactory which created it. + +commit 39b90872eb4939ba4b4262ababc7ae54743fa465 +Author: Will Thompson +Date: 2012-02-16 16:04:47 +0000 + + JingleContent: don't store a GabbleConnection. + +commit 41c4e316f12c7bbd285702ca74e3e4c2d7af6ee2 +Author: Will Thompson +Date: 2012-02-16 16:27:16 +0000 + + CallStream: don't grab Connection from JingleContent. + +commit 2863cdcee0c4d464a0f15f587e20f3a8f67c5014 +Author: Will Thompson +Date: 2012-02-16 16:03:06 +0000 + + MediaStream: don't grab Connection from JingleContent. + + Previously, GabbleMediaStream was getting to the JingleFactory for its + content via the connection object stored by the content. Instead, go via + the JingleSession stored by the content (so that we can stop storing the + connection in the content). + +commit 679cfd663064781d1ca60d5ed8dae8cab85cb594 +Author: Will Thompson +Date: 2012-02-16 16:21:06 +0000 + + MediaStream: add a TpDBusDaemon property. + + Previously it was retrieved from the JingleContent, via the + GabbleConnection it stores. But the Jingle code shouldn't know anything + about Telepathy. + +commit 5410295679bb8ff4a0aad3eb38cc5717124fb5c5 +Author: Will Thompson +Date: 2012-02-16 15:41:11 +0000 + + JingleFactory: remove prototype for long-dead function. + + I removed _jingle_factory_unregister_session() way back in 2009 with + commit fd410e9. + +commit a101f15d96f43c4a5c3da10d6acf485ad22bafa9 +Author: Will Thompson +Date: 2012-02-16 13:11:57 +0000 + + JingleSession: remove unused handle-repo-dynamic import. + +commit 570ad5f69f99f4eace580998d0e5df76f100e74f +Author: Will Thompson +Date: 2012-02-23 12:36:36 +0000 + + JingleInfo: don't crash when disconnecting before reply. + + For some reason I can't quite discern, this didn't crash before the + previous patch but does afterwards. Oh well. Here's a fix. + +commit 51767ee2ec4423c00199fe4e0411f0b83d61aa2f +Author: Will Thompson +Date: 2012-02-16 11:21:40 +0000 + + Split google:jingleinfo code out from JingleFactory + + I am a terrible person and included a couple of changes in this which + are not just moving code around: + + • When parsing STUN server info out of a jingle:info stanza, we no + longer use GABBLE_PARAMS_DEFAULT_STUN_PORT as the default if the + element does not have a udp='' attribute. (Which seems + uncontroversial: if the server erroneously leaves out that attribute, + the chances of it happening to listen on + GABBLE_PARAMS_DEFAULT_STUN_PORT is pretty low.) + + • Rather than using conn_util_send_iq_async(), we use + wocky_porter_send_iq_async() plus wocky_stanza_extract_errors() to + send the jingleinfo request. Wocky doesn't have something like + conn_util_send_iq_async(), and this branch is really about removing + Gabble dependencies from the Jingle code. + +commit f2b8df3800135b115bd801921a626bc7edde90e0 +Author: Will Thompson +Date: 2012-02-15 15:56:26 +0000 + + JingleFactory: store WockyPorter + +commit 90b7b2911a76ed9335d161d88fd6a7dd7a2ba41e +Author: Will Thompson +Date: 2012-02-15 15:42:21 +0000 + + gabble_jingle_session_send: drop callback arguments. + + Since nothing uses the weak_object argument any more, we can drop it, + and hence stop using _gabble_connection_send_with_reply() in favour of + wocky_porter_send_iq_async() directly. One less bit of Gabble inside the + Jingle code! + +commit 72ea73343252d8ac6b792f9f4035cd511290a33d +Author: Will Thompson +Date: 2012-02-15 15:41:40 +0000 + + Send session-{initiate,accept} IQs using porter directly. + + This is the second and final place where the callback arguments to + gabble_jingle_session_send() were used. + +commit a2e03f323dcb96d3043baef52a04eb41f22c6440 +Author: Will Thompson +Date: 2012-02-15 15:40:22 +0000 + + Content: use porter directly to send content-remove + + This is one of only two places which passes a callback to + gabble_jingle_session_send(), so let's just spell it out. + +commit d039d1900888a828e2fc686c331cdfcaca8931ef +Author: Will Thompson +Date: 2012-02-15 15:12:04 +0000 + + Session: tolerate being outlived by contents + + Never disconnecting these signals happens to be safe because + GabbleJingleSession always holds the last reference to + GabbleJingleContent, but it feels fragile. + +commit 91e8bc6b3a74cfdf2aaf685fc8883f3344c4e228 +Author: Will Thompson +Date: 2012-02-15 12:56:23 +0000 + + Jingle transports: stop using GabbleConnection + +commit 534bfa15133ead76a46a22f9f8e788c159fb2541 +Author: Will Thompson +Date: 2012-02-15 12:48:08 +0000 + + JingleSession: add and use factory accessor. + +commit 8080a905390ad9ca51059db15277930af6cc6bae +Author: Will Thompson +Date: 2012-02-15 12:06:15 +0000 + + JingleSession: localize use of peer handle. + + Now that we only use a handle in one place, let's move everything to do + with it there. + +commit 1dbbf70e672bcccef88c19b66ebb47bf4897a7fa +Author: Will Thompson +Date: 2012-02-15 12:04:30 +0000 + + JingleSession: remove "peer" GObject property. + +commit bd654d2d812a1d5edae9796a20fca0b81dbfbaf7 +Author: Will Thompson +Date: 2012-02-15 12:02:32 +0000 + + JingleSession: remove get_peer_handle. + + The session unfortunately still uses the handle internally… + +commit a15ae7cf17528dd7a0d24386025cfe450c93cda2 +Author: Will Thompson +Date: 2012-02-15 11:59:50 +0000 + + media-factory: stop using gabble_jingle_session_get_peer_handle + +commit 7f40e47b980f917fa01d8d1f1012e4fb5a6f1559 +Author: Will Thompson +Date: 2012-02-15 11:54:10 +0000 + + ft-manager: stop using gabble_jingle_session_get_peer_handle + +commit b8ac1245d91828644f8ef37a9d107a12ae087275 +Author: Will Thompson +Date: 2012-02-14 18:00:52 +0000 + + Call: stop using gabble_jingle_session_get_peer_handle + +commit 363b2c580cb5500979020221b74e4889c59f93c2 +Author: Will Thompson +Date: 2012-02-07 11:55:42 +0000 + + MediaChannel: store peer's handle. + + This removes its dependency on GabbleJingleSession knowing about + handles, and is less code. + +commit d884caf42e3e4608b5db84a6d1411c67aa9db925 +Author: Will Thompson +Date: 2012-02-03 17:38:09 +0100 + + MediaChannel: use gabble_jingle_session_get_peer_handle() + + Previously for some reason this was using g_object_get (..., "peer"). + Calling a function instead makes it easier to see what needs changing. + +commit 819be150a66f99a1be524f31e0c8985aa613553d +Author: Will Thompson +Date: 2012-02-03 16:29:58 +0000 + + JingleSession: look up presence by WockyContact. + +commit ca9f3991776c9c277178f88c51941b6cad09800a +Author: Will Thompson +Date: 2012-02-03 16:27:31 +0000 + + PresenceCache: add WockyContact-based lookup. + +commit c5328de7a89e2882036b64ba19a2c5bc3e8e70ce +Author: Will Thompson +Date: 2012-02-07 19:26:01 +0000 + + util: add helper to fetch TpHandle for WockyContact + +commit 97d9c5ae3afc425eb8db91cbe83c37289e1baa5d +Author: Will Thompson +Date: 2012-02-16 15:21:34 +0000 + + JingleMediaRTP: use jingle_session_peer_has_cap() + + The body of content_has_cap() is basically identical to the body of + gabble_jingle_session_peer_has_cap(), so let's delete the former. + +commit 63ade9c2226b72739b53039e26a31b483162aba5 +Author: Will Thompson +Date: 2012-02-16 15:15:56 +0000 + + JingleSession: rename _peer_has_quirk to _peer_has_cap + + There's nothing quirk-specific about the function. + +commit 8bd15af6cae7e90c97b81690a44bd2e43e1ab5e8 +Author: Will Thompson +Date: 2012-02-03 16:25:24 +0000 + + JingleFactory: stop dabbling in handles. + +commit bc53ec13c956191ab00cdf29236effac6d98651e +Author: Will Thompson +Date: 2012-02-03 16:18:11 +0000 + + JingleSession: remove defunct handle refcounting + +commit 2ad876aee650c4977f214a6d14b6852e164a6a82 +Author: Will Thompson +Date: 2012-02-03 16:15:34 +0000 + + JingleSession: grab resource from WockyResourceContact + +commit 439380da7a6a49f5e5255dcf691c24f3aec669ad +Author: Will Thompson +Date: 2012-02-03 16:11:19 +0000 + + JingleSession: hold a WockyContact. + +commit b516378e41944381ccea6f29821ce7ac41a4cada +Author: Will Thompson +Date: 2012-02-03 15:40:02 +0000 + + JingleFactory: exclude handle from session map keys + + The handle doesn't provide any additional information over the JID; it + is a relic of when the format was "\n\n". + +commit 512c7492c2cb925e0260043a89170cda0907566c +Author: Will Thompson +Date: 2012-02-01 16:55:46 +0000 + + JingleSession: move TpHandle peer to private structure + +commit 1fc97cba57211fa8075c08ed63d882950b0d9451 +Author: Guillaume Desmottes +Date: 2012-02-13 13:25:25 +0100 + + groups.py: test RenameGroup() + + This has been started as a regression test for fdo#45982 which turned to be a + tp-glib bug. So we shouldn't merge this commit to master until we depend on a + fixed tp-glib. + +commit f6eda33b8127fd18a81495c221fed4ac57eba37e +Author: Guillaume Desmottes +Date: 2012-02-13 11:51:11 +0100 + + groups.py: factor out send_roster_push() + + https://bugs.freedesktop.org/show_bug.cgi?id=45982 + +commit 40283718ad184b014f4941a3126e5dfa0ed0640c +Author: Guillaume Desmottes +Date: 2012-02-13 11:43:17 +0100 + + groups.py: factor out parse_roster_change_request() + + https://bugs.freedesktop.org/show_bug.cgi?id=45982 + +commit dcc73750bceb0e7b1bd865fde5744583cb75300c +Author: Simon McVittie +Date: 2012-02-21 21:59:58 +0000 + + Nano version + commit 04c7829858da40f943363cfc3e61aa76f68c59ac Author: Simon McVittie Date: 2012-02-21 21:02:10 +0000 @@ -120,6 +1051,33 @@ Add a direction parameter to AddContent +commit 491db173ad4da5ce4f5ff8d90d1a7ea20aed7785 +Author: Jonny Lamb +Date: 2012-02-14 18:54:37 -0500 + + tube-stream: subclass TpBaseChannel + + See also: exactly the same commit to GabbleTubeDBus. + + Signed-off-by: Jonny Lamb + +commit efbde4c8755e1bf55752ddb170d80a122f482afa +Author: Jonny Lamb +Date: 2012-02-03 19:44:09 -0500 + + tube-dbus: subclass TpBaseChannel + + This one is complicated because the old GabbleTubeDBus handled both + TargetHandleType as Contact *and* Room. TpBaseChannel sets the + TargetHandleType per class so makes this hard. The easiest way to do + this is to have a really dummy subclass for MUCs to change the + TargetHandleType (and interfaces, to add Group). + + It would be nice in future to move the actual MUC stuff into + GabbleMucTubeDbus, but that's for another day. + + Signed-off-by: Jonny Lamb + commit 571037bf029f2cd46f85a50d7d2b0892ae50be10 Author: Guillaume Desmottes Date: 2012-02-09 18:39:19 +0100 @@ -348,6 +1306,14 @@ https://bugs.freedesktop.org/show_bug.cgi?id=27489 +commit 3e0c8b55b81207f7842495b4ab9f59f0de655ae3 +Author: Jonny Lamb +Date: 2012-02-03 14:31:13 -0500 + + ft-channel: subclass TpBaseChannel + + Signed-off-by: Jonny Lamb + commit ab745cbdead64a313fe3e8859cec5bf7c4382dc9 Author: Jonny Lamb Date: 2012-02-01 16:07:25 -0500 diff -Nru telepathy-gabble-0.15.4/config.guess telepathy-gabble-0.16.0/config.guess --- telepathy-gabble-0.15.4/config.guess 2012-01-31 11:06:08.000000000 +0000 +++ telepathy-gabble-0.16.0/config.guess 2012-03-07 21:40:06.000000000 +0000 @@ -2,9 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-05-11' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -57,8 +55,8 @@ Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +143,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -792,13 +790,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -807,6 +804,9 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,6 +861,13 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,13 +902,16 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -943,7 +953,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -978,13 +988,13 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1315,6 +1325,9 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -Nru telepathy-gabble-0.15.4/config.h.in telepathy-gabble-0.16.0/config.h.in --- telepathy-gabble-0.15.4/config.h.in 2012-02-21 19:24:05.000000000 +0000 +++ telepathy-gabble-0.16.0/config.h.in 2012-04-02 21:29:37.000000000 +0000 @@ -21,9 +21,15 @@ /* Make tests installable */ #undef ENABLE_INSTALLED_TESTS +/* Enable file transfer */ +#undef ENABLE_JINGLE_FILE_TRANSFER + /* Enable plugins */ #undef ENABLE_PLUGINS +/* Enable VoIP */ +#undef ENABLE_VOIP + /* Build with GLib deprecated */ #undef GLIB_DISABLE_DEPRECATION_WARNINGS diff -Nru telepathy-gabble-0.15.4/config.sub telepathy-gabble-0.16.0/config.sub --- telepathy-gabble-0.15.4/config.sub 2012-01-31 11:06:08.000000000 +0000 +++ telepathy-gabble-0.16.0/config.sub 2012-03-07 21:40:06.000000000 +0000 @@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-03-23' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -76,8 +74,8 @@ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +130,10 @@ os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -247,17 +249,22 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -291,7 +298,7 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -300,7 +307,7 @@ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -315,8 +322,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -329,7 +335,10 @@ strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -352,11 +361,13 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -365,8 +376,10 @@ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -400,7 +413,7 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ @@ -408,10 +421,11 @@ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -711,7 +725,6 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -808,10 +821,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -1120,13 +1141,8 @@ basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1336,7 +1352,7 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1548,9 +1564,6 @@ ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout diff -Nru telepathy-gabble-0.15.4/configure telepathy-gabble-0.16.0/configure --- telepathy-gabble-0.15.4/configure 2012-02-21 19:23:45.000000000 +0000 +++ telepathy-gabble-0.16.0/configure 2012-04-02 21:29:19.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for Telepathy Gabble 0.15.4. +# Generated by GNU Autoconf 2.68 for Telepathy Gabble 0.16.0. # # Report bugs to . # @@ -571,8 +571,8 @@ # Identity of this package. PACKAGE_NAME='Telepathy Gabble' PACKAGE_TARNAME='telepathy-gabble' -PACKAGE_VERSION='0.15.4' -PACKAGE_STRING='Telepathy Gabble 0.15.4' +PACKAGE_VERSION='0.16.0' +PACKAGE_STRING='Telepathy Gabble 0.16.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=gabble' PACKAGE_URL='' @@ -618,10 +618,14 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -ENABLE_FILE_TRANSFER_FALSE -ENABLE_FILE_TRANSFER_TRUE +ENABLE_JINGLE_FILE_TRANSFER_FALSE +ENABLE_JINGLE_FILE_TRANSFER_TRUE NICE_LIBS NICE_CFLAGS +ENABLE_VOIP_FALSE +ENABLE_VOIP_TRUE +ENABLE_FILE_TRANSFER_FALSE +ENABLE_FILE_TRANSFER_TRUE ENABLE_GOOGLE_RELAY_FALSE ENABLE_GOOGLE_RELAY_TRUE SOUP_LIBS @@ -652,6 +656,8 @@ ENABLE_PLUGINS ENABLE_PLUGINS_FALSE ENABLE_PLUGINS_TRUE +pluginexecdir +pluginexeclibdir GLIB_GENMARSHAL GMODULE_LIBS GMODULE_CFLAGS @@ -816,6 +822,7 @@ enable_submodules enable_google_relay enable_file_transfer +enable_voip ' ac_precious_vars='build_alias host_alias @@ -833,6 +840,8 @@ GLIB_LIBS GMODULE_CFLAGS GMODULE_LIBS +pluginexeclibdir +pluginexecdir DBUS_CFLAGS DBUS_LIBS TP_GLIB_CFLAGS @@ -1386,7 +1395,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Telepathy Gabble 0.15.4 to adapt to many kinds of systems. +\`configure' configures Telepathy Gabble 0.16.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1457,7 +1466,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Telepathy Gabble 0.15.4:";; + short | recursive ) echo "Configuration of Telepathy Gabble 0.16.0:";; esac cat <<\_ACEOF @@ -1488,7 +1497,7 @@ --enable-is-a-phone advertise that we are a phone, not a PC --disable-fatal-criticals do not assert because of critical warnings - --enable-gtk-doc doesn't actually do anything + --enable-gtk-doc does not actually do anything --disable-plugins disable plugin loader --enable-plugin-api install headers for third-party plugins (experimental) @@ -1497,6 +1506,8 @@ --disable-submodules Use system versions of Wocky, rather than submodules --disable-google-relay disable Google Jingle relay support --disable-file-transfer disable file transfer support + --disable-voip disable VoIP support (and, consequently, + Jingle-based file transfer support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1529,6 +1540,10 @@ C compiler flags for GMODULE, overriding pkg-config GMODULE_LIBS linker flags for GMODULE, overriding pkg-config + pluginexeclibdir + + pluginexecdir + DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config TP_GLIB_CFLAGS @@ -1610,7 +1625,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Telepathy Gabble configure 0.15.4 +Telepathy Gabble configure 0.16.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1979,7 +1994,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Telepathy Gabble $as_me 0.15.4, which was +It was created by Telepathy Gabble $as_me 0.16.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2806,7 +2821,7 @@ # Define the identity of the package. PACKAGE='telepathy-gabble' - VERSION='0.15.4' + VERSION='0.16.0' cat >>confdefs.h <<_ACEOF @@ -13452,6 +13467,20 @@ GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` +# These must contain "exec" for automake to work right (install-exec, +# not install-data). +# +# Private directory for Wocky and the gabble-plugins library +if test "x$pluginexeclibdir" = x; then + pluginexeclibdir='${libdir}/telepathy/gabble-0/lib' +fi + +# The actual plugins +if test "x$pluginexecdir" = x; then + pluginexecdir='${libdir}/telepathy/gabble-0/plugins' +fi + + # Check whether --enable-plugins was given. if test "${enable_plugins+set}" = set; then : enableval=$enable_plugins; enable_plugins=$enableval @@ -13717,12 +13746,12 @@ pkg_cv_TP_GLIB_CFLAGS="$TP_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.17.5\""; } >&5 - ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.17.5") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.18.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.18.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_TP_GLIB_CFLAGS=`$PKG_CONFIG --cflags "telepathy-glib >= 0.17.5" 2>/dev/null` + pkg_cv_TP_GLIB_CFLAGS=`$PKG_CONFIG --cflags "telepathy-glib >= 0.18.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -13734,12 +13763,12 @@ pkg_cv_TP_GLIB_LIBS="$TP_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.17.5\""; } >&5 - ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.17.5") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.18.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.18.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_TP_GLIB_LIBS=`$PKG_CONFIG --libs "telepathy-glib >= 0.17.5" 2>/dev/null` + pkg_cv_TP_GLIB_LIBS=`$PKG_CONFIG --libs "telepathy-glib >= 0.18.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -13760,14 +13789,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - TP_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "telepathy-glib >= 0.17.5" 2>&1` + TP_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "telepathy-glib >= 0.18.0" 2>&1` else - TP_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "telepathy-glib >= 0.17.5" 2>&1` + TP_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "telepathy-glib >= 0.18.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TP_GLIB_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (telepathy-glib >= 0.17.5) were not met: + as_fn_error $? "Package requirements (telepathy-glib >= 0.18.0) were not met: $TP_GLIB_PKG_ERRORS @@ -14099,70 +14128,31 @@ # We have to run Wocky's configure *before* looking for it with PKG_CHECK_MODULES so wocky-uninstalled.pc has been generated +# If you don't specify --prefix, it starts off as NONE. Autoconf +# would normally do this defaulting for us later, but that's too +# late to help Wocky. +if test "x${prefix}" = "xNONE"; then + prefix=/usr/local +fi + # We tell Wocky to install its headers alongside gabble's so that an actual # separate Wocky installation won't clash with them. This is a bit of a hack. # AX_CONFIG_DIR doesn't make it very easy to pass extra arguments to the # submodule's configure. prev_ac_configure_args=$ac_configure_args -ac_configure_args="$ac_configure_args --with-installed-headers=${wocky_install_headers_dir}" - -# Code from the submodules will be linked in to the gabble-plugins.so shared library, so they need -# to be compiled as position-independent code. Pass on any other flags we got as well. -# -# On some platforms -fPIC results in a "all code is position independent" warning though, so let's -# try to compile with -Werror to find out if the current platform is one of these. -sub_cflags="$CFLAGS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -fPIC -Werror" >&5 -$as_echo_n "checking to see if compiler understands -fPIC -Werror... " >&6; } - - save_CFLAGS="$CFLAGS" - save_CXXFLAGS="$CXXFLAGS" - CFLAGS="$CFLAGS -fPIC -Werror" - CXXFLAGS="$CXXFLAGS -fPIC -Werror" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - flag_ok=yes -else - flag_ok=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$save_CFLAGS" - CXXFLAGS="$save_CXXFLAGS" - if test "X$flag_ok" = Xyes ; then - sub_cflags+=" -fPIC" - true - else - - true - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 -$as_echo "$flag_ok" >&6; } - -ac_configure_args+=" CFLAGS=\"$sub_cflags\"" +ac_configure_args="$ac_configure_args --with-installed-headers=${wocky_install_headers_dir} --enable-shared-suffix=${PACKAGE}-${VERSION} --libdir=${pluginexeclibdir}" if test "x$ENABLE_CODING_STYLE_CHECKS" = xyes ; then - ac_configure_args+=" --enable-coding-style-checks" + ac_configure_args="$ac_configure_args --enable-coding-style-checks" else - ac_configure_args+=" --disable-coding-style-checks" + ac_configure_args="$ac_configure_args --disable-coding-style-checks" fi if test "x$tp_werror" = xyes && test "x$official_release" = xno; then - ac_configure_args+=" --enable-Werror" + ac_configure_args="$ac_configure_args --enable-Werror" else - ac_configure_args+=" --disable-Werror" + ac_configure_args="$ac_configure_args --disable-Werror" fi prev_top_build_prefix=$ac_top_build_prefix @@ -14537,6 +14527,42 @@ $as_echo "#define ENABLE_FILE_TRANSFER /**/" >>confdefs.h +fi + if test "x$enable_ft" = xyes; then + ENABLE_FILE_TRANSFER_TRUE= + ENABLE_FILE_TRANSFER_FALSE='#' +else + ENABLE_FILE_TRANSFER_TRUE='#' + ENABLE_FILE_TRANSFER_FALSE= +fi + + +# Check whether --enable-voip was given. +if test "${enable_voip+set}" = set; then : + enableval=$enable_voip; enable_voip=$enableval +else + enable_voip=yes +fi + + +if test x$enable_voip = xyes; then + +$as_echo "#define ENABLE_VOIP /**/" >>confdefs.h + +fi + if test "x$enable_voip" = xyes; then + ENABLE_VOIP_TRUE= + ENABLE_VOIP_FALSE='#' +else + ENABLE_VOIP_TRUE='#' + ENABLE_VOIP_FALSE= +fi + + +if test x$enable_voip = xyes -a x$enable_ft = xyes; then + enable_jingle_ft=yes + +$as_echo "#define ENABLE_JINGLE_FILE_TRANSFER /**/" >>confdefs.h pkg_failed=no @@ -14630,17 +14656,18 @@ fi else + enable_jingle_ft=no NICE_CFLAGS= NICE_LIBS= fi - if test "x$enable_ft" = xyes; then - ENABLE_FILE_TRANSFER_TRUE= - ENABLE_FILE_TRANSFER_FALSE='#' + if test "x$enable_jingle_ft" = xyes; then + ENABLE_JINGLE_FILE_TRANSFER_TRUE= + ENABLE_JINGLE_FILE_TRANSFER_FALSE='#' else - ENABLE_FILE_TRANSFER_TRUE='#' - ENABLE_FILE_TRANSFER_FALSE= + ENABLE_JINGLE_FILE_TRANSFER_TRUE='#' + ENABLE_JINGLE_FILE_TRANSFER_FALSE= fi @@ -14836,6 +14863,14 @@ as_fn_error $? "conditional \"ENABLE_FILE_TRANSFER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_VOIP_TRUE}" && test -z "${ENABLE_VOIP_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_VOIP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_JINGLE_FILE_TRANSFER_TRUE}" && test -z "${ENABLE_JINGLE_FILE_TRANSFER_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_JINGLE_FILE_TRANSFER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -15245,7 +15280,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Telepathy Gabble $as_me 0.15.4, which was +This file was extended by Telepathy Gabble $as_me 0.16.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15311,7 +15346,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Telepathy Gabble config.status 0.15.4 +Telepathy Gabble config.status 0.16.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -17121,5 +17156,7 @@ Channel.Type.Call support...: ${enable_channel_type_call} Google relay support........: ${enable_google_relay} File transfer support.......: ${enable_ft} + Jingle file transfer support: ${enable_jingle_ft} + VoIP support................: ${enable_voip} " diff -Nru telepathy-gabble-0.15.4/configure.ac telepathy-gabble-0.16.0/configure.ac --- telepathy-gabble-0.15.4/configure.ac 2012-02-21 19:23:29.000000000 +0000 +++ telepathy-gabble-0.16.0/configure.ac 2012-04-02 21:28:17.000000000 +0000 @@ -8,8 +8,8 @@ # set gabble_nano_version to 0. m4_define([gabble_major_version], [0]) -m4_define([gabble_minor_version], [15]) -m4_define([gabble_micro_version], [4]) +m4_define([gabble_minor_version], [16]) +m4_define([gabble_micro_version], [0]) m4_define([gabble_nano_version], [0]) # Some magic @@ -222,7 +222,7 @@ dnl dummy check for gtk-doc AC_ARG_ENABLE(gtk-doc, - AC_HELP_STRING([--enable-gtk-doc],[doesn't actually do anything]), + AC_HELP_STRING([--enable-gtk-doc],[does not actually do anything]), enable_gtk_doc=yes, enable_gtk_doc=no) AM_CONDITIONAL([ENABLE_GTK_DOC], [test "x$enable_gtk_doc" = xyes]) @@ -238,6 +238,20 @@ GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) +# These must contain "exec" for automake to work right (install-exec, +# not install-data). +# +# Private directory for Wocky and the gabble-plugins library +if test "x$pluginexeclibdir" = x; then + pluginexeclibdir='${libdir}/telepathy/gabble-0/lib' +fi +AC_ARG_VAR([pluginexeclibdir]) +# The actual plugins +if test "x$pluginexecdir" = x; then + pluginexecdir='${libdir}/telepathy/gabble-0/plugins' +fi +AC_ARG_VAR([pluginexecdir]) + AC_ARG_ENABLE(plugins, AC_HELP_STRING([--disable-plugins], [disable plugin loader]), @@ -282,7 +296,7 @@ AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) -PKG_CHECK_MODULES(TP_GLIB, [telepathy-glib >= 0.17.5]) +PKG_CHECK_MODULES(TP_GLIB, [telepathy-glib >= 0.18.0]) AC_SUBST(TP_GLIB_CFLAGS) AC_SUBST(TP_GLIB_LIBS) @@ -309,32 +323,31 @@ # We have to run Wocky's configure *before* looking for it with PKG_CHECK_MODULES so wocky-uninstalled.pc has been generated +# If you don't specify --prefix, it starts off as NONE. Autoconf +# would normally do this defaulting for us later, but that's too +# late to help Wocky. +if test "x${prefix}" = "xNONE"; then + prefix=/usr/local +fi + # We tell Wocky to install its headers alongside gabble's so that an actual # separate Wocky installation won't clash with them. This is a bit of a hack. # AX_CONFIG_DIR doesn't make it very easy to pass extra arguments to the # submodule's configure. prev_ac_configure_args=$ac_configure_args -ac_configure_args="$ac_configure_args --with-installed-headers=${wocky_install_headers_dir}" -# Code from the submodules will be linked in to the gabble-plugins.so shared library, so they need -# to be compiled as position-independent code. Pass on any other flags we got as well. -# -# On some platforms -fPIC results in a "all code is position independent" warning though, so let's -# try to compile with -Werror to find out if the current platform is one of these. -sub_cflags="$CFLAGS" -TP_COMPILER_FLAG([-fPIC -Werror], [sub_cflags+=" -fPIC"]) -ac_configure_args+=" CFLAGS=\"$sub_cflags\"" +ac_configure_args="$ac_configure_args --with-installed-headers=${wocky_install_headers_dir} --enable-shared-suffix=${PACKAGE}-${VERSION} --libdir=${pluginexeclibdir}" if test "x$ENABLE_CODING_STYLE_CHECKS" = xyes ; then - ac_configure_args+=" --enable-coding-style-checks" + ac_configure_args="$ac_configure_args --enable-coding-style-checks" else - ac_configure_args+=" --disable-coding-style-checks" + ac_configure_args="$ac_configure_args --disable-coding-style-checks" fi if test "x$tp_werror" = xyes && test "x$official_release" = xno; then - ac_configure_args+=" --enable-Werror" + ac_configure_args="$ac_configure_args --enable-Werror" else - ac_configure_args+=" --disable-Werror" + ac_configure_args="$ac_configure_args --disable-Werror" fi dnl wocky @@ -384,16 +397,32 @@ if test x$enable_ft = xyes; then AC_DEFINE(ENABLE_FILE_TRANSFER, [], [Enable file transfer]) +fi +AM_CONDITIONAL([ENABLE_FILE_TRANSFER], [test "x$enable_ft" = xyes]) +AC_ARG_ENABLE(voip, + AC_HELP_STRING([--disable-voip], + [disable VoIP support (and, consequently, Jingle-based file transfer support]), + [enable_voip=$enableval], [enable_voip=yes]) + +if test x$enable_voip = xyes; then + AC_DEFINE(ENABLE_VOIP, [], [Enable VoIP]) +fi +AM_CONDITIONAL([ENABLE_VOIP], [test "x$enable_voip" = xyes]) + +if test x$enable_voip = xyes -a x$enable_ft = xyes; then + enable_jingle_ft=yes + AC_DEFINE(ENABLE_JINGLE_FILE_TRANSFER, [], [Enable file transfer]) dnl Check for libnice PKG_CHECK_MODULES(NICE, nice >= 0.0.11) else + enable_jingle_ft=no NICE_CFLAGS= NICE_LIBS= fi AC_SUBST(NICE_CFLAGS) AC_SUBST(NICE_LIBS) -AM_CONDITIONAL([ENABLE_FILE_TRANSFER], [test "x$enable_ft" = xyes]) +AM_CONDITIONAL([ENABLE_JINGLE_FILE_TRANSFER], [test "x$enable_jingle_ft" = xyes]) AC_CHECK_FUNCS(getifaddrs memset select strndup setresuid setreuid strerror) @@ -441,5 +470,7 @@ Channel.Type.Call support...: ${enable_channel_type_call} Google relay support........: ${enable_google_relay} File transfer support.......: ${enable_ft} + Jingle file transfer support: ${enable_jingle_ft} + VoIP support................: ${enable_voip} " diff -Nru telepathy-gabble-0.15.4/data/Makefile.am telepathy-gabble-0.16.0/data/Makefile.am --- telepathy-gabble-0.15.4/data/Makefile.am 2012-01-18 12:45:07.000000000 +0000 +++ telepathy-gabble-0.16.0/data/Makefile.am 2012-03-09 15:29:20.000000000 +0000 @@ -15,10 +15,6 @@ CLEANFILES = $(service_DATA) $(manager_DATA) -if WINDOWS - ext = ".exe" -endif - $(manager_DATA): ../src/write-mgr-file.c ../src/protocol.c ../src/protocol.h - @$(MAKE) -C ../src write-mgr-file$(ext) - $(AM_V_GEN)../src/write-mgr-file$(ext) > $@ + @$(MAKE) -C ../src write-mgr-file$(EXEEXT) + $(AM_V_GEN)../src/write-mgr-file$(EXEEXT) > $@ diff -Nru telepathy-gabble-0.15.4/data/Makefile.in telepathy-gabble-0.16.0/data/Makefile.in --- telepathy-gabble-0.15.4/data/Makefile.in 2012-02-21 19:23:45.000000000 +0000 +++ telepathy-gabble-0.16.0/data/Makefile.in 2012-04-02 21:29:19.000000000 +0000 @@ -223,6 +223,8 @@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ +pluginexecdir = @pluginexecdir@ +pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -242,7 +244,6 @@ servicedir = $(datadir)/dbus-1/services service_DATA = org.freedesktop.Telepathy.ConnectionManager.gabble.service CLEANFILES = $(service_DATA) $(manager_DATA) -@WINDOWS_TRUE@ext = ".exe" all: all-am .SUFFIXES: @@ -483,8 +484,8 @@ $(AM_V_GEN)sed -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@ $(manager_DATA): ../src/write-mgr-file.c ../src/protocol.c ../src/protocol.h - @$(MAKE) -C ../src write-mgr-file$(ext) - $(AM_V_GEN)../src/write-mgr-file$(ext) > $@ + @$(MAKE) -C ../src write-mgr-file$(EXEEXT) + $(AM_V_GEN)../src/write-mgr-file$(EXEEXT) > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru telepathy-gabble-0.15.4/debian/changelog telepathy-gabble-0.16.0/debian/changelog --- telepathy-gabble-0.15.4/debian/changelog 2012-03-09 15:59:28.000000000 +0000 +++ telepathy-gabble-0.16.0/debian/changelog 2012-04-03 15:54:08.000000000 +0000 @@ -1,3 +1,16 @@ +telepathy-gabble (0.16.0-0ubuntu1) precise; urgency=low + + * New upstream release. + - Correctly convert between Telepathy and Jingle candidate types + - Start sending automatically on accepting bidirectional calls. + * debian/control + - bump build depends for libtelepathy-glib-dev to >= 0.18.0 + * debian/rules + - no longer strip -Bsymbolic-function from LDFLAGS, bug has been fixed + upstream + + -- Ken VanDine Tue, 03 Apr 2012 11:54:00 -0400 + telepathy-gabble (0.15.4-1ubuntu1) precise; urgency=low * Merge with Debian experimental. Remaining Ubuntu changes: diff -Nru telepathy-gabble-0.15.4/debian/control telepathy-gabble-0.16.0/debian/control --- telepathy-gabble-0.15.4/debian/control 2012-02-22 19:55:21.000000000 +0000 +++ telepathy-gabble-0.16.0/debian/control 2012-04-03 14:30:23.000000000 +0000 @@ -17,7 +17,7 @@ libgnutls-dev (>= 2.8.2), libsasl2-dev, libsoup2.4-dev, - libtelepathy-glib-dev (>= 0.17.5), + libtelepathy-glib-dev (>= 0.18.0), python, xsltproc, libsqlite3-dev, diff -Nru telepathy-gabble-0.15.4/debian/rules telepathy-gabble-0.16.0/debian/rules --- telepathy-gabble-0.15.4/debian/rules 2012-03-05 21:36:50.000000000 +0000 +++ telepathy-gabble-0.16.0/debian/rules 2012-03-28 19:24:40.000000000 +0000 @@ -1,7 +1,5 @@ #!/usr/bin/make -f -export LDFLAGS=$(shell DEB_LDFLAGS_STRIP=-Wl,-Bsymbolic-functions dpkg-buildflags --get LDFLAGS) - %: dh $@ --with autotools_dev diff -Nru telepathy-gabble-0.15.4/debian/telepathy-gabble.install telepathy-gabble-0.16.0/debian/telepathy-gabble.install --- telepathy-gabble-0.15.4/debian/telepathy-gabble.install 2012-02-22 19:54:55.000000000 +0000 +++ telepathy-gabble-0.16.0/debian/telepathy-gabble.install 2012-04-03 14:49:07.000000000 +0000 @@ -1,7 +1,6 @@ debian/tmp/usr/lib/telepathy/telepathy-gabble -debian/tmp/usr/lib/telepathy/gabble-0/*.so -debian/tmp/usr/bin/telepathy-gabble-xmpp-console -debian/tmp/usr/lib/libgabble-plugins.so +debian/tmp/usr/lib/telepathy/gabble-0/lib/*.so +debian/tmp/usr/lib/telepathy/gabble-0/plugins/*.so debian/tmp/usr/share/man debian/tmp/usr/share/dbus-1 debian/tmp/usr/share/telepathy diff -Nru telepathy-gabble-0.15.4/docs/Makefile.in telepathy-gabble-0.16.0/docs/Makefile.in --- telepathy-gabble-0.15.4/docs/Makefile.in 2012-02-21 19:23:45.000000000 +0000 +++ telepathy-gabble-0.16.0/docs/Makefile.in 2012-04-02 21:29:19.000000000 +0000 @@ -228,6 +228,8 @@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ +pluginexecdir = @pluginexecdir@ +pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -Nru telepathy-gabble-0.15.4/extensions/Makefile.in telepathy-gabble-0.16.0/extensions/Makefile.in --- telepathy-gabble-0.15.4/extensions/Makefile.in 2012-02-21 19:23:45.000000000 +0000 +++ telepathy-gabble-0.16.0/extensions/Makefile.in 2012-04-02 21:29:19.000000000 +0000 @@ -227,6 +227,8 @@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ +pluginexecdir = @pluginexecdir@ +pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -Nru telepathy-gabble-0.15.4/gabble/Makefile.in telepathy-gabble-0.16.0/gabble/Makefile.in --- telepathy-gabble-0.15.4/gabble/Makefile.in 2012-02-21 20:37:53.000000000 +0000 +++ telepathy-gabble-0.16.0/gabble/Makefile.in 2012-04-02 21:29:19.000000000 +0000 @@ -235,6 +235,8 @@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ +pluginexecdir = @pluginexecdir@ +pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -Nru telepathy-gabble-0.15.4/gabble/telepathy-gabble.pc.in telepathy-gabble-0.16.0/gabble/telepathy-gabble.pc.in --- telepathy-gabble-0.15.4/gabble/telepathy-gabble.pc.in 2012-02-09 12:56:57.000000000 +0000 +++ telepathy-gabble-0.16.0/gabble/telepathy-gabble.pc.in 2012-03-26 18:00:06.000000000 +0000 @@ -3,8 +3,8 @@ libdir=@libdir@ includedir=@includedir@ libexecdir=@libexecdir@ - -plugindir=${libdir}/telepathy/gabble-0 +pluginexecdir=@pluginexecdir@ +pluginexeclibdir=@pluginexeclibdir@ gabblepath=${libexecdir}/telepathy-gabble # For plugins' tests Name: Telepathy-Gabble @@ -12,5 +12,5 @@ Version: @VERSION@ Requires: pkg-config >= 0.21 Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0, telepathy-glib >= 0.7.37 -Libs: -L${libdir} -lgabble-plugins +Libs: -L${pluginexeclibdir} -lgabble-plugins -lwocky Cflags: -I${includedir}/telepathy-gabble-0 diff -Nru telepathy-gabble-0.15.4/gabble/telepathy-gabble-uninstalled.pc.in telepathy-gabble-0.16.0/gabble/telepathy-gabble-uninstalled.pc.in --- telepathy-gabble-0.15.4/gabble/telepathy-gabble-uninstalled.pc.in 2012-02-09 12:56:57.000000000 +0000 +++ telepathy-gabble-0.16.0/gabble/telepathy-gabble-uninstalled.pc.in 2012-03-26 18:00:06.000000000 +0000 @@ -3,8 +3,9 @@ abs_top_srcdir=@abs_top_srcdir@ abs_top_builddir=@abs_top_builddir@ libdir=@libdir@ +pluginexecdir=@pluginexecdir@ +pluginexeclibdir=@pluginexeclibdir@ -plugindir=${libdir}/telepathy/gabble-0 gabblepath=@abs_top_builddir@/src/telepathy-gabble # For plugins' tests Name: Telepathy-Gabble diff -Nru telepathy-gabble-0.15.4/lib/ext/Makefile.in telepathy-gabble-0.16.0/lib/ext/Makefile.in --- telepathy-gabble-0.15.4/lib/ext/Makefile.in 2012-02-21 19:23:45.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/Makefile.in 2012-04-02 21:29:19.000000000 +0000 @@ -232,6 +232,8 @@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ +pluginexecdir = @pluginexecdir@ +pluginexeclibdir = @pluginexeclibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/config.guess telepathy-gabble-0.16.0/lib/ext/wocky/config.guess --- telepathy-gabble-0.15.4/lib/ext/wocky/config.guess 2012-01-31 11:06:45.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/config.guess 2012-03-07 21:40:15.000000000 +0000 @@ -2,9 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-05-11' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -57,8 +55,8 @@ Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +143,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -792,13 +790,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -807,6 +804,9 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,6 +861,13 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,13 +902,16 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -943,7 +953,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -978,13 +988,13 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1315,6 +1325,9 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/config.sub telepathy-gabble-0.16.0/lib/ext/wocky/config.sub --- telepathy-gabble-0.15.4/lib/ext/wocky/config.sub 2012-01-31 11:06:45.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/config.sub 2012-03-07 21:40:15.000000000 +0000 @@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-03-23' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -76,8 +74,8 @@ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +130,10 @@ os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -247,17 +249,22 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -291,7 +298,7 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -300,7 +307,7 @@ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -315,8 +322,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -329,7 +335,10 @@ strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -352,11 +361,13 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -365,8 +376,10 @@ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -400,7 +413,7 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ @@ -408,10 +421,11 @@ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -711,7 +725,6 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -808,10 +821,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -1120,13 +1141,8 @@ basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1336,7 +1352,7 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1548,9 +1564,6 @@ ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/configure telepathy-gabble-0.16.0/lib/ext/wocky/configure --- telepathy-gabble-0.15.4/lib/ext/wocky/configure 2012-02-09 13:01:35.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/configure 2012-04-02 15:49:22.000000000 +0000 @@ -666,6 +666,9 @@ PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG +SHARED_SUFFIX +ENABLE_SHARED_SUFFIX_FALSE +ENABLE_SHARED_SUFFIX_TRUE HEADER_DIR INSTALL_HEADERS_FALSE INSTALL_HEADERS_TRUE @@ -804,6 +807,7 @@ enable_coding_style_checks enable_debug with_installed_headers +enable_shared_suffix with_tls enable_prefer_stream_ciphers enable_coverage @@ -1474,6 +1478,8 @@ --disable-coding-style-checks do not check coding style using grep --disable-debug compile without debug code + --enable-shared-suffix= install a shared library with a version-specific + suffix --enable-prefer-stream-ciphers prefer stream ciphers over block ciphers to save bandwidth (at the possible expense of security) @@ -12923,6 +12929,24 @@ HEADER_DIR=$with_installed_headers +# Check whether --enable-shared-suffix was given. +if test "${enable_shared_suffix+set}" = set; then : + enableval=$enable_shared_suffix; +else + enable_shared_suffix= +fi + + if test x$enable_shared_suffix != x; then + ENABLE_SHARED_SUFFIX_TRUE= + ENABLE_SHARED_SUFFIX_FALSE='#' +else + ENABLE_SHARED_SUFFIX_TRUE='#' + ENABLE_SHARED_SUFFIX_FALSE= +fi + +SHARED_SUFFIX="$enable_shared_suffix" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : @@ -15152,6 +15176,10 @@ as_fn_error $? "conditional \"INSTALL_HEADERS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_SHARED_SUFFIX_TRUE}" && test -z "${ENABLE_SHARED_SUFFIX_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_SHARED_SUFFIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_GIO_PROXY_TRUE}" && test -z "${HAVE_GIO_PROXY_FALSE}"; then as_fn_error $? "conditional \"HAVE_GIO_PROXY\" was never defined. diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/configure.ac telepathy-gabble-0.16.0/lib/ext/wocky/configure.ac --- telepathy-gabble-0.15.4/lib/ext/wocky/configure.ac 2012-01-31 11:06:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/configure.ac 2012-03-09 18:32:28.000000000 +0000 @@ -99,6 +99,16 @@ HEADER_DIR=$with_installed_headers AC_SUBST(HEADER_DIR) +dnl Build a shared library even though Wocky isn't stable yet? +AC_ARG_ENABLE([shared-suffix], + AC_HELP_STRING([--enable-shared-suffix=], + [install a shared library with a version-specific suffix]), + [], + [enable_shared_suffix=]) +AM_CONDITIONAL([ENABLE_SHARED_SUFFIX], [test x$enable_shared_suffix != x]) +SHARED_SUFFIX="$enable_shared_suffix" +AC_SUBST([SHARED_SUFFIX]) + dnl Check for code generation tools AC_HEADER_STDC([]) AC_CHECK_HEADERS_ONCE([unistd.h]) diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/docs/Makefile.in --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/Makefile.in 2012-02-09 13:01:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/Makefile.in 2012-04-02 15:49:23.000000000 +0000 @@ -191,6 +191,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ +SHARED_SUFFIX = @SHARED_SUFFIX@ SHELL = @SHELL@ SQLITE_CFLAGS = @SQLITE_CFLAGS@ SQLITE_LIBS = @SQLITE_LIBS@ diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/api-index-full.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/api-index-full.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/api-index-full.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/api-index-full.html 2012-04-02 21:32:11.000000000 +0000 @@ -2162,19 +2162,19 @@
-WockyTLSCertStatus, enum in Wocky OpenSSL TLS +WockyTLSCertStatus, enum in Wocky GnuTLS TLS
-WockyTLSCertType, enum in Wocky OpenSSL TLS +WockyTLSCertType, enum in Wocky GnuTLS TLS
-WockyTLSConnection, struct in Wocky OpenSSL TLS +WockyTLSConnection, struct in Wocky GnuTLS TLS
-WockyTLSConnection:session, object property in Wocky OpenSSL TLS +WockyTLSConnection:session, object property in Wocky GnuTLS TLS
@@ -2194,39 +2194,39 @@
-WockyTLSSession, struct in Wocky OpenSSL TLS +WockyTLSSession, struct in Wocky GnuTLS TLS
-WockyTLSSession:base-stream, object property in Wocky OpenSSL TLS +WockyTLSSession:base-stream, object property in Wocky GnuTLS TLS
-WockyTLSSession:dh-bits, object property in Wocky OpenSSL TLS +WockyTLSSession:dh-bits, object property in Wocky GnuTLS TLS
-WockyTLSSession:server, object property in Wocky OpenSSL TLS +WockyTLSSession:server, object property in Wocky GnuTLS TLS
-WockyTLSSession:x509-cert, object property in Wocky OpenSSL TLS +WockyTLSSession:x509-cert, object property in Wocky GnuTLS TLS
-WockyTLSSession:x509-key, object property in Wocky OpenSSL TLS +WockyTLSSession:x509-key, object property in Wocky GnuTLS TLS
-WockyTLSVerificationLevel, enum in Wocky OpenSSL TLS +WockyTLSVerificationLevel, enum in Wocky GnuTLS TLS
-WOCKY_TLS_CERT_ERROR, macro in Wocky OpenSSL TLS +WOCKY_TLS_CERT_ERROR, macro in Wocky GnuTLS TLS
-wocky_tls_cert_error_quark, function in Wocky OpenSSL TLS +wocky_tls_cert_error_quark, function in Wocky GnuTLS TLS
@@ -2242,11 +2242,11 @@
-WOCKY_TLS_ERROR, macro in Wocky OpenSSL TLS +WOCKY_TLS_ERROR, macro in Wocky GnuTLS TLS
-wocky_tls_error_quark, function in Wocky OpenSSL TLS +wocky_tls_error_quark, function in Wocky GnuTLS TLS
@@ -2278,39 +2278,39 @@
-wocky_tls_session_add_ca, function in Wocky OpenSSL TLS +wocky_tls_session_add_ca, function in Wocky GnuTLS TLS
-wocky_tls_session_add_crl, function in Wocky OpenSSL TLS +wocky_tls_session_add_crl, function in Wocky GnuTLS TLS
-wocky_tls_session_get_peers_certificate, function in Wocky OpenSSL TLS +wocky_tls_session_get_peers_certificate, function in Wocky GnuTLS TLS
-wocky_tls_session_handshake, function in Wocky OpenSSL TLS +wocky_tls_session_handshake, function in Wocky GnuTLS TLS
-wocky_tls_session_handshake_async, function in Wocky OpenSSL TLS +wocky_tls_session_handshake_async, function in Wocky GnuTLS TLS
-wocky_tls_session_handshake_finish, function in Wocky OpenSSL TLS +wocky_tls_session_handshake_finish, function in Wocky GnuTLS TLS
-wocky_tls_session_new, function in Wocky OpenSSL TLS +wocky_tls_session_new, function in Wocky GnuTLS TLS
-wocky_tls_session_server_new, function in Wocky OpenSSL TLS +wocky_tls_session_server_new, function in Wocky GnuTLS TLS
-wocky_tls_session_verify_peer, function in Wocky OpenSSL TLS +wocky_tls_session_verify_peer, function in Wocky GnuTLS TLS

W

diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/ch01.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/ch01.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/ch01.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/ch01.html 2012-04-02 21:32:11.000000000 +0000 @@ -21,7 +21,7 @@

-API Reference

+API Reference
WockyAuthHandler @@ -169,7 +169,7 @@ wocky-tls-enumtypes
-Wocky OpenSSL TLS — Establish TLS sessions +Wocky GnuTLS TLS — Establish TLS sessions
WockyTLSHandler diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/index.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/index.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/index.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/index.html 2012-04-02 21:32:11.000000000 +0000 @@ -164,7 +164,7 @@ wocky-tls-enumtypes
-Wocky OpenSSL TLS — Establish TLS sessions +Wocky GnuTLS TLS — Establish TLS sessions
WockyTLSHandler diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/index.sgml telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/index.sgml --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/index.sgml 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/index.sgml 2012-04-02 21:32:11.000000000 +0000 @@ -855,42 +855,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/object-tree.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/object-tree.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/object-tree.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/object-tree.html 2012-04-02 21:32:11.000000000 +0000 @@ -31,11 +31,11 @@ WockyResourceContact WockyCapsCache GIOStream - WockyTLSConnection + WockyTLSConnection WockyNodeTree WockyPubsubNode WockySession - WockyTLSSession + WockyTLSSession WockyHttpProxy GEnum WockyAuthError @@ -52,9 +52,9 @@ WockyPubsubServiceError WockyPubsubSubscriptionState WockySIError - WockyTLSCertStatus - WockyTLSCertType - WockyTLSVerificationLevel + WockyTLSCertStatus + WockyTLSCertType + WockyTLSVerificationLevel WockyXmppError WockyXmppErrorType WockyXmppReaderError diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky.devhelp2 telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky.devhelp2 --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky.devhelp2 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky.devhelp2 2012-04-02 21:32:11.000000000 +0000 @@ -51,7 +51,7 @@ - + @@ -531,30 +531,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/WockyNodeTree.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/WockyNodeTree.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/WockyNodeTree.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/WockyNodeTree.html 2012-04-02 21:32:11.000000000 +0000 @@ -80,7 +80,7 @@

-

Example 2. 

+

Example 2. 

diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-Wocky-GnuTLS-TLS.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-Wocky-GnuTLS-TLS.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-Wocky-GnuTLS-TLS.html 1970-01-01 00:00:00.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-Wocky-GnuTLS-TLS.html 2012-04-02 21:32:11.000000000 +0000 @@ -0,0 +1,351 @@ + + + + +Wocky GnuTLS TLS + + + + + + + + + +
+ + + + + + + + + +
+
+
+ + +
+

Wocky GnuTLS TLS

+

Wocky GnuTLS TLS — Establish TLS sessions

+
+ +
+

Object Hierarchy

+
+  GEnum
+   +----WockyTLSCertStatus
+
+
+  GEnum
+   +----WockyTLSCertType
+
+
+  GObject
+   +----GIOStream
+         +----WockyTLSConnection
+
+
+  GObject
+   +----WockyTLSSession
+
+
+  GEnum
+   +----WockyTLSVerificationLevel
+
+
+
+

Properties

+
+  "session"                  WockyTLSSession*      : Write / Construct Only
+  "base-stream"              GIOStream*            : Write / Construct Only
+  "dh-bits"                  guint                 : Write / Construct Only
+  "server"                   gboolean              : Write / Construct Only
+  "x509-cert"                gchar*                : Write / Construct Only
+  "x509-key"                 gchar*                : Write / Construct Only
+
+
+
+

Description

+

+The WOCKY_TLS_DEBUG_LEVEL environment variable can be used to print debug +output from GNU TLS. To enable it, set it to a value from 1 to 9. +Higher values will print more information. See the documentation of +gnutls_global_set_log_level for more details. +

+

+Increasing the value past certain thresholds will also trigger increased +debugging output from within wocky-tls.c as well. +

+

+The WOCKY_GNUTLS_OPTIONS environment variable can be set to a gnutls +priority string [See gnutls-cli(1) or the gnutls_priority_init docs] +to control most tls protocol details. An empty or unset value is roughly +equivalent to a priority string of "SECURE:+COMP-DEFLATE". +

+
+
+

Details

+
+

WOCKY_TLS_CERT_ERROR

+
#define WOCKY_TLS_CERT_ERROR (wocky_tls_cert_error_quark ())
+
+
+
+
+

WOCKY_TLS_ERROR

+
#define WOCKY_TLS_ERROR (wocky_tls_error_quark ())
+
+
+
+
+

enum WockyTLSCertStatus

+
typedef enum {
+  WOCKY_TLS_CERT_OK = 0,
+  WOCKY_TLS_CERT_INVALID,
+  WOCKY_TLS_CERT_NAME_MISMATCH,
+  WOCKY_TLS_CERT_REVOKED,
+  WOCKY_TLS_CERT_SIGNER_UNKNOWN,
+  WOCKY_TLS_CERT_SIGNER_UNAUTHORISED,
+  WOCKY_TLS_CERT_INSECURE,
+  WOCKY_TLS_CERT_NOT_ACTIVE,
+  WOCKY_TLS_CERT_EXPIRED,
+  WOCKY_TLS_CERT_NO_CERTIFICATE,
+  WOCKY_TLS_CERT_MAYBE_DOS,
+  WOCKY_TLS_CERT_INTERNAL_ERROR,
+  WOCKY_TLS_CERT_UNKNOWN_ERROR,
+} WockyTLSCertStatus;
+
+
+
+
+

enum WockyTLSCertType

+
typedef enum {
+  WOCKY_TLS_CERT_TYPE_NONE = 0,
+  WOCKY_TLS_CERT_TYPE_X509,
+  WOCKY_TLS_CERT_TYPE_OPENPGP,
+} WockyTLSCertType;
+
+
+
+
+

WockyTLSConnection

+
typedef struct _WockyTLSConnection WockyTLSConnection;
+
+
+
+

WockyTLSSession

+
typedef struct _WockyTLSSession WockyTLSSession;
+
+
+
+

enum WockyTLSVerificationLevel

+
typedef enum {
+  WOCKY_TLS_VERIFY_STRICT = 0,
+  WOCKY_TLS_VERIFY_NORMAL,
+  WOCKY_TLS_VERIFY_LENIENT,
+} WockyTLSVerificationLevel;
+
+
+
+
+

wocky_tls_cert_error_quark ()

+
GQuark              wocky_tls_cert_error_quark          (void);
+
+
+
+

wocky_tls_error_quark ()

+
GQuark              wocky_tls_error_quark               (void);
+
+
+
+

wocky_tls_session_add_ca ()

+
void                wocky_tls_session_add_ca            (WockyTLSSession *session,
+                                                         const gchar *path);
+
+
+
+

wocky_tls_session_add_crl ()

+
void                wocky_tls_session_add_crl           (WockyTLSSession *session,
+                                                         const gchar *path);
+
+
+
+

wocky_tls_session_get_peers_certificate ()

+
GPtrArray *         wocky_tls_session_get_peers_certificate
+                                                        (WockyTLSSession *session,
+                                                         WockyTLSCertType *type);
+
+
+
+

wocky_tls_session_handshake ()

+
WockyTLSConnection * wocky_tls_session_handshake        (WockyTLSSession *session,
+                                                         GCancellable *cancellable,
+                                                         GError **error);
+
+
+
+

wocky_tls_session_handshake_async ()

+
void                wocky_tls_session_handshake_async   (WockyTLSSession *session,
+                                                         gint io_priority,
+                                                         GCancellable *cancellable,
+                                                         GAsyncReadyCallback callback,
+                                                         gpointer user_data);
+
+
+
+

wocky_tls_session_handshake_finish ()

+
WockyTLSConnection * wocky_tls_session_handshake_finish (WockyTLSSession *session,
+                                                         GAsyncResult *result,
+                                                         GError **error);
+
+
+
+

wocky_tls_session_new ()

+
WockyTLSSession *   wocky_tls_session_new               (GIOStream *stream);
+
+
+
+

wocky_tls_session_server_new ()

+
WockyTLSSession *   wocky_tls_session_server_new        (GIOStream *stream,
+                                                         guint dhbits,
+                                                         const gchar *key,
+                                                         const gchar *cert);
+

+Create a new TLS server session +

+
++ + + + + + + + + + + + + + + + + + + + + + +

stream :

a GIOStream on which we expect to receive the client TLS handshake

dhbits :

size of the DH parameters (see gnutls for valid settings)

key :

the path to the X509 PEM key file

cert :

the path to the X509 PEM certificate

Returns :

a WockyTLSSession object
+
+
+
+

wocky_tls_session_verify_peer ()

+
int                 wocky_tls_session_verify_peer       (WockyTLSSession *session,
+                                                         const gchar *peername,
+                                                         GStrv extra_identities,
+                                                         WockyTLSVerificationLevel level,
+                                                         WockyTLSCertStatus *status);
+
+
+
+

Property Details

+
+

The "session" property

+
  "session"                  WockyTLSSession*      : Write / Construct Only
+

the TLS session object for this connection.

+
+
+
+

The "base-stream" property

+
  "base-stream"              GIOStream*            : Write / Construct Only
+

the stream that TLS communicates over.

+
+
+
+

The "dh-bits" property

+
  "dh-bits"                  guint                 : Write / Construct Only
+

Diffie-Hellmann bits: 768, 1024, 2048, 3072 0r 4096.

+

Allowed values: [768,4096]

+

Default value: 1024

+
+
+
+

The "server" property

+
  "server"                   gboolean              : Write / Construct Only
+

whether this is a server.

+

Default value: FALSE

+
+
+
+

The "x509-cert" property

+
  "x509-cert"                gchar*                : Write / Construct Only
+

x509 PEM certificate file.

+

Default value: NULL

+
+
+
+

The "x509-key" property

+
  "x509-key"                 gchar*                : Write / Construct Only
+

x509 PEM key file.

+

Default value: NULL

+
+
+
+ + + \ No newline at end of file diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-WockyNode.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-WockyNode.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-WockyNode.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-WockyNode.html 2012-04-02 21:32:11.000000000 +0000 @@ -283,7 +283,7 @@ Add a node subtree to an existing parent node.

-

Example 1. 

+

Example 1. 

diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-Wocky-OpenSSL-TLS.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-Wocky-OpenSSL-TLS.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-Wocky-OpenSSL-TLS.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-Wocky-OpenSSL-TLS.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,344 +0,0 @@ - - - - -Wocky OpenSSL TLS - - - - - - - - - -
- - - - - - - - - -
-
-
- - -
-

Wocky OpenSSL TLS

-

Wocky OpenSSL TLS — Establish TLS sessions

-
- -
-

Object Hierarchy

-
-  GEnum
-   +----WockyTLSCertStatus
-
-
-  GEnum
-   +----WockyTLSCertType
-
-
-  GObject
-   +----GIOStream
-         +----WockyTLSConnection
-
-
-  GObject
-   +----WockyTLSSession
-
-
-  GEnum
-   +----WockyTLSVerificationLevel
-
-
-
-

Properties

-
-  "session"                  WockyTLSSession*      : Write / Construct Only
-  "base-stream"              GIOStream*            : Write / Construct Only
-  "dh-bits"                  guint                 : Write / Construct Only
-  "server"                   gboolean              : Write / Construct Only
-  "x509-cert"                gchar*                : Write / Construct Only
-  "x509-key"                 gchar*                : Write / Construct Only
-
-
-
-

Description

-

-The WOCKY_TLS_DEBUG_LEVEL environment variable can be used to print debug -output from OpenSSL. To enable it, set it to a value from 1 to 9. -Higher values will print more information. -

-

-Increasing the value past certain thresholds will also trigger increased -debugging output from within wocky-openssl.c as well. -

-
-
-

Details

-
-

WOCKY_TLS_CERT_ERROR

-
#define WOCKY_TLS_CERT_ERROR (wocky_tls_cert_error_quark ())
-
-
-
-
-

WOCKY_TLS_ERROR

-
#define WOCKY_TLS_ERROR (wocky_tls_error_quark ())
-
-
-
-
-

enum WockyTLSCertStatus

-
typedef enum {
-  WOCKY_TLS_CERT_OK = 0,
-  WOCKY_TLS_CERT_INVALID,
-  WOCKY_TLS_CERT_NAME_MISMATCH,
-  WOCKY_TLS_CERT_REVOKED,
-  WOCKY_TLS_CERT_SIGNER_UNKNOWN,
-  WOCKY_TLS_CERT_SIGNER_UNAUTHORISED,
-  WOCKY_TLS_CERT_INSECURE,
-  WOCKY_TLS_CERT_NOT_ACTIVE,
-  WOCKY_TLS_CERT_EXPIRED,
-  WOCKY_TLS_CERT_NO_CERTIFICATE,
-  WOCKY_TLS_CERT_MAYBE_DOS,
-  WOCKY_TLS_CERT_INTERNAL_ERROR,
-  WOCKY_TLS_CERT_UNKNOWN_ERROR,
-} WockyTLSCertStatus;
-
-
-
-
-

enum WockyTLSCertType

-
typedef enum {
-  WOCKY_TLS_CERT_TYPE_NONE = 0,
-  WOCKY_TLS_CERT_TYPE_X509,
-  WOCKY_TLS_CERT_TYPE_OPENPGP,
-} WockyTLSCertType;
-
-
-
-
-

WockyTLSConnection

-
typedef struct _WockyTLSConnection WockyTLSConnection;
-
-
-
-

WockyTLSSession

-
typedef struct _WockyTLSSession WockyTLSSession;
-
-
-
-

enum WockyTLSVerificationLevel

-
typedef enum {
-  WOCKY_TLS_VERIFY_STRICT = 0,
-  WOCKY_TLS_VERIFY_NORMAL,
-  WOCKY_TLS_VERIFY_LENIENT,
-} WockyTLSVerificationLevel;
-
-
-
-
-

wocky_tls_cert_error_quark ()

-
GQuark              wocky_tls_cert_error_quark          (void);
-
-
-
-

wocky_tls_error_quark ()

-
GQuark              wocky_tls_error_quark               (void);
-
-
-
-

wocky_tls_session_add_ca ()

-
void                wocky_tls_session_add_ca            (WockyTLSSession *session,
-                                                         const gchar *path);
-
-
-
-

wocky_tls_session_add_crl ()

-
void                wocky_tls_session_add_crl           (WockyTLSSession *session,
-                                                         const gchar *path);
-
-
-
-

wocky_tls_session_get_peers_certificate ()

-
GPtrArray *         wocky_tls_session_get_peers_certificate
-                                                        (WockyTLSSession *session,
-                                                         WockyTLSCertType *type);
-
-
-
-

wocky_tls_session_handshake ()

-
WockyTLSConnection * wocky_tls_session_handshake        (WockyTLSSession *session,
-                                                         GCancellable *cancellable,
-                                                         GError **error);
-
-
-
-

wocky_tls_session_handshake_async ()

-
void                wocky_tls_session_handshake_async   (WockyTLSSession *session,
-                                                         gint io_priority,
-                                                         GCancellable *cancellable,
-                                                         GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-
-
-
-

wocky_tls_session_handshake_finish ()

-
WockyTLSConnection * wocky_tls_session_handshake_finish (WockyTLSSession *session,
-                                                         GAsyncResult *result,
-                                                         GError **error);
-
-
-
-

wocky_tls_session_new ()

-
WockyTLSSession *   wocky_tls_session_new               (GIOStream *stream);
-
-
-
-

wocky_tls_session_server_new ()

-
WockyTLSSession *   wocky_tls_session_server_new        (GIOStream *stream,
-                                                         guint dhbits,
-                                                         const gchar *key,
-                                                         const gchar *cert);
-

-Create a new TLS server session -

-
-- - - - - - - - - - - - - - - - - - - - - - -

stream :

a GIOStream on which we expect to receive the client TLS handshake

dhbits :

size of the DH parameters

key :

the path to the X509 PEM key file

cert :

the path to the X509 PEM certificate

Returns :

a WockyTLSSession object
-
-
-
-

wocky_tls_session_verify_peer ()

-
int                 wocky_tls_session_verify_peer       (WockyTLSSession *session,
-                                                         const gchar *peername,
-                                                         GStrv extra_identities,
-                                                         WockyTLSVerificationLevel level,
-                                                         WockyTLSCertStatus *status);
-
-
-
-

Property Details

-
-

The "session" property

-
  "session"                  WockyTLSSession*      : Write / Construct Only
-

the TLS session object for this connection.

-
-
-
-

The "base-stream" property

-
  "base-stream"              GIOStream*            : Write / Construct Only
-

the stream that TLS communicates over.

-
-
-
-

The "dh-bits" property

-
  "dh-bits"                  guint                 : Write / Construct Only
-

Diffie-Hellmann bits: 768, 1024, 2048, 3072 0r 4096.

-

Allowed values: [768,4096]

-

Default value: 1024

-
-
-
-

The "server" property

-
  "server"                   gboolean              : Write / Construct Only
-

whether this is a server.

-

Default value: FALSE

-
-
-
-

The "x509-cert" property

-
  "x509-cert"                gchar*                : Write / Construct Only
-

x509 PEM certificate file.

-

Default value: NULL

-
-
-
-

The "x509-key" property

-
  "x509-key"                 gchar*                : Write / Construct Only
-

x509 PEM key file.

-

Default value: NULL

-
-
-
- - - \ No newline at end of file diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-WockyStanza.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-WockyStanza.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-WockyStanza.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-WockyStanza.html 2012-04-02 21:32:11.000000000 +0000 @@ -337,7 +337,7 @@

-

Example 3. 

+

Example 3. 

@@ -400,7 +400,7 @@

-

Example 4. 

+

Example 4. 

diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-wocky-tls-enumtypes.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-wocky-tls-enumtypes.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-wocky-tls-enumtypes.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-wocky-tls-enumtypes.html 2012-04-02 21:32:11.000000000 +0000 @@ -7,7 +7,7 @@ - + @@ -18,7 +18,7 @@ - +
Up Home Wocky Reference ManualNextNext
Top diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-WockyTLSHandler.html telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-WockyTLSHandler.html --- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/html/wocky-WockyTLSHandler.html 2012-02-21 21:09:36.000000000 +0000 +++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/html/wocky-WockyTLSHandler.html 2012-04-02 21:32:11.000000000 +0000 @@ -6,7 +6,7 @@ - + @@ -14,7 +14,7 @@ - + @@ -39,7 +39,7 @@

Synopsis

struct              WockyTLSHandlerClass;
 void                (*WockyTLSHandlerVerifyAsyncFunc)   (WockyTLSHandler *self,
-                                                         WockyTLSSession *tls_session,
+                                                         WockyTLSSession *tls_session,
                                                          const gchar *peername,
                                                          GStrv extra_identities,
                                                          GAsyncReadyCallback callback,
@@ -55,7 +55,7 @@
 GSList *            wocky_tls_handler_get_crls          (WockyTLSHandler *self);
 WockyTLSHandler *   wocky_tls_handler_new               (gboolean ignore_ssl_errors);
 void                wocky_tls_handler_verify_async      (WockyTLSHandler *self,
-                                                         WockyTLSSession *tls_session,
+                                                         WockyTLSSession *tls_session,
                                                          const gchar *peername,
                                                          GStrv extra_identities,
                                                          GAsyncReadyCallback callback,
@@ -102,7 +102,7 @@
 

WockyTLSHandlerVerifyAsyncFunc ()

void                (*WockyTLSHandlerVerifyAsyncFunc)   (WockyTLSHandler *self,
-                                                         WockyTLSSession *tls_session,
+                                                         WockyTLSSession *tls_session,
                                                          const gchar *peername,
                                                          GStrv extra_identities,
                                                          GAsyncReadyCallback callback,
@@ -200,7 +200,7 @@
 

wocky_tls_handler_verify_async ()

void                wocky_tls_handler_verify_async      (WockyTLSHandler *self,
-                                                         WockyTLSSession *tls_session,
+                                                         WockyTLSSession *tls_session,
                                                          const gchar *peername,
                                                          GStrv extra_identities,
                                                          GAsyncReadyCallback callback,
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/Makefile.in
--- telepathy-gabble-0.15.4/lib/ext/wocky/docs/reference/Makefile.in	2012-02-09 13:01:36.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/docs/reference/Makefile.in	2012-04-02 15:49:23.000000000 +0000
@@ -158,6 +158,7 @@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
+SHARED_SUFFIX = @SHARED_SUFFIX@
 SHELL = @SHELL@
 SQLITE_CFLAGS = @SQLITE_CFLAGS@
 SQLITE_LIBS = @SQLITE_LIBS@
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/examples/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/examples/Makefile.in
--- telepathy-gabble-0.15.4/lib/ext/wocky/examples/Makefile.in	2012-02-09 13:01:36.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/examples/Makefile.in	2012-04-02 15:49:23.000000000 +0000
@@ -198,6 +198,7 @@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
+SHARED_SUFFIX = @SHARED_SUFFIX@
 SHELL = @SHELL@
 SQLITE_CFLAGS = @SQLITE_CFLAGS@
 SQLITE_LIBS = @SQLITE_LIBS@
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/m4/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/m4/Makefile.in
--- telepathy-gabble-0.15.4/lib/ext/wocky/m4/Makefile.in	2012-02-09 13:01:36.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/m4/Makefile.in	2012-04-02 15:49:23.000000000 +0000
@@ -151,6 +151,7 @@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
+SHARED_SUFFIX = @SHARED_SUFFIX@
 SHELL = @SHELL@
 SQLITE_CFLAGS = @SQLITE_CFLAGS@
 SQLITE_LIBS = @SQLITE_LIBS@
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/Makefile.in
--- telepathy-gabble-0.15.4/lib/ext/wocky/Makefile.in	2012-02-09 13:01:37.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/Makefile.in	2012-04-02 15:49:23.000000000 +0000
@@ -211,6 +211,7 @@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
+SHARED_SUFFIX = @SHARED_SUFFIX@
 SHELL = @SHELL@
 SQLITE_CFLAGS = @SQLITE_CFLAGS@
 SQLITE_LIBS = @SQLITE_LIBS@
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/missing telepathy-gabble-0.16.0/lib/ext/wocky/missing
--- telepathy-gabble-0.15.4/lib/ext/wocky/missing	2012-01-31 11:06:45.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/missing	2012-03-07 21:40:15.000000000 +0000
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-01-06.13; # UTC
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard , 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -84,7 +84,6 @@
   help2man     touch the output file
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
@@ -122,15 +121,6 @@
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
@@ -226,7 +216,7 @@
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -256,7 +246,7 @@
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -318,41 +308,6 @@
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and is $msg.
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/tests/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/tests/Makefile.in
--- telepathy-gabble-0.15.4/lib/ext/wocky/tests/Makefile.in	2012-02-09 13:01:36.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/tests/Makefile.in	2012-04-02 15:49:23.000000000 +0000
@@ -383,6 +383,7 @@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
+SHARED_SUFFIX = @SHARED_SUFFIX@
 SHELL = @SHELL@
 SQLITE_CFLAGS = @SQLITE_CFLAGS@
 SQLITE_LIBS = @SQLITE_LIBS@
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/tools/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/tools/Makefile.in
--- telepathy-gabble-0.15.4/lib/ext/wocky/tools/Makefile.in	2012-02-09 13:01:36.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/tools/Makefile.in	2012-04-02 15:49:23.000000000 +0000
@@ -151,6 +151,7 @@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
+SHARED_SUFFIX = @SHARED_SUFFIX@
 SHELL = @SHELL@
 SQLITE_CFLAGS = @SQLITE_CFLAGS@
 SQLITE_LIBS = @SQLITE_LIBS@
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/wocky/Makefile.am telepathy-gabble-0.16.0/lib/ext/wocky/wocky/Makefile.am
--- telepathy-gabble-0.15.4/lib/ext/wocky/wocky/Makefile.am	2012-02-21 13:30:03.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/wocky/Makefile.am	2012-03-09 18:32:28.000000000 +0000
@@ -1,6 +1,15 @@
 include $(top_srcdir)/tools/flymake.mk
 
+if ENABLE_SHARED_SUFFIX
+lib_LTLIBRARIES = libwocky.la
+
+libwocky_la_LDFLAGS = \
+  -no-undefined \
+  -release $(SHARED_SUFFIX) \
+  $(NULL)
+else
 noinst_LTLIBRARIES = libwocky.la
+endif
 
 EXTRA_DIST =
 
@@ -217,7 +226,14 @@
             -DWOCKY_COMPILATION
 
 
-AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ @LIBXML2_LIBS@ @SQLITE_LIBS@ @TLS_LIBS@ @LIBIPHB_LIBS@
+libwocky_la_LIBADD = \
+  $(GCOV_LIBS) \
+  @GLIB_LIBS@ \
+  @LIBXML2_LIBS@ \
+  @SQLITE_LIBS@ \
+  @TLS_LIBS@ \
+  @LIBIPHB_LIBS@ \
+  $(NULL)
 
 # rules for making the glib enum objects
 # The shell variable $long is something like WOCKY_XMPP_ERROR for
@@ -249,5 +265,5 @@
 	 -:SOURCES $(handwritten_sources) $(built_sources) \
 	 -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) \
 	 -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
-	 -:LDFLAGS $(AM_LDFLAGS) \
+	 -:LDFLAGS $(AM_LDFLAGS) $(libwocky_la_LIBADD) \
 	> $@
diff -Nru telepathy-gabble-0.15.4/lib/ext/wocky/wocky/Makefile.in telepathy-gabble-0.16.0/lib/ext/wocky/wocky/Makefile.in
--- telepathy-gabble-0.15.4/lib/ext/wocky/wocky/Makefile.in	2012-02-21 19:24:07.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/ext/wocky/wocky/Makefile.in	2012-04-02 15:49:23.000000000 +0000
@@ -61,8 +61,37 @@
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = wocky-uninstalled.pc
 CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libwocky_la_LIBADD =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libwocky_ladir)"
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libwocky_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
 am__libwocky_la_SOURCES_DIST = wocky.c wocky-auth-handler.c \
 	wocky-auth-registry.c wocky-bare-contact.c wocky-c2s-porter.c \
 	wocky-caps-cache.c wocky-ll-connection-factory.c \
@@ -157,6 +186,11 @@
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
+libwocky_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(libwocky_la_LDFLAGS) $(LDFLAGS) -o $@
+@ENABLE_SHARED_SUFFIX_FALSE@am_libwocky_la_rpath =
+@ENABLE_SHARED_SUFFIX_TRUE@am_libwocky_la_rpath = -rpath $(libdir)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
@@ -212,34 +246,6 @@
 	wocky-pubsub-service-enumtypes.h wocky-signals-marshal.h \
 	wocky-tls-enumtypes.h wocky-xmpp-error-enumtypes.h \
 	wocky-xmpp-reader-enumtypes.h
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
-am__installdirs = "$(DESTDIR)$(libwocky_ladir)"
 HEADERS = $(libwocky_la_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -336,6 +342,7 @@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
+SHARED_SUFFIX = @SHARED_SUFFIX@
 SHELL = @SHELL@
 SQLITE_CFLAGS = @SQLITE_CFLAGS@
 SQLITE_LIBS = @SQLITE_LIBS@
@@ -397,7 +404,13 @@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-noinst_LTLIBRARIES = libwocky.la
+@ENABLE_SHARED_SUFFIX_TRUE@lib_LTLIBRARIES = libwocky.la
+@ENABLE_SHARED_SUFFIX_TRUE@libwocky_la_LDFLAGS = \
+@ENABLE_SHARED_SUFFIX_TRUE@  -no-undefined \
+@ENABLE_SHARED_SUFFIX_TRUE@  -release $(SHARED_SUFFIX) \
+@ENABLE_SHARED_SUFFIX_TRUE@  $(NULL)
+
+@ENABLE_SHARED_SUFFIX_FALSE@noinst_LTLIBRARIES = libwocky.la
 EXTRA_DIST = $(am__append_2) $(am__append_4) $(am__append_6)
 built_headers = \
   wocky-auth-registry-enumtypes.h \
@@ -536,7 +549,15 @@
             -DG_LOG_DOMAIN=\"wocky\" \
             -DWOCKY_COMPILATION
 
-AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ @LIBXML2_LIBS@ @SQLITE_LIBS@ @TLS_LIBS@ @LIBIPHB_LIBS@
+libwocky_la_LIBADD = \
+  $(GCOV_LIBS) \
+  @GLIB_LIBS@ \
+  @LIBXML2_LIBS@ \
+  @SQLITE_LIBS@ \
+  @TLS_LIBS@ \
+  @LIBIPHB_LIBS@ \
+  $(NULL)
+
 all: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -575,6 +596,37 @@
 $(am__aclocal_m4_deps):
 wocky-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/wocky-uninstalled.pc.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
 
 clean-noinstLTLIBRARIES:
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@@ -585,7 +637,7 @@
 	  rm -f "$${dir}/so_locations"; \
 	done
 libwocky.la: $(libwocky_la_OBJECTS) $(libwocky_la_DEPENDENCIES) $(EXTRA_libwocky_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(LINK)  $(libwocky_la_OBJECTS) $(libwocky_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(libwocky_la_LINK) $(am_libwocky_la_rpath) $(libwocky_la_OBJECTS) $(libwocky_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -796,7 +848,7 @@
 	$(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libwocky_ladir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libwocky_ladir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: $(BUILT_SOURCES)
@@ -835,8 +887,8 @@
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 clean: clean-am
 
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
-	mostlyclean-am
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	clean-noinstLTLIBRARIES mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
@@ -862,7 +914,7 @@
 
 install-dvi-am:
 
-install-exec-am:
+install-exec-am: install-libLTLIBRARIES
 
 install-html: install-html-am
 
@@ -902,24 +954,25 @@
 
 ps-am:
 
-uninstall-am: uninstall-libwocky_laHEADERS
+uninstall-am: uninstall-libLTLIBRARIES uninstall-libwocky_laHEADERS
 
 .MAKE: all check check-am install install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
-	clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \
-	dist-hook distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-libwocky_laHEADERS install-man \
+	clean-generic clean-libLTLIBRARIES clean-libtool \
+	clean-noinstLTLIBRARIES ctags dist-hook distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-libwocky_laHEADERS install-man \
 	install-pdf install-pdf-am install-ps install-ps-am \
 	install-strip installcheck installcheck-am installdirs \
 	maintainer-clean maintainer-clean-generic mostlyclean \
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
 	pdf pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-libwocky_laHEADERS
+	uninstall-libLTLIBRARIES uninstall-libwocky_laHEADERS
 
 check-syntax:
 	$(CC) $(AM_CPPFLAGS) $(AM_CFLAGS) -fsyntax-only $(CHK_SOURCES)
@@ -996,7 +1049,7 @@
 	 -:SOURCES $(handwritten_sources) $(built_sources) \
 	 -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) \
 	 -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
-	 -:LDFLAGS $(AM_LDFLAGS) \
+	 -:LDFLAGS $(AM_LDFLAGS) $(libwocky_la_LIBADD) \
 	> $@
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff -Nru telepathy-gabble-0.15.4/lib/gibber/Makefile.in telepathy-gabble-0.16.0/lib/gibber/Makefile.in
--- telepathy-gabble-0.15.4/lib/gibber/Makefile.in	2012-02-21 19:23:46.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/gibber/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -232,6 +232,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
diff -Nru telepathy-gabble-0.15.4/lib/Makefile.in telepathy-gabble-0.16.0/lib/Makefile.in
--- telepathy-gabble-0.15.4/lib/Makefile.in	2012-02-21 19:23:45.000000000 +0000
+++ telepathy-gabble-0.16.0/lib/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -233,6 +233,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
diff -Nru telepathy-gabble-0.15.4/m4/Makefile.in telepathy-gabble-0.16.0/m4/Makefile.in
--- telepathy-gabble-0.15.4/m4/Makefile.in	2012-02-21 19:23:46.000000000 +0000
+++ telepathy-gabble-0.16.0/m4/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -193,6 +193,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
diff -Nru telepathy-gabble-0.15.4/Makefile.in telepathy-gabble-0.16.0/Makefile.in
--- telepathy-gabble-0.15.4/Makefile.in	2012-02-21 19:45:52.000000000 +0000
+++ telepathy-gabble-0.16.0/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -253,6 +253,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
diff -Nru telepathy-gabble-0.15.4/missing telepathy-gabble-0.16.0/missing
--- telepathy-gabble-0.15.4/missing	2012-01-31 11:06:08.000000000 +0000
+++ telepathy-gabble-0.16.0/missing	2012-03-07 21:40:06.000000000 +0000
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-01-06.13; # UTC
 
 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard , 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -84,7 +84,6 @@
   help2man     touch the output file
   lex          create \`lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
@@ -122,15 +121,6 @@
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
@@ -226,7 +216,7 @@
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -256,7 +246,7 @@
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
 	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -318,41 +308,6 @@
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
 WARNING: \`$1' is needed, and is $msg.
diff -Nru telepathy-gabble-0.15.4/NEWS telepathy-gabble-0.16.0/NEWS
--- telepathy-gabble-0.15.4/NEWS	2012-02-21 19:32:31.000000000 +0000
+++ telepathy-gabble-0.16.0/NEWS	2012-04-02 21:28:17.000000000 +0000
@@ -1,3 +1,57 @@
+telepathy-gabble 0.16.0 (2012-04-02)
+====================================
+
+This is the start of a new stable branch.
+
+Changes since 0.15.5:
+
+• telepathy-glib 0.18.0 is now required.
+
+• Install plugins in their own special (versioned) gabble directory so
+  we're not installing unversioned ABI-unstable libraries. (Simon)
+
+• The DownloadAtConnection and Download ContactList members have been
+  implemented. (Alban)
+
+• Handle errors in IBB bytestreams. (fd.o#47999, Will)
+
+Summary of particularly noteworthy changes since 0.14.x:
+
+• telepathy-glib 0.18.0 is now required.
+
+• Gabble can now be built on Android, using 'androgenizer'.
+
+• Add support for the final version of Call1 and remove the
+  telepathy-yell submodule.
+
+• Many other miscellanous fixes and small interface implementations.
+
+telepathy-gabble 0.15.5 (2012-03-22)
+====================================
+
+Requirements:
+
+• telepathy-glib 0.17.7 is now required.
+
+Enhancements:
+
+• fd.o#46513: Refactor Jingle code to remove Telepathy in preparation
+  of moving it to Wocky. (Will)
+
+• fd.o#45602: Subclass TpBaseChannel in more channel
+  implemenations. (Jonny)
+
+• fd.o#47502: Add a --disable-voip configure flag to disable building
+  gabble with VoIP support. (Marco)
+
+Fixes:
+
+• Correctly convert between Telepathy and Jingle candidate
+  types. (Olivier)
+
+• Start sending automatically on accepting bidirectional
+  calls. (Olivier)
+
 telepathy-gabble 0.15.4 (2012-02-21)
 ====================================
 
diff -Nru telepathy-gabble-0.15.4/plugins/Makefile.am telepathy-gabble-0.16.0/plugins/Makefile.am
--- telepathy-gabble-0.15.4/plugins/Makefile.am	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/plugins/Makefile.am	2012-03-26 18:00:06.000000000 +0000
@@ -1,5 +1,3 @@
-plugindir = $(libdir)/telepathy/gabble-0
-
 installable_plugins = \
 	libconsole.la \
 	libgateways.la
@@ -25,11 +23,11 @@
 
 # because libtest.la is not installed, libtool will want to compile it as static
 # despite -shared (a convenience library), unless we also use -rpath
-libtest_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(plugindir)
+libtest_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(pluginexecdir)
 endif
 
 if ENABLE_PLUGINS
-plugin_LTLIBRARIES = $(installable_plugins)
+pluginexec_LTLIBRARIES = $(installable_plugins)
 
 dist_bin_SCRIPTS = \
 	telepathy-gabble-xmpp-console
@@ -44,7 +42,6 @@
 
 AM_LDFLAGS = -avoid-version -shared -no-undefined
 
-if WINDOWS
 ALL_PLUGIN_LIBS = \
 	@WOCKY_LIBS@ \
 	@GLIB_LIBS@ \
@@ -55,7 +52,6 @@
 libtest_la_LIBADD = $(ALL_PLUGIN_LIBS)
 libgateways_la_LIBADD = $(ALL_PLUGIN_LIBS)
 libconsole_la_LIBADD = $(ALL_PLUGIN_LIBS)
-endif
 
 libtest_la_SOURCES = \
     test.c \
diff -Nru telepathy-gabble-0.15.4/plugins/Makefile.in telepathy-gabble-0.16.0/plugins/Makefile.in
--- telepathy-gabble-0.15.4/plugins/Makefile.in	2012-02-21 19:23:46.000000000 +0000
+++ telepathy-gabble-0.16.0/plugins/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -83,12 +83,13 @@
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 am__installdirs = "$(DESTDIR)$(libtestplugindir)" \
-	"$(DESTDIR)$(plugindir)" "$(DESTDIR)$(bindir)"
+	"$(DESTDIR)$(pluginexecdir)" "$(DESTDIR)$(bindir)"
 LTLIBRARIES = $(libtestplugin_LTLIBRARIES) $(noinst_LTLIBRARIES) \
-	$(plugin_LTLIBRARIES)
-@WINDOWS_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/extensions/libgabble-extensions.la \
-@WINDOWS_TRUE@	$(top_builddir)/src/libgabble-plugins.la
-@WINDOWS_TRUE@libconsole_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+	$(pluginexec_LTLIBRARIES)
+am__DEPENDENCIES_1 =  \
+	$(top_builddir)/extensions/libgabble-extensions.la \
+	$(top_builddir)/src/libgabble-plugins.la
+libconsole_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
 am_libconsole_la_OBJECTS = console.lo
 libconsole_la_OBJECTS = $(am_libconsole_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
@@ -96,14 +97,14 @@
 am__v_lt_0 = --silent
 @ENABLE_INSTALLED_TESTS_FALSE@@ENABLE_PLUGINS_FALSE@am_libconsole_la_rpath =
 @ENABLE_INSTALLED_TESTS_TRUE@@ENABLE_PLUGINS_FALSE@am_libconsole_la_rpath =
-@ENABLE_PLUGINS_TRUE@am_libconsole_la_rpath = -rpath $(plugindir)
-@WINDOWS_TRUE@libgateways_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+@ENABLE_PLUGINS_TRUE@am_libconsole_la_rpath = -rpath $(pluginexecdir)
+libgateways_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
 am_libgateways_la_OBJECTS = gateways.lo
 libgateways_la_OBJECTS = $(am_libgateways_la_OBJECTS)
 @ENABLE_INSTALLED_TESTS_FALSE@@ENABLE_PLUGINS_FALSE@am_libgateways_la_rpath =
 @ENABLE_INSTALLED_TESTS_TRUE@@ENABLE_PLUGINS_FALSE@am_libgateways_la_rpath =
-@ENABLE_PLUGINS_TRUE@am_libgateways_la_rpath = -rpath $(plugindir)
-@WINDOWS_TRUE@libtest_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+@ENABLE_PLUGINS_TRUE@am_libgateways_la_rpath = -rpath $(pluginexecdir)
+libtest_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
 am_libtest_la_OBJECTS = test.lo
 libtest_la_OBJECTS = $(am_libtest_la_OBJECTS)
 libtest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -282,6 +283,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -295,7 +298,6 @@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-plugindir = $(libdir)/telepathy/gabble-0
 installable_plugins = \
 	libconsole.la \
 	libgateways.la
@@ -318,9 +320,9 @@
 
 # because libtest.la is not installed, libtool will want to compile it as static
 # despite -shared (a convenience library), unless we also use -rpath
-@ENABLE_INSTALLED_TESTS_FALSE@libtest_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(plugindir)
+@ENABLE_INSTALLED_TESTS_FALSE@libtest_la_LDFLAGS = $(AM_LDFLAGS) -rpath $(pluginexecdir)
 @ENABLE_INSTALLED_TESTS_TRUE@libtest_la_LDFLAGS = $(AM_LDFLAGS)
-@ENABLE_PLUGINS_TRUE@plugin_LTLIBRARIES = $(installable_plugins)
+@ENABLE_PLUGINS_TRUE@pluginexec_LTLIBRARIES = $(installable_plugins)
 @ENABLE_PLUGINS_TRUE@dist_bin_SCRIPTS = \
 @ENABLE_PLUGINS_TRUE@	telepathy-gabble-xmpp-console
 
@@ -328,16 +330,16 @@
 @ENABLE_PLUGINS_FALSE@	telepathy-gabble-xmpp-console
 
 AM_LDFLAGS = -avoid-version -shared -no-undefined
-@WINDOWS_TRUE@ALL_PLUGIN_LIBS = \
-@WINDOWS_TRUE@	@WOCKY_LIBS@ \
-@WINDOWS_TRUE@	@GLIB_LIBS@ \
-@WINDOWS_TRUE@	@TP_GLIB_LIBS@ \
-@WINDOWS_TRUE@	$(top_builddir)/extensions/libgabble-extensions.la \
-@WINDOWS_TRUE@	$(top_builddir)/src/libgabble-plugins.la
-
-@WINDOWS_TRUE@libtest_la_LIBADD = $(ALL_PLUGIN_LIBS)
-@WINDOWS_TRUE@libgateways_la_LIBADD = $(ALL_PLUGIN_LIBS)
-@WINDOWS_TRUE@libconsole_la_LIBADD = $(ALL_PLUGIN_LIBS)
+ALL_PLUGIN_LIBS = \
+	@WOCKY_LIBS@ \
+	@GLIB_LIBS@ \
+	@TP_GLIB_LIBS@ \
+	$(top_builddir)/extensions/libgabble-extensions.la \
+	$(top_builddir)/src/libgabble-plugins.la
+
+libtest_la_LIBADD = $(ALL_PLUGIN_LIBS)
+libgateways_la_LIBADD = $(ALL_PLUGIN_LIBS)
+libconsole_la_LIBADD = $(ALL_PLUGIN_LIBS)
 libtest_la_SOURCES = \
     test.c \
     test.h
@@ -430,32 +432,32 @@
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
+install-pluginexecLTLIBRARIES: $(pluginexec_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
-	@list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+	test -z "$(pluginexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginexecdir)"
+	@list='$(pluginexec_LTLIBRARIES)'; test -n "$(pluginexecdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
 	    list2="$$list2 $$p"; \
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pluginexecdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pluginexecdir)"; \
 	}
 
-uninstall-pluginLTLIBRARIES:
+uninstall-pluginexecLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+	@list='$(pluginexec_LTLIBRARIES)'; test -n "$(pluginexecdir)" || list=; \
 	for p in $$list; do \
 	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginexecdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginexecdir)/$$f"; \
 	done
 
-clean-pluginLTLIBRARIES:
-	-test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES)
-	@list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+clean-pluginexecLTLIBRARIES:
+	-test -z "$(pluginexec_LTLIBRARIES)" || rm -f $(pluginexec_LTLIBRARIES)
+	@list='$(pluginexec_LTLIBRARIES)'; for p in $$list; do \
 	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
 	  test "$$dir" != "$$p" || dir=.; \
 	  echo "rm -f \"$${dir}/so_locations\""; \
@@ -623,7 +625,7 @@
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(SCRIPTS)
 installdirs:
-	for dir in "$(DESTDIR)$(libtestplugindir)" "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(bindir)"; do \
+	for dir in "$(DESTDIR)$(libtestplugindir)" "$(DESTDIR)$(pluginexecdir)" "$(DESTDIR)$(bindir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -659,7 +661,8 @@
 clean: clean-am
 
 clean-am: clean-generic clean-libtestpluginLTLIBRARIES clean-libtool \
-	clean-noinstLTLIBRARIES clean-pluginLTLIBRARIES mostlyclean-am
+	clean-noinstLTLIBRARIES clean-pluginexecLTLIBRARIES \
+	mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
@@ -679,14 +682,13 @@
 
 info-am:
 
-install-data-am: install-libtestpluginLTLIBRARIES \
-	install-pluginLTLIBRARIES
+install-data-am: install-libtestpluginLTLIBRARIES
 
 install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-dist_binSCRIPTS
+install-exec-am: install-dist_binSCRIPTS install-pluginexecLTLIBRARIES
 
 install-html: install-html-am
 
@@ -727,13 +729,14 @@
 ps-am:
 
 uninstall-am: uninstall-dist_binSCRIPTS \
-	uninstall-libtestpluginLTLIBRARIES uninstall-pluginLTLIBRARIES
+	uninstall-libtestpluginLTLIBRARIES \
+	uninstall-pluginexecLTLIBRARIES
 
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
 	clean-libtestpluginLTLIBRARIES clean-libtool \
-	clean-noinstLTLIBRARIES clean-pluginLTLIBRARIES ctags \
+	clean-noinstLTLIBRARIES clean-pluginexecLTLIBRARIES ctags \
 	distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
@@ -741,13 +744,14 @@
 	install-dvi-am install-exec install-exec-am install-html \
 	install-html-am install-info install-info-am \
 	install-libtestpluginLTLIBRARIES install-man install-pdf \
-	install-pdf-am install-pluginLTLIBRARIES install-ps \
+	install-pdf-am install-pluginexecLTLIBRARIES install-ps \
 	install-ps-am install-strip installcheck installcheck-am \
 	installdirs maintainer-clean maintainer-clean-generic \
 	mostlyclean mostlyclean-compile mostlyclean-generic \
 	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
 	uninstall-am uninstall-dist_binSCRIPTS \
-	uninstall-libtestpluginLTLIBRARIES uninstall-pluginLTLIBRARIES
+	uninstall-libtestpluginLTLIBRARIES \
+	uninstall-pluginexecLTLIBRARIES
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff -Nru telepathy-gabble-0.15.4/src/base-call-channel.c telepathy-gabble-0.16.0/src/base-call-channel.c
--- telepathy-gabble-0.15.4/src/base-call-channel.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/base-call-channel.c	2012-03-07 20:26:07.000000000 +0000
@@ -41,6 +41,7 @@
 #include "base-call-channel.h"
 #include "connection.h"
 #include "jingle-session.h"
+#include "jingle-tp-util.h"
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 #include "debug.h"
diff -Nru telepathy-gabble-0.15.4/src/bytestream-ibb.c telepathy-gabble-0.16.0/src/bytestream-ibb.c
--- telepathy-gabble-0.15.4/src/bytestream-ibb.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/bytestream-ibb.c	2012-04-02 20:49:25.000000000 +0000
@@ -32,6 +32,7 @@
 #include "bytestream-factory.h"
 #include "bytestream-iface.h"
 #include "connection.h"
+#include "conn-util.h"
 #include "debug.h"
 #include "disco.h"
 #include "namespaces.h"
@@ -401,30 +402,47 @@
   g_object_unref (msg);
 }
 
-static gboolean
-send_data (GabbleBytestreamIBB *self, const gchar *str, guint len,
-    gboolean *result);
+static guint
+send_data (GabbleBytestreamIBB *self, const gchar *str, guint len);
 
 static void
-iq_acked_cb (GabbleConnection *conn,
-             WockyStanza *sent_msg,
-             WockyStanza *reply_msg,
-             GObject *obj,
-             gpointer user_data)
-{
-  GabbleBytestreamIBB *self = GABBLE_BYTESTREAM_IBB (obj);
-  GabbleBytestreamIBBPrivate *priv = GABBLE_BYTESTREAM_IBB_GET_PRIVATE (self);
+iq_reply_cb (
+    GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  TpWeakRef *weak_ref = user_data;
+  GabbleBytestreamIBB *self = tp_weak_ref_dup_object (weak_ref);
+  /* We don't hold a ref to the outgoing stanza; we just use its address as a
+   * key */
+  gpointer sent_msg = tp_weak_ref_get_user_data (weak_ref);
+  GabbleBytestreamIBBPrivate *priv;
+  GError *error = NULL;
 
+  tp_weak_ref_destroy (weak_ref);
+
+  /* If the channel is already dead, never mind! */
+  if (self == NULL)
+    return;
+
+  priv = GABBLE_BYTESTREAM_IBB_GET_PRIVATE (self);
   g_hash_table_remove (priv->sent_stanzas_not_acked, sent_msg);
 
-  if (priv->write_buffer != NULL)
+  if (!conn_util_send_iq_finish (GABBLE_CONNECTION (source), result, NULL, &error))
+    {
+      DEBUG ("error sending IBB stanza: %s #%u '%s'. Closing the bytestream",
+          g_quark_to_string (error->domain), error->code, error->message);
+      g_clear_error (&error);
+      /* FIXME: we should be able to feed this up to the application somehow. */
+      gabble_bytestream_iface_close (GABBLE_BYTESTREAM_IFACE (self), NULL);
+    }
+  else if (priv->write_buffer != NULL)
     {
       guint sent;
 
       DEBUG ("A stanza has been acked. Try to flush the buffer");
 
-      sent = send_data (self, priv->write_buffer->str, priv->write_buffer->len,
-          NULL);
+      sent = send_data (self, priv->write_buffer->str, priv->write_buffer->len);
       if (sent == priv->write_buffer->len)
         {
           DEBUG ("buffer has been flushed; unblock write the bytestream");
@@ -450,13 +468,14 @@
               priv->write_buffer->len);
         }
     }
+
+  g_object_unref (self);
 }
 
-static gboolean
+static guint
 send_data (GabbleBytestreamIBB *self,
            const gchar *str,
-           guint len,
-           gboolean *result)
+           guint len)
 {
   GabbleBytestreamIBBPrivate *priv = GABBLE_BYTESTREAM_IBB_GET_PRIVATE (self);
   guint sent, stanza_count;
@@ -468,8 +487,6 @@
       WockyStanza *iq;
       guint send_now, remaining;
       gchar *seq, *encoded;
-      GError *error = NULL;
-      gboolean ret;
       guint nb_stanzas_waiting;
 
       remaining = (len - sent);
@@ -506,27 +523,13 @@
             '@', "seq", seq,
           ')', NULL);
 
-      ret = _gabble_connection_send_with_reply (priv->conn, iq, iq_acked_cb,
-          G_OBJECT (self), NULL, &error);
+      conn_util_send_iq_async (priv->conn, iq, NULL,
+          iq_reply_cb, tp_weak_ref_new (self, iq, NULL));
 
       g_free (encoded);
       g_free (seq);
       g_object_unref (iq);
 
-      if (!ret)
-        {
-          DEBUG ("error sending IBB stanza: %s. Close the bytestream",
-              error->message);
-          g_error_free (error);
-
-          gabble_bytestream_iface_close (GABBLE_BYTESTREAM_IFACE (self), NULL);
-
-          if (result != NULL)
-            *result = FALSE;
-
-          return sent;
-        }
-
       g_hash_table_insert (priv->sent_stanzas_not_acked, iq,
           GUINT_TO_POINTER (TRUE));
 
@@ -539,8 +542,6 @@
 
   DEBUG ("sent %d bytes (%d stanzas needed)", sent, stanza_count);
 
-  if (result != NULL)
-    *result = TRUE;
   return sent;
 }
 
@@ -556,7 +557,6 @@
 {
   GabbleBytestreamIBB *self = GABBLE_BYTESTREAM_IBB (iface);
   GabbleBytestreamIBBPrivate *priv = GABBLE_BYTESTREAM_IBB_GET_PRIVATE (self);
-  gboolean result;
   guint sent;
 
   if (priv->state != GABBLE_BYTESTREAM_STATE_OPEN)
@@ -579,7 +579,7 @@
       return TRUE;
     }
 
-  sent = send_data (self, str, len, &result);
+  sent = send_data (self, str, len);
   if (sent < len)
     {
       guint remaining;
@@ -602,7 +602,7 @@
       change_write_blocked_state (self, TRUE);
     }
 
-  return result;
+  return TRUE;
 }
 
 void
diff -Nru telepathy-gabble-0.15.4/src/call-channel.c telepathy-gabble-0.16.0/src/call-channel.c
--- telepathy-gabble-0.15.4/src/call-channel.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/call-channel.c	2012-03-07 20:26:07.000000000 +0000
@@ -39,6 +39,7 @@
 
 #include "connection.h"
 #include "jingle-session.h"
+#include "jingle-tp-util.h"
 #include "presence-cache.h"
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
diff -Nru telepathy-gabble-0.15.4/src/call-content.c telepathy-gabble-0.16.0/src/call-content.c
--- telepathy-gabble-0.15.4/src/call-content.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/call-content.c	2012-03-07 20:26:07.000000000 +0000
@@ -34,6 +34,7 @@
 #include "jingle-content.h"
 #include "jingle-session.h"
 #include "jingle-media-rtp.h"
+#include "jingle-tp-util.h"
 #include "connection.h"
 #include "util.h"
 
diff -Nru telepathy-gabble-0.15.4/src/call-member.c telepathy-gabble-0.16.0/src/call-member.c
--- telepathy-gabble-0.15.4/src/call-member.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/call-member.c	2012-03-07 20:26:07.000000000 +0000
@@ -505,16 +505,18 @@
 {
   GabbleCallMemberPrivate *priv = self->priv;
   GabbleConnection *conn = gabble_call_member_get_connection (self);
+  GabbleJingleFactory *jf;
   GabbleJingleSession *session;
   gchar *jid;
 
   jid = gabble_peer_to_jid (conn, priv->target, NULL);
 
-  session = gabble_jingle_factory_create_session (conn->jingle_factory,
-      priv->target, jid, FALSE);
-  DEBUG ("Created a jingle session: %p", session);
+  jf = gabble_jingle_mint_get_factory (conn->jingle_mint);
+  g_return_val_if_fail (jf != NULL, FALSE);
 
-  g_object_set (session, "dialect", JINGLE_DIALECT_V032, NULL);
+  session = gabble_jingle_factory_create_session (jf, jid, JINGLE_DIALECT_V032,
+      FALSE);
+  DEBUG ("Created a jingle session: %p", session);
 
   priv->transport_ns = g_strdup (NS_JINGLE_TRANSPORT_ICEUDP);
 
@@ -538,6 +540,7 @@
   JingleDialect dialect;
   gchar *jid;
   const gchar *transport;
+  GabbleJingleFactory *jf;
   GabbleJingleSession *session;
 
   /* FIXME might need to wait on capabilities, also don't need transport
@@ -553,12 +556,14 @@
 
   jid = gabble_peer_to_jid (gabble_call_member_get_connection (self), target, resource);
 
-  session = gabble_jingle_factory_create_session (
-        gabble_call_member_get_connection (self)->jingle_factory, target, jid, FALSE);
+  jf = gabble_jingle_mint_get_factory (
+        gabble_call_member_get_connection (self)->jingle_mint);
+  g_return_val_if_fail (jf != NULL, FALSE);
+
+  session = gabble_jingle_factory_create_session (jf, jid, dialect, FALSE);
   g_free (jid);
 
   gabble_call_member_set_session (self, session);
-  g_object_set (session, "dialect", dialect, NULL);
 
   priv->transport_ns = g_strdup (transport);
 
diff -Nru telepathy-gabble-0.15.4/src/call-muc-channel.c telepathy-gabble-0.16.0/src/call-muc-channel.c
--- telepathy-gabble-0.15.4/src/call-muc-channel.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/call-muc-channel.c	2012-03-07 20:26:07.000000000 +0000
@@ -33,6 +33,7 @@
 #include "call-muc-channel.h"
 #include "util.h"
 #include "namespaces.h"
+#include "jingle-tp-util.h"
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
@@ -1111,11 +1112,15 @@
     GabbleJingleSession *session)
 {
   GabbleCallMember *member;
-  DEBUG ("New incoming session from %s",
-    gabble_jingle_session_get_peer_jid (session));
+  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+      tp_base_channel_get_connection (TP_BASE_CHANNEL (self)),
+      TP_HANDLE_TYPE_CONTACT);
+  const gchar *jid = gabble_jingle_session_get_peer_jid (session);
+  TpHandle peer = tp_handle_ensure (contact_repo, jid, NULL, NULL);
 
-  member = gabble_base_call_channel_get_member_from_handle
-    (GABBLE_BASE_CALL_CHANNEL (self), session->peer);
+  DEBUG ("New incoming session from %s", jid);
+  member = gabble_base_call_channel_get_member_from_handle (
+      GABBLE_BASE_CALL_CHANNEL (self), peer);
 
   if (member == NULL || gabble_call_member_get_session (member) != NULL)
     {
diff -Nru telepathy-gabble-0.15.4/src/call-stream.c telepathy-gabble-0.16.0/src/call-stream.c
--- telepathy-gabble-0.15.4/src/call-stream.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/call-stream.c	2012-03-26 18:00:06.000000000 +0000
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include "config.h"
 
 #include 
 #include 
@@ -32,6 +33,7 @@
 #include "connection.h"
 #include "jingle-session.h"
 #include "jingle-content.h"
+#include "jingle-tp-util.h"
 #include "util.h"
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
@@ -82,8 +84,6 @@
 {
   gboolean dispose_has_run;
 
-  gboolean want_send;
-
   GabbleJingleContent *content;
 };
 
@@ -94,8 +94,6 @@
       GABBLE_TYPE_CALL_STREAM, GabbleCallStreamPrivate);
 
   self->priv = priv;
-
-  self->priv->want_send = TRUE;
 }
 
 static void gabble_call_stream_dispose (GObject *object);
@@ -105,19 +103,17 @@
 get_stun_servers (GabbleCallStream *self)
 {
   GPtrArray *arr;
-  GabbleConnection *connection;
+  GabbleJingleFactory *jf;
   gchar *stun_server;
   guint stun_port;
 
   arr = g_ptr_array_new_with_free_func ((GDestroyNotify) g_value_array_free);
-
-  g_object_get (self->priv->content,
-      "connection", &connection,
-      NULL);
+  jf = gabble_jingle_session_get_factory (self->priv->content->session);
 
   /* maybe one day we'll support multiple STUN servers */
-  if (gabble_jingle_factory_get_stun_server (
-          connection->jingle_factory, &stun_server, &stun_port))
+  if (gabble_jingle_info_get_stun_server (
+          gabble_jingle_factory_get_jingle_info (jf),
+          &stun_server, &stun_port))
     {
       GValueArray *va = tp_value_array_build (2,
           G_TYPE_STRING, stun_server,
@@ -128,8 +124,6 @@
       g_ptr_array_add (arr, va);
     }
 
-  g_object_unref (connection);
-
   return arr;
 }
 
@@ -190,7 +184,10 @@
 
   if (stream != NULL)
     {
-      tp_base_media_call_stream_set_relay_info (stream, relays);
+      GPtrArray *tp_relays = gabble_build_tp_relay_info (relays);
+
+      tp_base_media_call_stream_set_relay_info (stream, tp_relays);
+      g_ptr_array_unref (tp_relays);
       g_object_unref (stream);
     }
 
@@ -218,7 +215,8 @@
 }
 
 static void
-jingle_factory_stun_server_changed_cb (GabbleJingleFactory *factory,
+jingle_info_stun_server_changed_cb (
+    GabbleJingleInfo *jingle_info,
     const gchar *stun_server,
     guint stun_port,
     GabbleCallStream *self)
@@ -325,12 +323,21 @@
   gchar *path;
   JingleTransportType transport;
   GPtrArray *stun_servers;
+  gboolean locally_created;
 
   if (G_OBJECT_CLASS (gabble_call_stream_parent_class)->constructed != NULL)
     G_OBJECT_CLASS (gabble_call_stream_parent_class)->constructed (obj);
 
   conn = GABBLE_CONNECTION (tp_base_call_stream_get_connection (base));
 
+  g_object_get (priv->content, "locally-created", &locally_created, NULL);
+
+  if (locally_created &&
+      gabble_jingle_content_sending (priv->content))
+    tp_base_media_call_stream_set_local_sending (
+        TP_BASE_MEDIA_CALL_STREAM (self), TRUE);
+
+
   /* Currently we'll only have one endpoint we know right away */
   path = g_strdup_printf ("%s/Endpoint",
       tp_base_call_stream_get_object_path (base));
@@ -348,7 +355,8 @@
       /* See if our server is Google, and if it is, ask them for a relay.
        * We ask for enough relays for 2 components (RTP and RTCP) since we
        * don't yet know whether there will be RTCP. */
-      gabble_jingle_factory_create_google_relay_session (conn->jingle_factory,
+      gabble_jingle_info_create_google_relay_session (
+          gabble_jingle_mint_get_info (conn->jingle_mint),
           2, google_relay_session_cb, tp_weak_ref_new (self, NULL, NULL));
     }
   else
@@ -368,18 +376,25 @@
     G_CALLBACK (content_state_changed_cb), obj);
   gabble_signal_connect_weak (priv->content, "notify::senders",
     G_CALLBACK (content_remote_members_changed_cb), obj);
-  gabble_signal_connect_weak (conn->jingle_factory, "stun-server-changed",
-    G_CALLBACK (jingle_factory_stun_server_changed_cb), obj);
+  gabble_signal_connect_weak (
+      gabble_jingle_mint_get_info (conn->jingle_mint),
+      "stun-server-changed",
+      G_CALLBACK (jingle_info_stun_server_changed_cb), obj);
 }
 
 void
 gabble_call_stream_update_member_states (GabbleCallStream *self)
 {
   TpBaseCallStream *base = TP_BASE_CALL_STREAM (self);
+  TpBaseMediaCallStream *bmcs = TP_BASE_MEDIA_CALL_STREAM (self);
   GabbleCallStreamPrivate *priv = self->priv;
   JingleContentState state;
   TpSendingState local_state;
   TpSendingState remote_state;
+  TpBaseConnection *conn = tp_base_call_stream_get_connection (base);
+  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+      conn, TP_HANDLE_TYPE_CONTACT);
+  TpHandle peer;
 
   g_object_get (priv->content, "state", &state, NULL);
 
@@ -391,17 +406,17 @@
 
   if (gabble_jingle_content_sending (priv->content))
     {
-      if (self->priv->want_send)
+      if (tp_base_media_call_stream_get_local_sending (bmcs))
         local_state = TP_SENDING_STATE_SENDING;
       else
         local_state = TP_SENDING_STATE_PENDING_SEND;
     }
   else
     {
-      if (!self->priv->want_send)
-        local_state = TP_SENDING_STATE_NONE;
-      else
+      if (tp_base_media_call_stream_get_local_sending (bmcs))
         local_state = TP_SENDING_STATE_PENDING_STOP_SENDING;
+      else
+        local_state = TP_SENDING_STATE_NONE;
     }
 
   if (gabble_jingle_content_receiving (priv->content))
@@ -417,8 +432,12 @@
 
   tp_base_call_stream_update_local_sending_state (base, local_state,
       0, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "");
+  peer = tp_handle_ensure (contact_repo,
+      gabble_jingle_session_get_peer_jid (priv->content->session),
+      NULL,
+      NULL);
   tp_base_call_stream_update_remote_sending_state (base,
-        priv->content->session->peer, remote_state,
+        peer, remote_state,
         0, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "");
 }
 
@@ -495,7 +514,8 @@
       GValueArray *va;
       JingleCandidate *c;
       GHashTable *info;
-      guint fstype, type;
+      guint tptype;
+      JingleCandidateType type;
       /* borrowed strings, owned by other people. */
       const gchar *username;
       const gchar *password;
@@ -505,24 +525,20 @@
 
       info = g_value_get_boxed (va->values + 3);
 
-      fstype = tp_asv_get_uint32 (info, "Type", NULL);
-
-      switch (fstype)
+      tptype = tp_asv_get_uint32 (info, "type", NULL);
+      switch (tptype)
         {
-        case 0: /* FS_CANDIDATE_TYPE_HOST */
+        default:
+          /* Anything else is local */
+        case TP_CALL_STREAM_CANDIDATE_TYPE_HOST:
           type = JINGLE_CANDIDATE_TYPE_LOCAL;
           break;
-        case 1: /* FS_CANDIDATE_TYPE_SRFLX */
-        case 2: /* FS_CANDIDATE_TYPE_PRFLX */
+        case TP_CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE:
           type = JINGLE_CANDIDATE_TYPE_STUN;
           break;
-        case 3: /* FS_CANDIDATE_TYPE_RELAY */
+        case TP_CALL_STREAM_CANDIDATE_TYPE_RELAY:
           type = JINGLE_CANDIDATE_TYPE_RELAY;
           break;
-        case 4: /* FS_CANDIDATE_TYPE_MULTICAST */
-        default:
-          DEBUG ("Unhandled candidate type %d", fstype);
-          continue;
         }
 
       username = tp_asv_get_string (info, "username");
@@ -583,13 +599,11 @@
 {
   GabbleCallStream *self = GABBLE_CALL_STREAM (stream);
 
-  self->priv->want_send = sending;
-
-  gabble_jingle_content_set_sending (self->priv->content, sending);
-
   if (sending)
     tp_base_media_call_stream_set_local_sending (stream, TRUE);
 
+  gabble_jingle_content_set_sending (self->priv->content, sending);
+
   return TRUE;
 }
 
diff -Nru telepathy-gabble-0.15.4/src/call-stream.h telepathy-gabble-0.16.0/src/call-stream.h
--- telepathy-gabble-0.15.4/src/call-stream.h	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/call-stream.h	2012-03-07 20:26:07.000000000 +0000
@@ -24,7 +24,8 @@
 #include 
 
 #include 
-#include "types.h"
+
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/capabilities.c telepathy-gabble-0.16.0/src/capabilities.c
--- telepathy-gabble-0.15.4/src/capabilities.c	2012-01-18 12:45:07.000000000 +0000
+++ telepathy-gabble-0.16.0/src/capabilities.c	2012-03-26 18:00:06.000000000 +0000
@@ -49,9 +49,13 @@
 static const Feature self_advertised_features[] =
 {
   { FEATURE_FIXED, NS_GOOGLE_FEAT_SESSION },
+
+#ifdef ENABLE_VOIP
   { FEATURE_FIXED, NS_JINGLE_TRANSPORT_RAWUDP },
   { FEATURE_FIXED, NS_JINGLE015 },
   { FEATURE_FIXED, NS_JINGLE032 },
+#endif
+
   { FEATURE_FIXED, NS_CHAT_STATES },
   { FEATURE_FIXED, NS_NICK },
   { FEATURE_FIXED, NS_NICK "+notify" },
@@ -66,6 +70,7 @@
   { FEATURE_OPTIONAL, NS_TP_FT_METADATA },
 #endif
 
+#ifdef ENABLE_VOIP
   { FEATURE_OPTIONAL, NS_GOOGLE_TRANSPORT_P2P },
   { FEATURE_OPTIONAL, NS_JINGLE_TRANSPORT_ICEUDP },
 
@@ -77,6 +82,7 @@
   { FEATURE_OPTIONAL, NS_JINGLE_RTP },
   { FEATURE_OPTIONAL, NS_JINGLE_RTP_AUDIO },
   { FEATURE_OPTIONAL, NS_JINGLE_RTP_VIDEO },
+#endif
 
   { FEATURE_OLPC, NS_OLPC_BUDDY_PROPS "+notify" },
   { FEATURE_OLPC, NS_OLPC_ACTIVITIES "+notify" },
@@ -255,6 +261,7 @@
           gabble_capability_set_add (legacy_caps, feat->ns);
         }
 
+#ifdef ENABLE_VOIP
       share_v1_caps = gabble_capability_set_new ();
       gabble_capability_set_add (share_v1_caps, NS_GOOGLE_FEAT_SHARE);
 
@@ -289,6 +296,7 @@
       gabble_capability_set_add (any_transport_caps, NS_GOOGLE_TRANSPORT_P2P);
       gabble_capability_set_add (any_transport_caps, NS_JINGLE_TRANSPORT_ICEUDP);
       gabble_capability_set_add (any_transport_caps, NS_JINGLE_TRANSPORT_RAWUDP);
+#endif
 
       fixed_caps = gabble_capability_set_new ();
 
@@ -323,6 +331,7 @@
   if (--feature_handles_refcount == 0)
     {
       gabble_capability_set_free (legacy_caps);
+#ifdef ENABLE_VOIP
       gabble_capability_set_free (share_v1_caps);
       gabble_capability_set_free (voice_v1_caps);
       gabble_capability_set_free (video_v1_caps);
@@ -332,6 +341,7 @@
       gabble_capability_set_free (any_google_av_caps);
       gabble_capability_set_free (any_jingle_av_caps);
       gabble_capability_set_free (any_transport_caps);
+#endif
       gabble_capability_set_free (fixed_caps);
       gabble_capability_set_free (geoloc_caps);
       gabble_capability_set_free (olpc_caps);
diff -Nru telepathy-gabble-0.15.4/src/connection.c telepathy-gabble-0.16.0/src/connection.c
--- telepathy-gabble-0.15.4/src/connection.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/connection.c	2012-04-02 20:49:25.000000000 +0000
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include "config.h"
+
 #include "connection.h"
 #include "gabble.h"
 
@@ -60,11 +62,8 @@
 #include "conn-power-saving.h"
 #include "debug.h"
 #include "disco.h"
-#include "media-channel.h"
 #include "im-factory.h"
-#include "jingle-factory.h"
 #include "legacy-caps.h"
-#include "media-factory.h"
 #include "muc-factory.h"
 #include "namespaces.h"
 #include "presence-cache.h"
@@ -82,6 +81,12 @@
 #include "conn-util.h"
 #include "conn-addressing.h"
 
+#ifdef ENABLE_VOIP
+#include "media-channel.h"
+#include "jingle-factory.h"
+#include "media-factory.h"
+#endif
+
 static guint disco_reply_timeout = 5;
 
 #define DISCONNECT_TIMEOUT 5
@@ -178,6 +183,7 @@
     PROP_FALLBACK_SERVERS,
     PROP_EXTRA_CERTIFICATE_IDENTITIES,
     PROP_POWER_SAVING,
+    PROP_DOWNLOAD_AT_CONNECTION,
 
     LAST_PROPERTY
 };
@@ -368,13 +374,14 @@
   self->private_tubes_factory = gabble_private_tubes_factory_new (self);
   g_ptr_array_add (channel_managers, self->private_tubes_factory);
 
-  self->jingle_factory = g_object_new (GABBLE_TYPE_JINGLE_FACTORY,
-    "connection", self, NULL);
+#ifdef ENABLE_VOIP
+  self->jingle_mint = gabble_jingle_mint_new (self);
 
   g_ptr_array_add (channel_managers,
       g_object_new (GABBLE_TYPE_MEDIA_FACTORY,
         "connection", self,
         NULL));
+#endif
 
 #ifdef ENABLE_FILE_TRANSFER
   self->ft_manager = gabble_ft_manager_new (self);
@@ -492,8 +499,10 @@
    * presence, but could be removed by AdvertiseCapabilities(). Emulate
    * that here for now. */
   priv->bonus_caps = gabble_capability_set_new ();
+#ifdef ENABLE_VOIP
   gabble_capability_set_add (priv->bonus_caps, NS_GOOGLE_TRANSPORT_P2P);
   gabble_capability_set_add (priv->bonus_caps, NS_JINGLE_TRANSPORT_ICEUDP);
+#endif
 
   return (GObject *) self;
 }
@@ -671,6 +680,23 @@
       g_value_set_boolean (value, priv->power_saving);
       break;
 
+    case PROP_DOWNLOAD_AT_CONNECTION:
+      {
+        gboolean download_at_connection = TRUE;
+        if (self->roster != NULL)
+          {
+            g_object_get (self->roster,
+                "download-at-connection", &download_at_connection,
+                NULL);
+          }
+        else
+          {
+            g_warn_if_reached ();
+          }
+        g_value_set_boolean (value, download_at_connection);
+        break;
+      }
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -812,6 +838,16 @@
       priv->power_saving = g_value_get_boolean (value);
       break;
 
+    case PROP_DOWNLOAD_AT_CONNECTION:
+      /* Connection parameters are set by TpBaseProtocolClass->new_connection
+       * after the channel managers are created. So at this step self->roster
+       * is not NULL and we pass the property.
+       */
+      if (self->roster != NULL)
+        g_object_set (self->roster, "download-at-connection",
+            g_value_get_boolean (value), NULL);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -1169,6 +1205,15 @@
           FALSE,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  g_object_class_install_property (
+      object_class, PROP_DOWNLOAD_AT_CONNECTION,
+      g_param_spec_boolean (
+          "download-roster-at-connection",
+          "Download the contact list at connection?",
+          "Download the contact list at connection?",
+          TRUE,
+          G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
   g_object_class_install_property (object_class, PROP_FALLBACK_SERVERS,
       g_param_spec_boxed (
         "fallback-servers", "Fallback servers",
@@ -1229,7 +1274,9 @@
   tp_clear_object (&self->disco);
   tp_clear_object (&self->req_pipeline);
   tp_clear_object (&self->vcard_manager);
-  tp_clear_object (&self->jingle_factory);
+#ifdef ENABLE_VOIP
+  tp_clear_object (&self->jingle_mint);
+#endif
 
   /* remove borrowed references before TpBaseConnection unrefs the channel
    * factories */
@@ -2832,10 +2879,12 @@
               if (var == NULL)
                 continue;
 
-              if (0 == strcmp (var, NS_GOOGLE_JINGLE_INFO))
-                conn->features |= GABBLE_CONNECTION_FEATURES_GOOGLE_JINGLE_INFO;
-              else if (0 == strcmp (var, NS_GOOGLE_ROSTER))
+              if (0 == strcmp (var, NS_GOOGLE_ROSTER))
                 conn->features |= GABBLE_CONNECTION_FEATURES_GOOGLE_ROSTER;
+#ifdef ENABLE_VOIP
+              else if (0 == strcmp (var, NS_GOOGLE_JINGLE_INFO))
+                conn->features |= GABBLE_CONNECTION_FEATURES_GOOGLE_JINGLE_INFO;
+#endif
               else if (0 == strcmp (var, NS_PRESENCE_INVISIBLE))
                 conn->features |= GABBLE_CONNECTION_FEATURES_PRESENCE_INVISIBLE;
               else if (0 == strcmp (var, NS_PRIVACY))
diff -Nru telepathy-gabble-0.15.4/src/connection.h telepathy-gabble-0.16.0/src/connection.h
--- telepathy-gabble-0.15.4/src/connection.h	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/connection.h	2012-03-26 18:00:06.000000000 +0000
@@ -37,7 +37,9 @@
 #ifdef ENABLE_FILE_TRANSFER
 #include "ft-manager.h"
 #endif
-#include "jingle-factory.h"
+#ifdef ENABLE_VOIP
+#include "jingle-mint.h"
+#endif
 #include "muc-factory.h"
 #include "types.h"
 
@@ -222,8 +224,9 @@
     /* outstanding vcard requests */
     GHashTable *vcard_requests;
 
-    /* jingle factory */
-    GabbleJingleFactory *jingle_factory;
+#ifdef ENABLE_VOIP
+    GabbleJingleMint *jingle_mint;
+#endif
 
 #ifdef ENABLE_FILE_TRANSFER
     /* file transfer manager */
diff -Nru telepathy-gabble-0.15.4/src/ft-channel.c telepathy-gabble-0.16.0/src/ft-channel.c
--- telepathy-gabble-0.15.4/src/ft-channel.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/ft-channel.c	2012-03-26 18:00:06.000000000 +0000
@@ -48,7 +48,7 @@
 #include "presence-cache.h"
 #include "util.h"
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -57,23 +57,18 @@
 #include 
 
 
-static void channel_iface_init (gpointer g_iface, gpointer iface_data);
 static void file_transfer_iface_init (gpointer g_iface, gpointer iface_data);
 static void transferred_chunk (GabbleFileTransferChannel *self, guint64 count);
 static gboolean set_bytestream (GabbleFileTransferChannel *self,
     GabbleBytestreamIface *bytestream);
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 static gboolean set_gtalk_file_collection (GabbleFileTransferChannel *self,
     GTalkFileCollection *gtalk_file_collection);
-
+#endif
 
 
 G_DEFINE_TYPE_WITH_CODE (GabbleFileTransferChannel, gabble_file_transfer_channel,
-    G_TYPE_OBJECT,
-    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
-                           tp_dbus_properties_mixin_iface_init);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
+    TP_TYPE_BASE_CHANNEL,
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_FILE_TRANSFER,
                            file_transfer_iface_init);
     G_IMPLEMENT_INTERFACE (GABBLE_TYPE_SVC_CHANNEL_TYPE_FILETRANSFER_FUTURE,
@@ -89,23 +84,8 @@
 /* properties */
 enum
 {
-  PROP_OBJECT_PATH = 1,
-
-   /* org.freedesktop.Telepathy.Channel D-Bus properties */
-  PROP_CHANNEL_TYPE,
-  PROP_INTERFACES,
-  PROP_HANDLE,
-  PROP_TARGET_ID,
-  PROP_HANDLE_TYPE,
-  PROP_REQUESTED,
-  PROP_INITIATOR_HANDLE,
-  PROP_INITIATOR_ID,
-
-  PROP_CHANNEL_DESTROYED,
-  PROP_CHANNEL_PROPERTIES,
-
-  /* org.freedesktop.Telepathy.Channel.Type.FileTransfer D-Bus properties */
-  PROP_STATE,
+  /* Channel.Type.FileTransfer D-Bus properties */
+  PROP_STATE = 1,
   PROP_CONTENT_TYPE,
   PROP_FILENAME,
   PROP_SIZE,
@@ -123,8 +103,10 @@
   PROP_CONNECTION,
   PROP_BYTESTREAM,
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   /* Chan.Type.FileTransfer.FUTURE */
   PROP_GTALK_FILE_COLLECTION,
+#endif
 
   /* Chan.Iface.FileTransfer.Metadata */
   PROP_SERVICE_NAME,
@@ -136,18 +118,15 @@
 /* private structure */
 struct _GabbleFileTransferChannelPrivate {
   gboolean dispose_has_run;
-  gboolean closed;
-  gchar *object_path;
-  TpHandle handle;
-  GabbleConnection *connection;
   GTimeVal last_transferred_bytes_emitted;
   guint progress_timer;
   TpSocketAddressType socket_type;
   GValue *socket_address;
-  TpHandle initiator;
   gboolean resume_supported;
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   GTalkFileCollection *gtalk_file_collection;
+#endif
 
   GabbleBytestreamIface *bytestream;
   GibberListener *listener;
@@ -172,16 +151,28 @@
   gboolean channel_opened;
 };
 
+static void gabble_file_transfer_channel_set_state (
+    TpSvcChannelTypeFileTransfer *iface, TpFileTransferState state,
+    TpFileTransferStateChangeReason reason);
+static void close_session_and_transport (GabbleFileTransferChannel *self);
 
-void
-gabble_file_transfer_channel_do_close (GabbleFileTransferChannel *self)
+static void
+gabble_file_transfer_channel_close (TpBaseChannel *base)
 {
-  if (self->priv->closed)
-    return;
+  GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (base);
+
+  if (self->priv->state != TP_FILE_TRANSFER_STATE_COMPLETED &&
+      self->priv->state != TP_FILE_TRANSFER_STATE_CANCELLED)
+    {
+      gabble_file_transfer_channel_set_state (
+          TP_SVC_CHANNEL_TYPE_FILE_TRANSFER (self),
+          TP_FILE_TRANSFER_STATE_CANCELLED,
+          TP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_STOPPED);
+
+      close_session_and_transport (self);
+    }
 
-  DEBUG ("Emitting closed signal for %s", self->priv->object_path);
-  self->priv->closed = TRUE;
-  tp_svc_channel_emit_closed (self);
+  tp_base_channel_destroyed (base);
 }
 
 static void
@@ -189,16 +180,8 @@
 {
   obj->priv = G_TYPE_INSTANCE_GET_PRIVATE (obj,
       GABBLE_TYPE_FILE_TRANSFER_CHANNEL, GabbleFileTransferChannelPrivate);
-
-  /* allocate any data required by the object here */
-  obj->priv->object_path = NULL;
-  obj->priv->connection = NULL;
 }
 
-static void gabble_file_transfer_channel_set_state (
-    TpSvcChannelTypeFileTransfer *iface, TpFileTransferState state,
-    TpFileTransferStateChangeReason reason);
-
 static void
 gabble_file_transfer_channel_get_property (GObject *object,
                                            guint property_id,
@@ -206,55 +189,9 @@
                                            GParamSpec *pspec)
 {
   GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (object);
-  TpBaseConnection *base_conn = (TpBaseConnection *) self->priv->connection;
 
   switch (property_id)
     {
-      case PROP_OBJECT_PATH:
-        g_value_set_string (value, self->priv->object_path);
-        break;
-      case PROP_CHANNEL_TYPE:
-        g_value_set_static_string (value,
-            TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER);
-        break;
-      case PROP_HANDLE_TYPE:
-        g_value_set_uint (value, TP_HANDLE_TYPE_CONTACT);
-        break;
-      case PROP_TARGET_ID:
-        {
-           TpHandleRepoIface *repo = tp_base_connection_get_handles (base_conn,
-             TP_HANDLE_TYPE_CONTACT);
-
-           g_value_set_string (value, tp_handle_inspect (repo,
-                 self->priv->handle));
-        }
-        break;
-      case PROP_HANDLE:
-        g_value_set_uint (value, self->priv->handle);
-        break;
-      case PROP_REQUESTED:
-        g_value_set_boolean (value, (self->priv->initiator ==
-              base_conn->self_handle));
-        break;
-      case PROP_INITIATOR_HANDLE:
-        g_value_set_uint (value, self->priv->initiator);
-        break;
-      case PROP_INITIATOR_ID:
-          {
-            TpHandleRepoIface *repo = tp_base_connection_get_handles (
-                base_conn, TP_HANDLE_TYPE_CONTACT);
-
-            g_assert (self->priv->initiator != 0);
-            g_value_set_string (value,
-                tp_handle_inspect (repo, self->priv->initiator));
-          }
-        break;
-      case PROP_CONNECTION:
-        g_value_set_object (value, self->priv->connection);
-        break;
-      case PROP_INTERFACES:
-        g_value_set_boxed (value, gabble_file_transfer_channel_interfaces);
-        break;
       case PROP_STATE:
         g_value_set_uint (value, self->priv->state);
         break;
@@ -295,57 +232,17 @@
         g_value_set_string (value,
             self->priv->uri != NULL ? self->priv->uri: "");
         break;
-      case PROP_CHANNEL_DESTROYED:
-        g_value_set_boolean (value, self->priv->closed);
-        break;
       case PROP_RESUME_SUPPORTED:
         g_value_set_boolean (value, self->priv->resume_supported);
         break;
-      case PROP_CHANNEL_PROPERTIES:
-        {
-          GHashTable *props;
-
-          props = tp_dbus_properties_mixin_make_properties_hash (object,
-              TP_IFACE_CHANNEL, "ChannelType",
-              TP_IFACE_CHANNEL, "Interfaces",
-              TP_IFACE_CHANNEL, "TargetHandle",
-              TP_IFACE_CHANNEL, "TargetID",
-              TP_IFACE_CHANNEL, "TargetHandleType",
-              TP_IFACE_CHANNEL, "Requested",
-              TP_IFACE_CHANNEL, "InitiatorHandle",
-              TP_IFACE_CHANNEL, "InitiatorID",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "State",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentType",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Filename",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Size",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentHashType",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentHash",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Description",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Date",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "AvailableSocketTypes",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "TransferredBytes",
-              TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "InitialOffset",
-              GABBLE_IFACE_CHANNEL_TYPE_FILETRANSFER_FUTURE, "FileCollection",
-              TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "ServiceName",
-              TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "Metadata",
-              NULL);
-
-          /* URI is immutable only for outgoing transfers */
-          if (self->priv->initiator == base_conn->self_handle)
-            {
-              tp_dbus_properties_mixin_fill_properties_hash (object, props,
-                  TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "URI", NULL);
-            }
-
-          g_value_take_boxed (value, props);
-        }
-        break;
       case PROP_BYTESTREAM:
         g_value_set_object (value, self->priv->bytestream);
         break;
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       case PROP_GTALK_FILE_COLLECTION:
         g_value_set_object (value, self->priv->gtalk_file_collection);
         break;
+#endif
       case PROP_SERVICE_NAME:
         g_value_set_string (value, self->priv->service_name);
         break;
@@ -380,21 +277,6 @@
 
   switch (property_id)
     {
-      case PROP_OBJECT_PATH:
-        g_free (self->priv->object_path);
-        self->priv->object_path = g_value_dup_string (value);
-        break;
-      case PROP_HANDLE:
-        self->priv->handle = g_value_get_uint (value);
-        break;
-      case PROP_CONNECTION:
-        self->priv->connection = g_value_get_object (value);
-        break;
-      /* these properties are writable in the interface, but not actually
-       * meaningfully changeable on this channel, so we do nothing */
-      case PROP_HANDLE_TYPE:
-      case PROP_CHANNEL_TYPE:
-        break;
       case PROP_STATE:
         gabble_file_transfer_channel_set_state (
             TP_SVC_CHANNEL_TYPE_FILE_TRANSFER (object),
@@ -423,10 +305,6 @@
         g_free (self->priv->description);
         self->priv->description = g_value_dup_string (value);
         break;
-      case PROP_INITIATOR_HANDLE:
-        self->priv->initiator = g_value_get_uint (value);
-        g_assert (self->priv->initiator != 0);
-        break;
       case PROP_DATE:
         self->priv->date = g_value_get_uint64 (value);
         break;
@@ -448,10 +326,12 @@
         set_bytestream (self,
             GABBLE_BYTESTREAM_IFACE (g_value_get_object (value)));
         break;
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       case PROP_GTALK_FILE_COLLECTION:
         set_gtalk_file_collection (self,
             GTALK_FILE_COLLECTION (g_value_get_object (value)));
         break;
+#endif
       case PROP_SERVICE_NAME:
         self->priv->service_name = g_value_dup_string (value);
         break;
@@ -475,6 +355,9 @@
                                  GArray *handles,
                                  GabbleFileTransferChannel *self)
 {
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
   guint i;
 
   for (i = 0; i < handles->len ; i++)
@@ -482,12 +365,12 @@
       TpHandle handle;
 
       handle = g_array_index (handles, TpHandle, i);
-      if (handle == self->priv->handle)
+      if (handle == tp_base_channel_get_target_handle (base))
         {
           GabblePresence *presence;
 
           presence = gabble_presence_cache_get (
-              self->priv->connection->presence_cache, handle);
+              conn->presence_cache, handle);
 
           if (presence == NULL || presence->status < GABBLE_PRESENCE_XA)
             {
@@ -507,39 +390,24 @@
     }
 }
 
-static GObject *
-gabble_file_transfer_channel_constructor (GType type,
-                                          guint n_props,
-                                          GObjectConstructParam *props)
-{
-  GObject *obj;
-  GabbleFileTransferChannel *self;
-  TpDBusDaemon *bus;
-  TpBaseConnection *base_conn;
-  TpHandleRepoIface *contact_repo;
+static void
+gabble_file_transfer_channel_constructed (GObject *obj)
+{
+  GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (obj);
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
+  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+      base_conn, TP_HANDLE_TYPE_CONTACT);
   GArray *socket_access;
   TpSocketAccessControl access_control;
 
-  /* Parent constructor chain */
-  obj = G_OBJECT_CLASS (gabble_file_transfer_channel_parent_class)->
-          constructor (type, n_props, props);
-  self = GABBLE_FILE_TRANSFER_CHANNEL (obj);
-  base_conn = TP_BASE_CONNECTION (self->priv->connection);
+  /* Parent constructed chain */
+  void (*chain_up) (GObject *) =
+    ((GObjectClass *) gabble_file_transfer_channel_parent_class)->constructed;
 
-  /* Ref the target and initiator handles; they can't be reffed in
-   * _set_property as we may not have the TpConnection at that point.
-   */
-  contact_repo = tp_base_connection_get_handles (base_conn,
-      TP_HANDLE_TYPE_CONTACT);
-  tp_handle_ref (contact_repo, self->priv->handle);
-  tp_handle_ref (contact_repo, self->priv->initiator);
-
-  self->priv->object_path = g_strdup_printf ("%s/FileTransferChannel/%p",
-      base_conn->object_path, self);
-
-  /* Connect to the bus */
-  bus = tp_base_connection_get_dbus_daemon (base_conn);
-  tp_dbus_daemon_register_object (bus, self->priv->object_path, obj);
+  if (chain_up != NULL)
+    chain_up (obj);
 
   /* Initialise the available socket types hash table */
   self->priv->available_socket_types = g_hash_table_new_full (g_direct_hash,
@@ -571,24 +439,22 @@
   g_hash_table_insert (self->priv->available_socket_types,
       GUINT_TO_POINTER (TP_SOCKET_ADDRESS_TYPE_IPV6), socket_access);
 
-  gabble_signal_connect_weak (self->priv->connection->presence_cache,
+  gabble_signal_connect_weak (conn->presence_cache,
       "presences-updated", G_CALLBACK (connection_presences_updated_cb), obj);
 
   DEBUG ("New FT channel created: %s (contact: %s, initiator: %s, "
       "file: \"%s\", size: %" G_GUINT64_FORMAT ")",
-       self->priv->object_path,
-       tp_handle_inspect (contact_repo, self->priv->handle),
-       tp_handle_inspect (contact_repo, self->priv->initiator),
+      tp_base_channel_get_object_path (base),
+      tp_handle_inspect (contact_repo, tp_base_channel_get_target_handle (base)),
+      tp_handle_inspect (contact_repo,
+          tp_base_channel_get_initiator (base)),
        self->priv->filename, self->priv->size);
 
-  if (self->priv->initiator != base_conn->self_handle)
+  if (!tp_base_channel_is_requested (base))
     /* Incoming transfer, URI has to be set by the handler */
     g_assert (self->priv->uri == NULL);
-
-  return obj;
 }
 
-static void close_session_and_transport (GabbleFileTransferChannel *self);
 static void gabble_file_transfer_channel_dispose (GObject *object);
 static void gabble_file_transfer_channel_finalize (GObject *object);
 
@@ -601,7 +467,7 @@
     GError **error)
 {
   GabbleFileTransferChannel *self = (GabbleFileTransferChannel *) object;
-  TpBaseConnection *base_conn = TP_BASE_CONNECTION (self->priv->connection);
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
 
   g_return_val_if_fail (interface == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER,
       FALSE);
@@ -620,7 +486,7 @@
       return FALSE;
     }
 
-  if (self->priv->initiator == base_conn->self_handle)
+  if (tp_base_channel_is_requested (base))
     {
       g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
           "Channel is not an incoming transfer");
@@ -642,25 +508,56 @@
 }
 
 static void
+gabble_file_transfer_channel_fill_immutable_properties (TpBaseChannel *chan,
+    GHashTable *properties)
+{
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_CLASS (
+      gabble_file_transfer_channel_parent_class);
+
+  cls->fill_immutable_properties (chan, properties);
+
+  tp_dbus_properties_mixin_fill_properties_hash (
+      G_OBJECT (chan), properties,
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "State",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentType",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Filename",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Size",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentHashType",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentHash",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Description",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Date",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "AvailableSocketTypes",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "TransferredBytes",
+      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "InitialOffset",
+      GABBLE_IFACE_CHANNEL_TYPE_FILETRANSFER_FUTURE, "FileCollection",
+      TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "ServiceName",
+      TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "Metadata",
+      NULL);
+
+  /* URI is immutable only for outgoing transfers */
+  if (tp_base_channel_is_requested (chan))
+    {
+      tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (chan), properties,
+          TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "URI", NULL);
+    }
+}
+
+static gchar *
+gabble_file_transfer_channel_get_object_path_suffix (TpBaseChannel *chan)
+{
+  return g_strdup_printf ("FileTransferChannel/%p", chan);
+}
+
+static void
 gabble_file_transfer_channel_class_init (
     GabbleFileTransferChannelClass *gabble_file_transfer_channel_class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (
       gabble_file_transfer_channel_class);
+  TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (
+      gabble_file_transfer_channel_class);
   GParamSpec *param_spec;
 
-  static TpDBusPropertiesMixinPropImpl channel_props[] = {
-    { "TargetHandleType", "handle-type", NULL },
-    { "TargetHandle", "handle", NULL },
-    { "TargetID", "target-id", NULL },
-    { "ChannelType", "channel-type", NULL },
-    { "Interfaces", "interfaces", NULL },
-    { "Requested", "requested", NULL },
-    { "InitiatorHandle", "initiator-handle", NULL },
-    { "InitiatorID", "initiator-id", NULL },
-    { NULL }
-  };
-
   static TpDBusPropertiesMixinPropImpl file_props[] = {
     { "State", "state", NULL },
     { "ContentType", "content-type", NULL },
@@ -689,11 +586,6 @@
   };
 
   static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
-    { TP_IFACE_CHANNEL,
-      tp_dbus_properties_mixin_getter_gobject_properties,
-      NULL,
-      channel_props
-    },
     { TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER,
       tp_dbus_properties_mixin_getter_gobject_properties,
       file_transfer_channel_properties_setter,
@@ -717,63 +609,18 @@
 
   object_class->dispose = gabble_file_transfer_channel_dispose;
   object_class->finalize = gabble_file_transfer_channel_finalize;
-
-  object_class->constructor = gabble_file_transfer_channel_constructor;
+  object_class->constructed = gabble_file_transfer_channel_constructed;
   object_class->get_property = gabble_file_transfer_channel_get_property;
   object_class->set_property = gabble_file_transfer_channel_set_property;
 
-  g_object_class_override_property (object_class, PROP_OBJECT_PATH,
-      "object-path");
-  g_object_class_override_property (object_class, PROP_CHANNEL_TYPE,
-      "channel-type");
-  g_object_class_override_property (object_class, PROP_HANDLE_TYPE,
-      "handle-type");
-  g_object_class_override_property (object_class, PROP_HANDLE, "handle");
-  g_object_class_override_property (object_class, PROP_CHANNEL_DESTROYED,
-      "channel-destroyed");
-  g_object_class_override_property (object_class, PROP_CHANNEL_PROPERTIES,
-      "channel-properties");
-
-  param_spec = g_param_spec_string ("target-id", "Target JID",
-      "The string obtained by inspecting this channel's handle",
-      NULL,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
-
-  param_spec = g_param_spec_boolean ("requested", "Requested?",
-      "True if this channel was requested by the local user",
-      FALSE,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_REQUESTED, param_spec);
-
- param_spec = g_param_spec_uint ("initiator-handle", "Initiator's handle",
-      "The contact who initiated the channel",
-      0, G_MAXUINT32, 0,
-      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIATOR_HANDLE,
-      param_spec);
-
-  param_spec = g_param_spec_string ("initiator-id", "Initiator's bare JID",
-      "The string obtained by inspecting the initiator-handle",
-      NULL,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIATOR_ID,
-      param_spec);
-
-  param_spec = g_param_spec_object ("connection",
-      "GabbleConnection object",
-      "Gabble Connection that owns the"
-      "connection for this IM channel",
-      GABBLE_TYPE_CONNECTION,
-      G_PARAM_CONSTRUCT_ONLY |
-      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
-
-  param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
-      "Additional Channel.Interface.* interfaces",
-      G_TYPE_STRV,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
+  base_class->channel_type = TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER;
+  base_class->interfaces = gabble_file_transfer_channel_interfaces;
+  base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT;
+  base_class->close = gabble_file_transfer_channel_close;
+  base_class->fill_immutable_properties =
+    gabble_file_transfer_channel_fill_immutable_properties;
+  base_class->get_object_path_suffix =
+    gabble_file_transfer_channel_get_object_path_suffix;
 
   param_spec = g_param_spec_uint (
       "state",
@@ -900,6 +747,7 @@
   g_object_class_install_property (object_class, PROP_BYTESTREAM,
       param_spec);
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   param_spec = g_param_spec_object (
       "gtalk-file-collection",
       "GTalkFileCollection object for gtalk-compatible file transfer",
@@ -908,6 +756,7 @@
       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
   g_object_class_install_property (object_class, PROP_GTALK_FILE_COLLECTION,
       param_spec);
+#endif
 
   param_spec = g_param_spec_boolean (
       "resume-supported",
@@ -963,20 +812,12 @@
 gabble_file_transfer_channel_dispose (GObject *object)
 {
   GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (object);
-  TpBaseConnection *base_conn = TP_BASE_CONNECTION (self->priv->connection);
-  TpHandleRepoIface *handle_repo = tp_base_connection_get_handles (base_conn,
-      TP_HANDLE_TYPE_CONTACT);
 
   if (self->priv->dispose_has_run)
     return;
 
   DEBUG ("dispose called");
   self->priv->dispose_has_run = TRUE;
-  gabble_file_transfer_channel_do_close (self);
-
-  tp_handle_unref (handle_repo, self->priv->handle);
-  tp_handle_unref (handle_repo, self->priv->initiator);
-
 
   if (self->priv->progress_timer != 0)
     {
@@ -986,7 +827,6 @@
 
   close_session_and_transport (self);
 
-
   /* release any references held by the object here */
 
   if (G_OBJECT_CLASS (gabble_file_transfer_channel_parent_class)->dispose)
@@ -1019,7 +859,6 @@
 
   /* free any data held directly by the object here */
   erase_socket (self);
-  g_free (self->priv->object_path);
   g_free (self->priv->filename);
   if (self->priv->socket_address != NULL)
     tp_g_value_slice_free (self->priv->socket_address);
@@ -1042,10 +881,12 @@
 
   DEBUG ("Closing session and transport");
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   if (self->priv->gtalk_file_collection != NULL)
     gtalk_file_collection_terminate (self->priv->gtalk_file_collection, self);
 
   tp_clear_object (&self->priv->gtalk_file_collection);
+#endif
 
   if (self->priv->bytestream != NULL)
     gabble_bytestream_iface_close (self->priv->bytestream, NULL);
@@ -1055,91 +896,6 @@
   tp_clear_object (&self->priv->transport);
 }
 
-/**
- * gabble_file_transfer_channel_close
- *
- * Implements DBus method Close
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_file_transfer_channel_close (TpSvcChannel *iface,
-                                   DBusGMethodInvocation *context)
-{
-  GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (iface);
-
-  if (self->priv->state != TP_FILE_TRANSFER_STATE_COMPLETED &&
-      self->priv->state != TP_FILE_TRANSFER_STATE_CANCELLED)
-    {
-      gabble_file_transfer_channel_set_state (
-          TP_SVC_CHANNEL_TYPE_FILE_TRANSFER (iface),
-          TP_FILE_TRANSFER_STATE_CANCELLED,
-          TP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_STOPPED);
-
-      close_session_and_transport (self);
-    }
-
-  gabble_file_transfer_channel_do_close (GABBLE_FILE_TRANSFER_CHANNEL (iface));
-  tp_svc_channel_return_from_close (context);
-}
-
-/**
- * gabble_file_transfer_channel_get_channel_type
- *
- * Implements DBus method GetChannelType
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_file_transfer_channel_get_channel_type (TpSvcChannel *iface,
-                                              DBusGMethodInvocation *context)
-{
-  tp_svc_channel_return_from_get_channel_type (context,
-      TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER);
-}
-
-/**
- * gabble_file_transfer_channel_get_handle
- *
- * Implements DBus method GetHandle
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_file_transfer_channel_get_handle (TpSvcChannel *iface,
-                                        DBusGMethodInvocation *context)
-{
-  GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (iface);
-
-  tp_svc_channel_return_from_get_handle (context, TP_HANDLE_TYPE_CONTACT,
-      self->priv->handle);
-}
-
-/**
- * gabble_file_transfer_channel_get_interfaces
- *
- * Implements DBus method GetInterfaces
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_file_transfer_channel_get_interfaces (TpSvcChannel *iface,
-                                            DBusGMethodInvocation *context)
-{
-  tp_svc_channel_return_from_get_interfaces (context,
-      gabble_file_transfer_channel_interfaces);
-}
-
-static void
-channel_iface_init (gpointer g_iface, gpointer iface_data)
-{
-  TpSvcChannelClass *klass = (TpSvcChannelClass *) g_iface;
-
-#define IMPLEMENT(x) tp_svc_channel_implement_##x (\
-    klass, gabble_file_transfer_channel_##x)
-  IMPLEMENT (close);
-  IMPLEMENT (get_channel_type);
-  IMPLEMENT (get_handle);
-  IMPLEMENT (get_interfaces);
-#undef IMPLEMENT
-}
-
 static gboolean setup_local_socket (GabbleFileTransferChannel *self,
     TpSocketAddressType address_type, TpSocketAccessControl access_control,
     const GValue *access_control_param);
@@ -1236,11 +992,8 @@
   if (self->priv->state != TP_FILE_TRANSFER_STATE_COMPLETED &&
       self->priv->state != TP_FILE_TRANSFER_STATE_CANCELLED)
     {
-      TpBaseConnection *base_conn = (TpBaseConnection *)
-          self->priv->connection;
-      gboolean receiver;
-
-      receiver = (self->priv->initiator != base_conn->self_handle);
+      gboolean receiver = !tp_base_channel_is_requested (
+          TP_BASE_CHANNEL (self));
 
       /* Something did wrong */
       gabble_file_transfer_channel_set_state (
@@ -1282,7 +1035,9 @@
     return FALSE;
 
   g_return_val_if_fail (self->priv->bytestream == NULL, FALSE);
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   g_return_val_if_fail (self->priv->gtalk_file_collection == NULL, FALSE);
+#endif
 
   DEBUG ("Setting bytestream to %p", bytestream);
 
@@ -1296,6 +1051,7 @@
   return TRUE;
 }
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 static gboolean
 set_gtalk_file_collection (
     GabbleFileTransferChannel *self, GTalkFileCollection *gtalk_file_collection)
@@ -1313,6 +1069,7 @@
 
   return TRUE;
 }
+#endif
 
 static void
 bytestream_negotiate_cb (GabbleBytestreamIface *bytestream,
@@ -1445,6 +1202,8 @@
 offer_bytestream (GabbleFileTransferChannel *self, const gchar *jid,
                   const gchar *resource, GError **error)
 {
+  GabbleConnection *conn = GABBLE_CONNECTION (tp_base_channel_get_connection (
+          TP_BASE_CHANNEL (self)));
   gboolean result;
   WockyStanza *msg;
   WockyNode *si_node, *file_node;
@@ -1459,7 +1218,7 @@
 
   /* Outgoing FT , we'll need SOCK5 proxies */
   gabble_bytestream_factory_query_socks5_proxies (
-      self->priv->connection->bytestream_factory);
+      conn->bytestream_factory);
 
 
   stream_id = gabble_bytestream_factory_generate_stream_id ();
@@ -1510,7 +1269,7 @@
   wocky_node_add_child_with_content (file_node, "range", NULL);
 
   result = gabble_bytestream_factory_negotiate_stream (
-      self->priv->connection->bytestream_factory, msg, stream_id,
+      conn->bytestream_factory, msg, stream_id,
       bytestream_negotiate_cb, self, G_OBJECT (self), error);
 
   g_object_unref (msg);
@@ -1521,7 +1280,7 @@
   return result;
 }
 
-
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 void
 gabble_file_transfer_channel_gtalk_file_collection_state_changed (
     GabbleFileTransferChannel *self,
@@ -1587,13 +1346,20 @@
 offer_gtalk_file_transfer (GabbleFileTransferChannel *self,
     const gchar *full_jid, GError **error)
 {
-
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  GabbleConnection *conn = GABBLE_CONNECTION (
+      tp_base_channel_get_connection (base));
+  GabbleJingleFactory *jf;
   GTalkFileCollection *gtalk_file_collection;
 
   DEBUG ("Offering Gtalk file transfer to %s", full_jid);
 
+  jf = gabble_jingle_mint_get_factory (conn->jingle_mint);
+  g_return_val_if_fail (jf != NULL, FALSE);
+
   gtalk_file_collection = gtalk_file_collection_new (self,
-      self->priv->connection->jingle_factory, self->priv->handle, full_jid);
+      jf,
+      tp_base_channel_get_target_handle (base), full_jid);
 
   g_return_val_if_fail (gtalk_file_collection != NULL, FALSE);
 
@@ -1610,26 +1376,36 @@
 
   return TRUE;
 }
+#endif
 
 gboolean
 gabble_file_transfer_channel_offer_file (GabbleFileTransferChannel *self,
                                          GError **error)
 {
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
   GabblePresence *presence;
   gboolean result;
   TpHandleRepoIface *contact_repo, *room_repo;
   const gchar *jid;
   gboolean si = FALSE;
-  gboolean jingle_share = FALSE;
+  gboolean use_si = FALSE;
   const gchar *si_resource = NULL;
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
+  gboolean jingle_share = FALSE;
   const gchar *share_resource = NULL;
+#endif
+
   g_assert (!tp_str_empty (self->priv->filename));
   g_assert (self->priv->size != GABBLE_UNDEFINED_FILE_SIZE);
   g_return_val_if_fail (self->priv->bytestream == NULL, FALSE);
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   g_return_val_if_fail (self->priv->gtalk_file_collection == NULL, FALSE);
+#endif
 
-  presence = gabble_presence_cache_get (self->priv->connection->presence_cache,
-      self->priv->handle);
+  presence = gabble_presence_cache_get (conn->presence_cache,
+      tp_base_channel_get_target_handle (base));
 
   if (presence == NULL)
     {
@@ -1655,12 +1431,13 @@
         }
     }
 
-  contact_repo = tp_base_connection_get_handles (
-     (TpBaseConnection *) self->priv->connection, TP_HANDLE_TYPE_CONTACT);
-  room_repo = tp_base_connection_get_handles (
-     (TpBaseConnection *) self->priv->connection, TP_HANDLE_TYPE_ROOM);
+  contact_repo = tp_base_connection_get_handles (base_conn,
+     TP_HANDLE_TYPE_CONTACT);
+  room_repo = tp_base_connection_get_handles (base_conn,
+     TP_HANDLE_TYPE_ROOM);
 
-  jid = tp_handle_inspect (contact_repo, self->priv->handle);
+  jid = tp_handle_inspect (contact_repo,
+      tp_base_channel_get_target_handle (base));
   if (gabble_get_room_handle_from_jid (room_repo, jid) == 0)
     {
       /* Not a MUC jid, need to get a resource */
@@ -1671,33 +1448,45 @@
          gabble_capability_set_predicate_has, NS_FILE_TRANSFER);
       si = (si_resource != NULL);
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       share_resource = gabble_presence_pick_resource_by_caps (presence, 0,
           gabble_capability_set_predicate_has, NS_GOOGLE_FEAT_SHARE);
       jingle_share  = (share_resource != NULL);
+#endif
     }
   else
     {
       /* MUC jid, we already have the full jid */
       si = gabble_presence_has_cap (presence, NS_FILE_TRANSFER);
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       jingle_share = gabble_presence_has_cap (presence, NS_GOOGLE_FEAT_SHARE);
+#endif
     }
 
   /* Use bytestream if we have SI, but no jingle-share or if we have SI and
      jingle-share but we have no google relay token */
-  if (si &&
-      (!jingle_share ||
-          gabble_jingle_factory_get_google_relay_token (
-              self->priv->connection->jingle_factory) == NULL))
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
+  use_si = si &&
+    (!jingle_share ||
+     gabble_jingle_info_get_google_relay_token (
+       gabble_jingle_mint_get_info (conn->jingle_mint)) == NULL);
+#else
+  use_si = si;
+#endif
+
+  if (use_si)
     {
       result = offer_bytestream (self, jid, si_resource, error);
     }
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   else if (jingle_share)
     {
-      gchar *full_jid = gabble_peer_to_jid (self->priv->connection,
-        self->priv->handle, share_resource);
+      gchar *full_jid = gabble_peer_to_jid (conn,
+          tp_base_channel_get_target_handle (base), share_resource);
       result = offer_gtalk_file_transfer (self, full_jid, error);
       g_free (full_jid);
     }
+#endif
   else
     {
       DEBUG ("contact doesn't have file transfer capabilities");
@@ -1835,20 +1624,22 @@
       /* We don't want to send more data while the buffer isn't empty */
       if (self->priv->bytestream != NULL)
         gabble_bytestream_iface_block_reading (self->priv->bytestream, TRUE);
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       else if (self->priv->gtalk_file_collection != NULL)
         gtalk_file_collection_block_reading (self->priv->gtalk_file_collection,
             self, TRUE);
+#endif
     }
 }
 
-
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 void
 gabble_file_transfer_channel_gtalk_file_collection_data_received (
     GabbleFileTransferChannel *self, const gchar *data, guint len)
 {
   data_received_cb (self, (const guint8 *) data, len);
 }
-
+#endif
 
 static void
 bytestream_data_received_cb (GabbleBytestreamIface *stream,
@@ -1902,10 +1693,10 @@
                                           DBusGMethodInvocation *context)
 {
   GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (iface);
-  TpBaseConnection *base_conn = (TpBaseConnection *) self->priv->connection;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
   GError *error = NULL;
 
-  if (self->priv->initiator == base_conn->self_handle)
+  if (tp_base_channel_is_requested (base))
     {
       g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
           "Channel is not an incoming transfer");
@@ -1972,6 +1763,7 @@
       gabble_bytestream_iface_accept (self->priv->bytestream, augment_si_reply,
           self);
     }
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   else if (self->priv->gtalk_file_collection != NULL)
     {
       /* Block the gtalk ft stream while the user is not connected
@@ -1980,6 +1772,7 @@
           self, TRUE);
       gtalk_file_collection_accept (self->priv->gtalk_file_collection, self);
     }
+#endif
   else
     {
       g_assert_not_reached ();
@@ -2001,10 +1794,9 @@
     DBusGMethodInvocation *context)
 {
   GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (iface);
-  TpBaseConnection *base_conn = (TpBaseConnection *) self->priv->connection;
   GError *error = NULL;
 
-  if (self->priv->initiator != base_conn->self_handle)
+  if (!tp_base_channel_is_requested (TP_BASE_CHANNEL (self)))
     {
       g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
           "Channel is not an outgoing transfer");
@@ -2085,12 +1877,15 @@
 static gchar *
 get_local_unix_socket_path (GabbleFileTransferChannel *self)
 {
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (
+      TP_BASE_CHANNEL (self));
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
   const gchar *tmp_dir;
   gchar *path = NULL;
   gchar *name;
   struct stat buf;
 
-  tmp_dir = gabble_ft_manager_get_tmp_dir (self->priv->connection->ft_manager);
+  tmp_dir = gabble_ft_manager_get_tmp_dir (conn->ft_manager);
   if (tmp_dir == NULL)
     return NULL;
 
@@ -2129,6 +1924,7 @@
           return;
         }
     }
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   else if (self->priv->gtalk_file_collection != NULL)
     {
       if (!gtalk_file_collection_send_data (self->priv->gtalk_file_collection,
@@ -2139,6 +1935,7 @@
           return;
         }
     }
+#endif
 
   transferred_chunk (self, (guint64) data->length);
 
@@ -2154,12 +1951,14 @@
               TP_FILE_TRANSFER_STATE_CHANGE_REASON_NONE);
           gabble_bytestream_iface_close (self->priv->bytestream, NULL);
         }
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       else if (self->priv->gtalk_file_collection != NULL)
         {
           DEBUG ("All the file has been sent.");
           gtalk_file_collection_completed (self->priv->gtalk_file_collection,
               self);
         }
+#endif
     }
 }
 
@@ -2172,6 +1971,7 @@
     gibber_transport_block_receiving (self->priv->transport, blocked);
 }
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 void
 gabble_file_transfer_channel_gtalk_file_collection_write_blocked (
     GabbleFileTransferChannel *self, gboolean blocked)
@@ -2179,7 +1979,7 @@
   if (self->priv->transport != NULL)
     gibber_transport_block_receiving (self->priv->transport, blocked);
 }
-
+#endif
 
 static void
 file_transfer_send (GabbleFileTransferChannel *self)
@@ -2201,17 +2001,19 @@
   /* Client is connected, we can now receive data. Unblock the bytestream */
   if (self->priv->bytestream != NULL)
     gabble_bytestream_iface_block_reading (self->priv->bytestream, FALSE);
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   else if (self->priv->gtalk_file_collection != NULL)
     gtalk_file_collection_block_reading (self->priv->gtalk_file_collection,
         self, FALSE);
+#endif
 }
 
 static void
 transport_disconnected_cb (GibberTransport *transport,
                            GabbleFileTransferChannel *self)
 {
-  TpBaseConnection *base_conn = (TpBaseConnection *) self->priv->connection;
-  gboolean requested = (self->priv->initiator == base_conn->self_handle);
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  gboolean requested = tp_base_channel_is_requested (base);
 
   DEBUG ("transport to local socket has been disconnected");
 
@@ -2244,9 +2046,11 @@
   if (self->priv->bytestream != NULL)
     gabble_bytestream_iface_block_reading (self->priv->bytestream, FALSE);
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   if (self->priv->gtalk_file_collection != NULL)
     gtalk_file_collection_block_reading (self->priv->gtalk_file_collection,
         self, FALSE);
+#endif
 
   if (self->priv->state > TP_FILE_TRANSFER_STATE_OPEN)
     gibber_transport_disconnect (transport);
@@ -2263,9 +2067,7 @@
                    gpointer user_data)
 {
   GabbleFileTransferChannel *self = GABBLE_FILE_TRANSFER_CHANNEL (user_data);
-  gboolean requested;
-  TpBaseConnection *base_conn = (TpBaseConnection *)
-      self->priv->connection;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
 
   DEBUG ("Client connected to local socket");
 
@@ -2275,9 +2077,7 @@
   gabble_signal_connect_weak (transport, "buffer-empty",
     G_CALLBACK (transport_buffer_empty_cb), G_OBJECT (self));
 
-  requested = (self->priv->initiator == base_conn->self_handle);
-
-  if (!requested)
+  if (!tp_base_channel_is_requested (base))
     /* Incoming file transfer */
     file_transfer_receive (self);
   else
@@ -2414,17 +2214,26 @@
                                   guint64 initial_offset,
                                   gboolean resume_supported,
                                   GabbleBytestreamIface *bytestream,
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
                                   GTalkFileCollection *gtalk_file_collection,
+#else
+                                  gpointer gtalk_file_collection_dummy,
+#endif
                                   const gchar *file_collection,
                                   const gchar *uri,
                                   const gchar *service_name,
                                   const GHashTable *metadata)
 
 {
+#ifndef ENABLE_JINGLE_FILE_TRANSFER
+  g_assert (gtalk_file_collection_dummy == NULL);
+#endif
+
   return g_object_new (GABBLE_TYPE_FILE_TRANSFER_CHANNEL,
       "connection", conn,
       "handle", handle,
       "initiator-handle", initiator_handle,
+      "requested", (initiator_handle != handle),
       "state", state,
       "content-type", content_type,
       "filename", filename,
@@ -2437,7 +2246,9 @@
       "resume-supported", resume_supported,
       "file-collection", file_collection,
       "bytestream", bytestream,
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       "gtalk-file-collection", gtalk_file_collection,
+#endif
       "uri", uri,
       "service-name", service_name,
       "metadata", metadata,
diff -Nru telepathy-gabble-0.15.4/src/ft-channel.h telepathy-gabble-0.16.0/src/ft-channel.h
--- telepathy-gabble-0.15.4/src/ft-channel.h	2012-01-18 12:45:07.000000000 +0000
+++ telepathy-gabble-0.16.0/src/ft-channel.h	2012-03-26 18:00:06.000000000 +0000
@@ -21,12 +21,18 @@
 #ifndef __GABBLE_FILE_TRANSFER_CHANNEL_H__
 #define __GABBLE_FILE_TRANSFER_CHANNEL_H__
 
+#include "config.h"
+
 #include 
 #include 
 
+#include 
+
 typedef struct _GabbleFileTransferChannel GabbleFileTransferChannel;
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 #include "gtalk-file-collection.h"
+#endif
 
 #include "bytestream-factory.h"
 
@@ -36,12 +42,12 @@
 typedef struct _GabbleFileTransferChannelPrivate GabbleFileTransferChannelPrivate;
 
 struct _GabbleFileTransferChannelClass {
-    GObjectClass parent_class;
+    TpBaseChannelClass parent_class;
     TpDBusPropertiesMixinClass dbus_props_class;
 };
 
 struct _GabbleFileTransferChannel {
-    GObject parent;
+    TpBaseChannel parent;
 
     GabbleFileTransferChannelPrivate *priv;
 };
@@ -71,12 +77,20 @@
     TpFileHashType content_hash_type, const gchar *content_hash,
     const gchar *description, guint64 date, guint64 initial_offset,
     gboolean resume_supported, GabbleBytestreamIface *bytestream,
-    GTalkFileCollection *gtalk_fc, const gchar *file_collection,
-    const gchar *uri, const gchar *service_name, const GHashTable *metadata);
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
+    GTalkFileCollection *gtalk_fc,
+#else
+    /* It's easier for the calling code if we don't change the number of
+     * arguments based on a #ifdef */
+    gpointer gtalk_fc_dummy,
+#endif
+    const gchar *file_collection, const gchar *uri, const gchar *service_name,
+    const GHashTable *metadata);
 
 gboolean gabble_file_transfer_channel_offer_file (
     GabbleFileTransferChannel *self, GError **error);
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 /* The following methods are a hack, they are 'signal-like' callbacks for the
    GTalkFileCollection. They have to be made this way because the FileCollection
    can't send out signals since it needs its signals to be sent to a specific
@@ -92,10 +106,7 @@
 
 void gabble_file_transfer_channel_gtalk_file_collection_data_received (
     GabbleFileTransferChannel *self, const gchar *data, guint len);
-
-void
-gabble_file_transfer_channel_do_close (GabbleFileTransferChannel *self);
-
+#endif
 
 G_END_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/ft-manager.c telepathy-gabble-0.16.0/src/ft-manager.c
--- telepathy-gabble-0.15.4/src/ft-manager.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/ft-manager.c	2012-03-26 18:00:06.000000000 +0000
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include "config.h"
+
 #define _BSD_SOURCE
 #define _XOPEN_SOURCE /* glibc2 needs this */
 #include 
@@ -28,8 +30,10 @@
 #include 
 #include 
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 #include "jingle-session.h"
 #include "jingle-share.h"
+#endif
 #include "gabble/caps-channel-manager.h"
 #include "connection.h"
 #include "ft-manager.h"
@@ -42,6 +46,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -190,7 +195,7 @@
 
   while ((l = self->priv->channels) != NULL)
     {
-      gabble_file_transfer_channel_do_close (l->data);
+      tp_base_channel_close (l->data);
       /* Channels should have closed and disappeared from the list */
       g_assert (l != self->priv->channels);
     }
@@ -286,6 +291,7 @@
     }
 }
 
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 static void
 gabble_ft_manager_channels_created (GabbleFtManager *self, GList *channels)
 {
@@ -297,6 +303,8 @@
     {
       GabbleFileTransferChannel *chan = i->data;
 
+      tp_base_channel_register (TP_BASE_CHANNEL (chan));
+
       gabble_signal_connect_weak (chan, "closed",
           G_CALLBACK (file_channel_closed_cb), G_OBJECT (self));
 
@@ -310,6 +318,7 @@
 
   g_hash_table_unref (new_channels);
 }
+#endif
 
 static void
 gabble_ft_manager_channel_created (GabbleFtManager *self,
@@ -318,6 +327,8 @@
 {
   GSList *requests = NULL;
 
+  tp_base_channel_register (TP_BASE_CHANNEL (chan));
+
   gabble_signal_connect_weak (chan, "closed",
       G_CALLBACK (file_channel_closed_cb), G_OBJECT (self));
 
@@ -332,9 +343,9 @@
   g_slist_free (requests);
 }
 
-
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 static void
-new_jingle_session_cb (GabbleJingleFactory *jf,
+new_jingle_session_cb (GabbleJingleMint *jm,
     GabbleJingleSession *sess,
     gpointer data)
 {
@@ -359,7 +370,9 @@
       if (content == NULL)
           return;
 
-      gtalk_fc = gtalk_file_collection_new_from_session (jf, sess);
+      gtalk_fc = gtalk_file_collection_new_from_session (
+          gabble_jingle_mint_get_factory (jm),
+          sess);
 
       if (gtalk_fc)
         {
@@ -376,11 +389,16 @@
               GabbleJingleShareManifestEntry *entry = i->data;
               GabbleFileTransferChannel *channel = NULL;
               gchar *filename = NULL;
+              TpHandleRepoIface *contacts = tp_base_connection_get_handles (
+                  TP_BASE_CONNECTION (self->priv->connection),
+                  TP_HANDLE_TYPE_CONTACT);
+              TpHandle peer = tp_handle_ensure (contacts,
+                  gabble_jingle_session_get_peer_jid (sess), NULL, NULL);
 
               filename = g_strdup_printf ("%s%s",
                   entry->name, entry->folder? ".tar":"");
               channel = gabble_file_transfer_channel_new (self->priv->connection,
-                  sess->peer, sess->peer, TP_FILE_TRANSFER_STATE_PENDING,
+                  peer, peer, TP_FILE_TRANSFER_STATE_PENDING,
                   NULL, filename, entry->size, TP_FILE_HASH_TYPE_NONE, NULL,
                   NULL, 0, 0, FALSE, NULL, gtalk_fc, token, NULL, NULL, NULL);
               g_free (filename);
@@ -401,7 +419,7 @@
         }
     }
 }
-
+#endif
 
 static void
 connection_status_changed_cb (GabbleConnection *conn,
@@ -412,11 +430,13 @@
 
   switch (status)
     {
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
       case TP_CONNECTION_STATUS_CONNECTING:
-        g_signal_connect (self->priv->connection->jingle_factory,
-            "new-session",
+        g_signal_connect (self->priv->connection->jingle_mint,
+            "incoming-session",
             G_CALLBACK (new_jingle_session_cb), self);
         break;
+#endif
 
       case TP_CONNECTION_STATUS_DISCONNECTED:
         ft_manager_close_all (self);
diff -Nru telepathy-gabble-0.15.4/src/google-relay.c telepathy-gabble-0.16.0/src/google-relay.c
--- telepathy-gabble-0.15.4/src/google-relay.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/google-relay.c	2012-03-07 20:26:07.000000000 +0000
@@ -27,8 +27,6 @@
 #include 
 #endif
 
-#include 
-
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
 #ifdef G_OS_WIN32
@@ -52,19 +50,19 @@
   GPtrArray *relays;
   guint component;
   guint requests_to_do;
-  GabbleJingleFactoryRelaySessionCb callback;
+  GabbleJingleInfoRelaySessionCb callback;
   gpointer user_data;
 } RelaySessionData;
 
 static RelaySessionData *
 relay_session_data_new (guint requests_to_do,
-    GabbleJingleFactoryRelaySessionCb callback,
+    GabbleJingleInfoRelaySessionCb callback,
     gpointer user_data)
 {
   RelaySessionData *rsd = g_slice_new0 (RelaySessionData);
 
   rsd->relays = g_ptr_array_sized_new (requests_to_do);
-  g_ptr_array_set_free_func (rsd->relays, (GDestroyNotify) g_hash_table_unref);
+  g_ptr_array_set_free_func (rsd->relays, (GDestroyNotify) gabble_jingle_relay_free);
   rsd->component = 1;
   rsd->requests_to_do = requests_to_do;
   rsd->callback = callback;
@@ -104,17 +102,16 @@
     const gchar *relay_ip,
     const gchar *username,
     const gchar *password,
-    const gchar *static_type,
+    GabbleJingleRelayType relay_type,
     const gchar *port_string,
     guint component)
 {
-  GHashTable *asv;
   guint64 portll;
   guint port;
 
   if (port_string == NULL)
     {
-      DEBUG ("no relay port for %s found", static_type);
+      DEBUG ("no relay port for %u found", relay_type);
       return;
     }
 
@@ -122,31 +119,18 @@
 
   if (portll == 0 || portll > G_MAXUINT16)
     {
-      DEBUG ("failed to parse relay port '%s' for %s", port_string,
-          static_type);
+      DEBUG ("failed to parse relay port '%s' for %u", port_string,
+          relay_type);
       return;
     }
   port = (guint) portll;
 
-  DEBUG ("type=%s ip=%s port=%u username=%s password=%s component=%u",
-      static_type, relay_ip, port, username, password, component);
-  /* keys are static, values are slice-allocated */
-  asv = g_hash_table_new_full (g_str_hash, g_str_equal,
-      NULL, (GDestroyNotify) tp_g_value_slice_free);
-  g_hash_table_insert (asv, "ip",
-      tp_g_value_slice_new_string (relay_ip));
-  g_hash_table_insert (asv, "type",
-      tp_g_value_slice_new_static_string (static_type));
-  g_hash_table_insert (asv, "port",
-      tp_g_value_slice_new_uint (port));
-  g_hash_table_insert (asv, "username",
-      tp_g_value_slice_new_string (username));
-  g_hash_table_insert (asv, "password",
-      tp_g_value_slice_new_string (password));
-  g_hash_table_insert (asv, "component",
-      tp_g_value_slice_new_uint (component));
+  DEBUG ("type=%u ip=%s port=%u username=%s password=%s component=%u",
+      relay_type, relay_ip, port, username, password, component);
 
-  g_ptr_array_add (relays, asv);
+  g_ptr_array_add (relays,
+      gabble_jingle_relay_new (relay_type, relay_ip, port, username, password,
+          component));
 }
 
 static void
@@ -229,11 +213,11 @@
       else
         {
           translate_relay_info (rsd->relays, relay_ip, username, password,
-              "udp", relay_udp_port, rsd->component);
+              GABBLE_JINGLE_RELAY_TYPE_UDP, relay_udp_port, rsd->component);
           translate_relay_info (rsd->relays, relay_ip, username, password,
-              "tcp", relay_tcp_port, rsd->component);
+              GABBLE_JINGLE_RELAY_TYPE_TCP, relay_tcp_port, rsd->component);
           translate_relay_info (rsd->relays, relay_ip, username, password,
-              "tls", relay_ssltcp_port, rsd->component);
+              GABBLE_JINGLE_RELAY_TYPE_TLS, relay_ssltcp_port, rsd->component);
         }
 
       g_strfreev (lines);
@@ -273,7 +257,7 @@
 void
 gabble_google_relay_resolver_destroy (GabbleGoogleRelayResolver *self)
 {
-  tp_clear_object (&self->soup);
+  g_clear_object (&self->soup);
 
   g_slice_free (GabbleGoogleRelayResolver, self);
 }
@@ -284,7 +268,7 @@
     const gchar *server,
     guint16 port,
     const gchar *token,
-    GabbleJingleFactoryRelaySessionCb callback,
+    GabbleJingleInfoRelaySessionCb callback,
     gpointer user_data)
 {
   RelaySessionData *rsd =
diff -Nru telepathy-gabble-0.15.4/src/google-relay.h telepathy-gabble-0.16.0/src/google-relay.h
--- telepathy-gabble-0.15.4/src/google-relay.h	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/src/google-relay.h	2012-03-07 20:26:07.000000000 +0000
@@ -24,7 +24,7 @@
 
 #include 
 
-#include "jingle-factory.h"
+#include "jingle-info.h"
 
 G_BEGIN_DECLS
 
@@ -37,7 +37,7 @@
     const gchar *server,
     guint16 port,
     const gchar *token,
-    GabbleJingleFactoryRelaySessionCb callback,
+    GabbleJingleInfoRelaySessionCb callback,
     gpointer user_data);
 
 G_END_DECLS
diff -Nru telepathy-gabble-0.15.4/src/gtalk-file-collection.c telepathy-gabble-0.16.0/src/gtalk-file-collection.c
--- telepathy-gabble-0.15.4/src/gtalk-file-collection.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/gtalk-file-collection.c	2012-03-07 20:26:07.000000000 +0000
@@ -851,63 +851,25 @@
   ShareChannel *share_channel;
 } GoogleRelaySessionData;
 
+static const NiceRelayType relay_type_map[] = {
+    /* GABBLE_JINGLE_RELAY_TYPE_UDP */ NICE_RELAY_TYPE_TURN_UDP,
+    /* GABBLE_JINGLE_RELAY_TYPE_TCP */ NICE_RELAY_TYPE_TURN_TCP,
+    /* GABBLE_JINGLE_RELAY_TYPE_TLS */ NICE_RELAY_TYPE_TURN_TLS,
+};
+
 static void
 set_relay_info (gpointer item, gpointer user_data)
 {
   GoogleRelaySessionData *data = user_data;
-  GHashTable *relay = item;
-  const gchar *server_ip = NULL;
-  const gchar *username = NULL;
-  const gchar *password = NULL;
-  const gchar *type_str = NULL;
-  guint server_port;
+  GabbleJingleRelay *relay = item;
   NiceRelayType type;
-  GValue *value;
-
-  value = g_hash_table_lookup (relay, "ip");
-  if (value != NULL)
-    server_ip = g_value_get_string (value);
-  else
-    return;
 
-  value = g_hash_table_lookup (relay, "port");
-  if (value != NULL)
-    server_port = g_value_get_uint (value);
-  else
-    return;
-
-  value = g_hash_table_lookup (relay, "username");
-  if (value != NULL)
-    username = g_value_get_string (value);
-  else
-    return;
-
-  value = g_hash_table_lookup (relay, "password");
-  if (value != NULL)
-    password = g_value_get_string (value);
-  else
-    return;
-
-  value = g_hash_table_lookup (relay, "type");
-  if (value != NULL)
-    type_str = g_value_get_string (value);
-  else
-    return;
-
-  if (!strcmp (type_str, "udp"))
-    type = NICE_RELAY_TYPE_TURN_UDP;
-  else if (!strcmp (type_str, "tcp"))
-    type = NICE_RELAY_TYPE_TURN_TCP;
-  else if (!strcmp (type_str, "tls"))
-    type = NICE_RELAY_TYPE_TURN_TLS;
-  else
-    return;
+  g_return_if_fail (relay->type < GABBLE_N_JINGLE_RELAY_TYPES);
+  type = relay_type_map[relay->type];
 
   nice_agent_set_relay_info (data->share_channel->agent,
       data->share_channel->stream_id, data->share_channel->component_id,
-      server_ip, server_port,
-      username, password, type);
-
+      relay->ip, relay->port, relay->username, relay->password, type);
 }
 
 static void
@@ -983,8 +945,9 @@
   nice_agent_attach_recv (agent, stream_id, share_channel->component_id,
       g_main_context_default (), nice_data_received_cb, self);
 
-  if (gabble_jingle_factory_get_stun_server (
-          self->priv->jingle_factory, &stun_server, &stun_port))
+  if (gabble_jingle_info_get_stun_server (
+          gabble_jingle_factory_get_jingle_info (self->priv->jingle_factory),
+          &stun_server, &stun_port))
     {
       g_object_set (agent,
           "stun-server", stun_server,
@@ -998,8 +961,8 @@
   relay_data->share_channel = share_channel;
   g_object_add_weak_pointer (G_OBJECT (relay_data->u.self),
       &relay_data->u.ptr);
-  gabble_jingle_factory_create_google_relay_session (
-      self->priv->jingle_factory, 1,
+  gabble_jingle_info_create_google_relay_session (
+      gabble_jingle_factory_get_jingle_info (self->priv->jingle_factory), 1,
       google_relay_session_cb, relay_data);
 }
 
@@ -1449,7 +1412,7 @@
   self->priv->requested = TRUE;
 
   session = gabble_jingle_factory_create_session (jingle_factory,
-      handle, jid, FALSE);
+      jid, JINGLE_DIALECT_GTALK4, FALSE);
 
   if (session == NULL)
     {
@@ -1457,10 +1420,6 @@
       return NULL;
     }
 
-  g_object_set (session,
-      "dialect", JINGLE_DIALECT_GTALK4,
-      NULL);
-
   content = gabble_jingle_session_add_content (session,
       JINGLE_MEDIA_TYPE_NONE, JINGLE_CONTENT_SENDERS_BOTH, "share",
       NS_GOOGLE_SESSION_SHARE, NS_GOOGLE_TRANSPORT_P2P);
diff -Nru telepathy-gabble-0.15.4/src/jingle-content.c telepathy-gabble-0.16.0/src/jingle-content.c
--- telepathy-gabble-0.15.4/src/jingle-content.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-content.c	2012-03-07 20:26:07.000000000 +0000
@@ -34,7 +34,6 @@
 #include "jingle-transport-google.h"
 #include "jingle-media-rtp.h"
 #include "namespaces.h"
-#include "util.h"
 #include "gabble-signals-marshal.h"
 
 /* signal enum */
@@ -53,8 +52,7 @@
 /* properties */
 enum
 {
-  PROP_CONNECTION = 1,
-  PROP_SESSION,
+  PROP_SESSION = 1,
   PROP_CONTENT_NS,
   PROP_TRANSPORT_NS,
   PROP_NAME,
@@ -119,7 +117,6 @@
   priv->gtalk4_event_id = 0;
   priv->dispose_has_run = FALSE;
 
-  obj->conn = NULL;
   obj->session = NULL;
 }
 
@@ -170,9 +167,6 @@
   GabbleJingleContentPrivate *priv = self->priv;
 
   switch (property_id) {
-    case PROP_CONNECTION:
-      g_value_set_object (value, self->conn);
-      break;
     case PROP_SESSION:
       g_value_set_object (value, self->session);
       break;
@@ -213,9 +207,6 @@
   GabbleJingleContentPrivate *priv = self->priv;
 
   switch (property_id) {
-    case PROP_CONNECTION:
-      self->conn = g_value_get_object (value);
-      break;
     case PROP_SESSION:
       self->session = g_value_get_object (value);
       break;
@@ -233,7 +224,8 @@
       if (priv->transport_ns != NULL)
         {
           GType transport_type = gabble_jingle_factory_lookup_transport (
-              self->conn->jingle_factory, priv->transport_ns);
+              gabble_jingle_session_get_factory (self->session),
+              priv->transport_ns);
 
           g_assert (transport_type != 0);
 
@@ -290,12 +282,6 @@
   cls->get_default_senders = get_default_senders_real;
 
   /* property definitions */
-  param_spec = g_param_spec_object ("connection", "GabbleConnection object",
-      "Gabble connection object used for exchanging messages.",
-      GABBLE_TYPE_CONNECTION,
-      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
-
   param_spec = g_param_spec_object ("session", "GabbleJingleSession object",
       "Jingle session object that owns this content.",
       GABBLE_TYPE_JINGLE_SESSION,
@@ -414,11 +400,11 @@
   if (txt == NULL)
       return JINGLE_CONTENT_SENDERS_NONE;
 
-  if (!tp_strdiff (txt, "initiator"))
+  if (!wocky_strdiff (txt, "initiator"))
       return JINGLE_CONTENT_SENDERS_INITIATOR;
-  else if (!tp_strdiff (txt, "responder"))
+  else if (!wocky_strdiff (txt, "responder"))
       return JINGLE_CONTENT_SENDERS_RESPONDER;
-  else if (!tp_strdiff (txt, "both"))
+  else if (!wocky_strdiff (txt, "both"))
       return JINGLE_CONTENT_SENDERS_BOTH;
 
   return JINGLE_CONTENT_SENDERS_NONE;
@@ -490,7 +476,7 @@
   tnode = wocky_node_add_child_with_content (sess_node, "transport", NULL);
   tnode->ns = g_quark_from_string (priv->transport_ns);
 
-  gabble_jingle_session_send (c->session, msg, NULL, NULL);
+  gabble_jingle_session_send (c->session, msg);
 
   return FALSE;
 }
@@ -536,7 +522,8 @@
           dialect = JINGLE_DIALECT_GTALK3;
           g_object_set (c->session, "dialect", JINGLE_DIALECT_GTALK3, NULL);
           transport_type = gabble_jingle_factory_lookup_transport (
-              c->conn->jingle_factory, "");
+              gabble_jingle_session_get_factory (c->session),
+              "");
 
           /* in practice we do support gtalk-p2p, so this can't happen */
           if (G_UNLIKELY (transport_type == 0))
@@ -551,7 +538,7 @@
   else
     {
       if (creator == NULL &&
-          gabble_jingle_session_peer_has_quirk (c->session,
+          gabble_jingle_session_peer_has_cap (c->session,
               QUIRK_GOOGLE_WEBMAIL_CLIENT))
         {
           if (gabble_jingle_content_creator_is_initiator (c))
@@ -580,7 +567,7 @@
       const gchar *ns = wocky_node_get_ns (trans_node);
 
       transport_type = gabble_jingle_factory_lookup_transport (
-          c->conn->jingle_factory, ns);
+          gabble_jingle_session_get_factory (c->session), ns);
 
       if (transport_type == 0)
         {
@@ -610,7 +597,7 @@
   if (disposition == NULL)
       disposition = "session";
 
-  if (tp_strdiff (disposition, priv->disposition))
+  if (wocky_strdiff (disposition, priv->disposition))
     {
       g_free (priv->disposition);
       priv->disposition = g_strdup (disposition);
@@ -700,7 +687,7 @@
   channel_node->ns = g_quark_from_string (priv->content_ns);
   wocky_node_set_attribute (channel_node, "name", name);
 
-  gabble_jingle_session_send (self->session, msg, NULL, NULL);
+  gabble_jingle_session_send (self->session, msg);
 
   return new_share_channel (self, name);
 }
@@ -719,7 +706,7 @@
   complete_node = wocky_node_add_child_with_content (sess_node, "complete", NULL);
   complete_node->ns = g_quark_from_string (priv->content_ns);
 
-  gabble_jingle_session_send (self->session, msg, NULL, NULL);
+  gabble_jingle_session_send (self->session, msg);
 
 }
 
@@ -995,7 +982,7 @@
       &transport_node);
   gabble_jingle_transport_iface_inject_candidates (priv->transport,
       transport_node);
-  gabble_jingle_session_send (self->session, msg, NULL, NULL);
+  gabble_jingle_session_send (self->session, msg);
 
   priv->state = new_state;
   g_object_notify (G_OBJECT (self), "state");
@@ -1018,7 +1005,7 @@
 
   g_object_get (self->session, "state", &state, NULL);
 
-  if (!tp_strdiff (priv->disposition, "session") &&
+  if (!wocky_strdiff (priv->disposition, "session") &&
       (state < JINGLE_STATE_PENDING_ACCEPT_SENT))
     {
       /* Notify the session that we're ready for
@@ -1063,7 +1050,7 @@
           JINGLE_ACTION_DESCRIPTION_INFO, &sess_node);
 
       gabble_jingle_content_produce_node (self, sess_node, TRUE, FALSE, NULL);
-      gabble_jingle_session_send (self->session, msg, NULL, NULL);
+      gabble_jingle_session_send (self->session, msg);
     }
   else
     {
@@ -1167,7 +1154,7 @@
       msg = gabble_jingle_session_new_message (c->session,
           JINGLE_ACTION_CONTENT_MODIFY, &sess_node);
       gabble_jingle_content_produce_node (c, sess_node, FALSE, FALSE, NULL);
-      gabble_jingle_session_send (c->session, msg, NULL, NULL);
+      gabble_jingle_session_send (c->session, msg);
     }
 
   /* FIXME: actually check whether remote end accepts our content-modify */
@@ -1175,11 +1162,12 @@
 }
 
 static void
-_on_remove_reply (GObject *c_as_obj,
-    gboolean success,
-    WockyStanza *reply)
+_on_remove_reply (
+    GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
 {
-  GabbleJingleContent *c = GABBLE_JINGLE_CONTENT (c_as_obj);
+  GabbleJingleContent *c = GABBLE_JINGLE_CONTENT (user_data);
   GabbleJingleContentPrivate *priv = c->priv;
 
   g_assert (priv->state == JINGLE_CONTENT_STATE_REMOVING);
@@ -1190,6 +1178,7 @@
    * 'removed'.
    */
   g_signal_emit (c, signals[REMOVED], 0);
+  g_object_unref (c);
 }
 
 static void
@@ -1231,8 +1220,9 @@
         }
 
       gabble_jingle_content_produce_node (c, sess_node, FALSE, FALSE, NULL);
-      gabble_jingle_session_send (c->session, msg, _on_remove_reply,
-          (GObject *) c);
+      wocky_porter_send_iq_async (gabble_jingle_session_get_porter (c->session),
+          msg, NULL, _on_remove_reply, g_object_ref (c));
+      g_object_unref (msg);
     }
   else
     {
@@ -1416,32 +1406,3 @@
   else
     gabble_jingle_content_change_direction (self, senders);
 }
-
-
-JingleMediaType
-jingle_media_type_from_tp (TpMediaStreamType type)
-{
-  switch (type)
-    {
-      case TP_MEDIA_STREAM_TYPE_AUDIO:
-        return JINGLE_MEDIA_TYPE_AUDIO;
-      case TP_MEDIA_STREAM_TYPE_VIDEO:
-        return JINGLE_MEDIA_TYPE_VIDEO;
-      default:
-        g_return_val_if_reached (JINGLE_MEDIA_TYPE_NONE);
-    }
-}
-
-TpMediaStreamType
-jingle_media_type_to_tp (JingleMediaType type)
-{
-  switch (type)
-    {
-      case JINGLE_MEDIA_TYPE_AUDIO:
-        return TP_MEDIA_STREAM_TYPE_AUDIO;
-      case JINGLE_MEDIA_TYPE_VIDEO:
-        return TP_MEDIA_STREAM_TYPE_VIDEO;
-      default:
-        g_return_val_if_reached (TP_MEDIA_STREAM_TYPE_AUDIO);
-    }
-}
diff -Nru telepathy-gabble-0.15.4/src/jingle-content.h telepathy-gabble-0.16.0/src/jingle-content.h
--- telepathy-gabble-0.15.4/src/jingle-content.h	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-content.h	2012-03-07 20:26:07.000000000 +0000
@@ -21,9 +21,10 @@
 #define __JINGLE_CONTENT_H__
 
 #include 
-#include "types.h"
+
 #include "jingle-factory.h"
 #include "jingle-transport-iface.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
@@ -95,7 +96,6 @@
     GObject parent;
     GabbleJingleContentPrivate *priv;
 
-    GabbleConnection *conn;
     GabbleJingleSession *session;
 };
 
@@ -159,8 +159,5 @@
 
 void gabble_jingle_content_send_complete (GabbleJingleContent *self);
 
-JingleMediaType jingle_media_type_from_tp (TpMediaStreamType type);
-TpMediaStreamType jingle_media_type_to_tp (JingleMediaType type);
-
 #endif /* __JINGLE_CONTENT_H__ */
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-factory.c telepathy-gabble-0.16.0/src/jingle-factory.c
--- telepathy-gabble-0.15.4/src/jingle-factory.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-factory.c	2012-03-07 20:26:07.000000000 +0000
@@ -22,15 +22,13 @@
 #include "jingle-factory.h"
 
 #include 
-#include 
+#include 
 #include 
 
 #include 
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
-#include "connection.h"
-#include "conn-util.h"
 #include "debug.h"
 #include "gabble-signals-marshal.h"
 #include "jingle-share.h"
@@ -40,7 +38,6 @@
 #include "jingle-transport-rawudp.h"
 #include "jingle-transport-iceudp.h"
 #include "namespaces.h"
-#include "util.h"
 
 #include "google-relay.h"
 
@@ -50,7 +47,7 @@
 enum
 {
     NEW_SESSION,
-    STUN_SERVER_CHANGED,
+    QUERY_CAP,
     LAST_SIGNAL
 };
 
@@ -59,34 +56,22 @@
 /* properties */
 enum
 {
-  PROP_CONNECTION = 1,
+  PROP_SESSION = 1,
   LAST_PROPERTY
 };
 
 struct _GabbleJingleFactoryPrivate
 {
-  GabbleConnection *conn;
+  WockySession *session;
+  WockyPorter *porter;
   guint jingle_handler_id;
-  guint jingle_info_handler_id;
   GHashTable *content_types;
   GHashTable *transports;
 
   /* instances of SESSION_MAP_KEY_FORMAT => GabbleJingleSession. */
   GHashTable *sessions;
 
-  GabbleGoogleRelayResolver *google_resolver;
-
-  gchar *stun_server;
-  guint16 stun_port;
-  gchar *fallback_stun_server;
-  guint16 fallback_stun_port;
-  gchar *relay_token;
-  gboolean get_stun_from_jingle;
-  gchar *relay_server;
-  guint16 relay_http_port;
-  guint16 relay_udp;
-  guint16 relay_tcp;
-  guint16 relay_ssltcp;
+  GabbleJingleInfo *jingle_info;
 
   gboolean dispose_has_run;
 };
@@ -97,30 +82,22 @@
     gpointer user_data);
 static GabbleJingleSession *create_session (GabbleJingleFactory *fac,
     const gchar *sid,
-    TpHandle peer,
     const gchar *jid,
+    JingleDialect dialect,
     gboolean local_hold);
 
+static gboolean session_query_cap_cb (
+    GabbleJingleSession *session,
+    WockyContact *contact,
+    const gchar *cap_or_quirk,
+    gpointer user_data);
 static void session_terminated_cb (GabbleJingleSession *sess,
     gboolean local_terminator,
-    TpChannelGroupChangeReason reason,
+    JingleReason reason,
     const gchar *text,
     GabbleJingleFactory *fac);
 
-static void connection_status_changed_cb (GabbleConnection *conn,
-    guint status, guint reason, GabbleJingleFactory *self);
-static void connection_porter_available_cb (
-    GabbleConnection *conn,
-    WockyPorter *porter,
-    gpointer user_data);
-
-static gboolean test_mode = FALSE;
-
-void
-gabble_jingle_factory_set_test_mode (void)
-{
-  test_mode = TRUE;
-}
+static void attach_to_wocky_session (GabbleJingleFactory *self);
 
 static void
 gabble_jingle_factory_init (GabbleJingleFactory *obj)
@@ -139,300 +116,7 @@
   priv->content_types = g_hash_table_new_full (g_str_hash, g_str_equal,
       NULL, NULL);
 
-  priv->conn = NULL;
   priv->dispose_has_run = FALSE;
-  priv->relay_http_port = 80;
-}
-
-typedef struct {
-    GabbleJingleFactory *factory;
-    gchar *stun_server;
-    guint16 stun_port;
-    gboolean fallback;
-    GCancellable *cancellable;
-} PendingStunServer;
-
-static void
-pending_stun_server_free (gpointer p)
-{
-  PendingStunServer *data = p;
-
-  if (data->factory != NULL)
-    g_object_remove_weak_pointer (G_OBJECT (data->factory),
-        (gpointer)&data->factory);
-
-  g_object_unref (data->cancellable);
-  g_free (data->stun_server);
-  g_slice_free (PendingStunServer, p);
-}
-
-static void
-stun_server_resolved_cb (GObject *resolver,
-                         GAsyncResult *result,
-                         gpointer user_data)
-{
-  PendingStunServer *data = user_data;
-  GabbleJingleFactory *self = data->factory;
-  GError *e = NULL;
-  gchar *stun_server;
-  GList *entries;
-
-  if (self != NULL)
-      g_object_weak_unref (G_OBJECT (self),
-          (GWeakNotify)g_cancellable_cancel, data->cancellable);
-
-  entries = g_resolver_lookup_by_name_finish (
-      G_RESOLVER (resolver), result, &e);
-
-  if (entries == NULL)
-    {
-      DEBUG ("Failed to resolve STUN server %s:%u: %s",
-          data->stun_server, data->stun_port, e->message);
-      g_error_free (e);
-      goto out;
-    }
-
-  stun_server = g_inet_address_to_string (entries->data);
-  g_resolver_free_addresses (entries);
-
-  DEBUG ("Resolved STUN server %s:%u to %s:%u", data->stun_server,
-      data->stun_port, stun_server, data->stun_port);
-
-  if (self == NULL)
-    {
-      g_free (stun_server);
-      goto out;
-    }
-
-  if (data->fallback)
-    {
-      g_free (self->priv->fallback_stun_server);
-      self->priv->fallback_stun_server = stun_server;
-      self->priv->fallback_stun_port = data->stun_port;
-    }
-  else
-    {
-      g_free (self->priv->stun_server);
-      self->priv->stun_server = stun_server;
-      self->priv->stun_port = data->stun_port;
-
-      g_signal_emit (self, signals[STUN_SERVER_CHANGED], 0,
-          stun_server, data->stun_port);
-    }
-
-out:
-  pending_stun_server_free (data);
-  g_object_unref (resolver);
-}
-
-static void
-take_stun_server (GabbleJingleFactory *self,
-                  gchar *stun_server,
-                  guint16 stun_port,
-                  gboolean fallback)
-{
-  GResolver *resolver;
-  PendingStunServer *data;
-
-  if (stun_server == NULL)
-    return;
-
-  resolver = g_resolver_get_default ();
-  data = g_slice_new0 (PendingStunServer);
-
-  DEBUG ("Resolving %s STUN server %s:%u",
-      fallback ? "fallback" : "primary", stun_server, stun_port);
-  data->factory = self;
-  g_object_add_weak_pointer (G_OBJECT (self), (gpointer *) &data->factory);
-  data->stun_server = stun_server;
-  data->stun_port = stun_port;
-  data->fallback = fallback;
-
-  data->cancellable = g_cancellable_new ();
-  g_object_weak_ref (G_OBJECT (self), (GWeakNotify)g_cancellable_cancel,
-      data->cancellable);
-
-  g_resolver_lookup_by_name_async (resolver, stun_server,
-      data->cancellable, stun_server_resolved_cb, data);
-}
-
-
-static void
-got_jingle_info_stanza (
-    GabbleJingleFactory *fac,
-    WockyStanza *stanza)
-{
-  WockyNode *node, *query_node;
-
-  query_node = wocky_node_get_child_ns (
-      wocky_stanza_get_top_node (stanza), "query", NS_GOOGLE_JINGLE_INFO);
-
-  if (query_node == NULL)
-    return;
-
-  if (fac->priv->get_stun_from_jingle)
-    node = wocky_node_get_child (query_node, "stun");
-  else
-    node = NULL;
-
-  if (node != NULL)
-    {
-      node = wocky_node_get_child (node, "server");
-
-      if (node != NULL)
-        {
-          const gchar *server;
-          const gchar *port_attr;
-          guint port = GABBLE_PARAMS_DEFAULT_STUN_PORT;
-
-          server = wocky_node_get_attribute (node, "host");
-          port_attr = wocky_node_get_attribute (node, "udp");
-
-          if (port_attr != NULL)
-            port = atoi (port_attr);
-
-          if (server != NULL && port > 0 && port <= G_MAXUINT16)
-            {
-              DEBUG ("jingle info: got stun server %s, port %u", server,
-                  port);
-              take_stun_server (fac, g_strdup (server), port, FALSE);
-            }
-        }
-    }
-
-#ifdef ENABLE_GOOGLE_RELAY
-  node = wocky_node_get_child (query_node, "relay");
-
-  if (node != NULL)
-    {
-      WockyNode *subnode = wocky_node_get_child (node, "token");
-
-      if (subnode != NULL)
-        {
-          const gchar *token = subnode->content;
-
-          if (token != NULL)
-            {
-              DEBUG ("jingle info: got Google relay token %s", token);
-              g_free (fac->priv->relay_token);
-              fac->priv->relay_token = g_strdup (token);
-            }
-        }
-
-      subnode = wocky_node_get_child (node, "server");
-
-      if (subnode != NULL)
-        {
-          const gchar *server;
-          const gchar *port;
-
-          server = wocky_node_get_attribute (subnode, "host");
-
-          if (server != NULL)
-            {
-              DEBUG ("jingle info: got relay server %s", server);
-              g_free (fac->priv->relay_server);
-              fac->priv->relay_server = g_strdup (server);
-            }
-
-          if (test_mode)
-            {
-              /* this is not part of the real protocol, but we can't listen on
-               * port 80 in an unprivileged regression test */
-              port = wocky_node_get_attribute (subnode,
-                  "gabble-test-http-port");
-
-              if (port != NULL)
-                {
-                  DEBUG ("jingle info: diverting 'Google' HTTP requests to "
-                      "port %s", port);
-                  fac->priv->relay_http_port = atoi (port);
-                }
-            }
-
-          /* FIXME: these are not really actually used anywhere at
-           * the moment, because we get the same info when creating
-           * relay session. */
-          port = wocky_node_get_attribute (subnode, "udp");
-
-          if (port != NULL)
-            {
-              DEBUG ("jingle info: got relay udp port %s", port);
-              fac->priv->relay_udp = atoi (port);
-            }
-
-          port = wocky_node_get_attribute (subnode, "tcp");
-
-          if (port != NULL)
-            {
-              DEBUG ("jingle info: got relay tcp port %s", port);
-              fac->priv->relay_tcp = atoi (port);
-            }
-
-          port = wocky_node_get_attribute (subnode, "tcpssl");
-
-          if (port != NULL)
-            {
-              DEBUG ("jingle info: got relay tcpssl port %s", port);
-              fac->priv->relay_ssltcp = atoi (port);
-            }
-
-        }
-
-    }
-#endif  /* ENABLE_GOOGLE_RELAY */
-}
-
-static gboolean
-jingle_info_cb (
-    WockyPorter *porter,
-    WockyStanza *stanza,
-    gpointer user_data)
-{
-  GabbleJingleFactory *fac = GABBLE_JINGLE_FACTORY (user_data);
-
-  got_jingle_info_stanza (fac, stanza);
-  wocky_porter_acknowledge_iq (porter, stanza, NULL);
-
-  return TRUE;
-}
-
-static void
-jingle_info_reply_cb (
-    GObject *source,
-    GAsyncResult *result,
-    gpointer user_data)
-{
-  GabbleJingleFactory *fac = GABBLE_JINGLE_FACTORY (user_data);
-  WockyStanza *reply = NULL;
-  GError *error = NULL;
-
-  if (conn_util_send_iq_finish (GABBLE_CONNECTION (source), result, &reply,
-          &error))
-    {
-      got_jingle_info_stanza (fac, reply);
-    }
-  else
-    {
-      DEBUG ("jingle info request failed: %s", error->message);
-      g_clear_error (&error);
-    }
-
-  tp_clear_object (&reply);
-}
-
-static void
-jingle_info_send_request (GabbleJingleFactory *fac)
-{
-  GabbleJingleFactoryPrivate *priv = fac->priv;
-  const gchar *jid = conn_util_get_bare_self_jid (priv->conn);
-  WockyStanza *stanza = wocky_stanza_build (
-      WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL, jid,
-      '(', "query", ':', NS_GOOGLE_JINGLE_INFO, ')', NULL);
-
-  conn_util_send_iq_async (priv->conn, stanza, NULL, jingle_info_reply_cb, fac);
-
-  g_object_unref (stanza);
 }
 
 static void
@@ -440,6 +124,8 @@
 {
   GabbleJingleFactory *fac = GABBLE_JINGLE_FACTORY (object);
   GabbleJingleFactoryPrivate *priv = fac->priv;
+  GHashTableIter iter;
+  gpointer val;
 
   if (priv->dispose_has_run)
     return;
@@ -447,14 +133,21 @@
   DEBUG ("dispose called");
   priv->dispose_has_run = TRUE;
 
-  tp_clear_pointer (&priv->google_resolver, gabble_google_relay_resolver_destroy);
-  tp_clear_pointer (&priv->sessions, g_hash_table_unref);
-  tp_clear_pointer (&priv->content_types, g_hash_table_unref);
-  tp_clear_pointer (&priv->transports, g_hash_table_unref);
-  tp_clear_pointer (&priv->stun_server, g_free);
-  tp_clear_pointer (&priv->fallback_stun_server, g_free);
-  tp_clear_pointer (&priv->relay_token, g_free);
-  tp_clear_pointer (&priv->relay_server, g_free);
+  gabble_jingle_factory_stop (fac);
+  g_clear_object (&priv->session);
+  g_clear_object (&priv->porter);
+
+  g_hash_table_iter_init (&iter, priv->sessions);
+  while (g_hash_table_iter_next (&iter, NULL, &val))
+    g_signal_handlers_disconnect_by_func (val, session_query_cap_cb, fac);
+  g_hash_table_unref (priv->sessions);
+  priv->sessions = NULL;
+
+  g_hash_table_unref (priv->content_types);
+  priv->content_types = NULL;
+  g_hash_table_unref (priv->transports);
+  priv->transports = NULL;
+  g_clear_object (&priv->jingle_info);
 
   if (G_OBJECT_CLASS (gabble_jingle_factory_parent_class)->dispose)
     G_OBJECT_CLASS (gabble_jingle_factory_parent_class)->dispose (object);
@@ -470,8 +163,8 @@
   GabbleJingleFactoryPrivate *priv = chan->priv;
 
   switch (property_id) {
-    case PROP_CONNECTION:
-      g_value_set_object (value, priv->conn);
+    case PROP_SESSION:
+      g_value_set_object (value, priv->session);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -489,8 +182,8 @@
   GabbleJingleFactoryPrivate *priv = chan->priv;
 
   switch (property_id) {
-    case PROP_CONNECTION:
-      priv->conn = g_value_get_object (value);
+    case PROP_SESSION:
+      priv->session = g_value_dup_object (value);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -502,16 +195,12 @@
 gabble_jingle_factory_constructed (GObject *obj)
 {
   GabbleJingleFactory *self = GABBLE_JINGLE_FACTORY (obj);
-  GabbleJingleFactoryPrivate *priv = self->priv;
   GObjectClass *parent = G_OBJECT_CLASS (gabble_jingle_factory_parent_class);
 
   if (parent->constructed != NULL)
     parent->constructed (obj);
 
-  gabble_signal_connect_weak (priv->conn, "status-changed",
-      (GCallback) connection_status_changed_cb, G_OBJECT (self));
-  gabble_signal_connect_weak (priv->conn, "porter-available",
-      (GCallback) connection_porter_available_cb, G_OBJECT (self));
+  attach_to_wocky_session (self);
 
   jingle_share_register (self);
   jingle_media_rtp_register (self);
@@ -533,132 +222,96 @@
   object_class->set_property = gabble_jingle_factory_set_property;
   object_class->dispose = gabble_jingle_factory_dispose;
 
-  param_spec = g_param_spec_object ("connection", "GabbleConnection object",
-      "Gabble connection object that uses this Jingle Factory object",
-      GABBLE_TYPE_CONNECTION,
-      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NICK |
-      G_PARAM_STATIC_BLURB);
-  g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+  param_spec = g_param_spec_object ("session", "WockySession object",
+      "WockySession to listen for Jingle sessions on",
+      WOCKY_TYPE_SESSION,
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_SESSION, param_spec);
 
   /* signal definitions */
 
+  /*
+   * @session: a fresh new Jingle session for your listening pleasure
+   * @initiated_locally: %TRUE if this is a new outgoing session; %FALSE if it
+   *  is a new incoming session
+   */
   signals[NEW_SESSION] = g_signal_new ("new-session",
         G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST,
-        0, NULL, NULL, g_cclosure_marshal_VOID__POINTER,
-        G_TYPE_NONE, 1, G_TYPE_POINTER);
+        0, NULL, NULL, gabble_marshal_VOID__OBJECT_BOOL,
+        G_TYPE_NONE, 2, GABBLE_TYPE_JINGLE_SESSION, G_TYPE_BOOLEAN);
 
-  signals[STUN_SERVER_CHANGED] = g_signal_new ("stun-server-changed",
+  /*
+   * @contact: the peer in a call
+   * @cap: the XEP-0115 feature string the session is interested in.
+   *
+   * Emitted when a Jingle session wants to check whether the peer has a
+   * particular capability. The handler should return %TRUE if @contact has
+   * @cap.
+   */
+  signals[QUERY_CAP] = g_signal_new ("query-cap",
         G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST,
-        0, NULL, NULL, gabble_marshal_VOID__STRING_UINT,
-      G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT);
+        0, g_signal_accumulator_first_wins, NULL,
+        gabble_marshal_BOOLEAN__OBJECT_STRING,
+        G_TYPE_BOOLEAN, 2, WOCKY_TYPE_CONTACT, G_TYPE_STRING);
 }
 
-static void
-connection_status_changed_cb (GabbleConnection *conn,
-                              guint status,
-                              guint reason,
-                              GabbleJingleFactory *self)
+GabbleJingleFactory *
+gabble_jingle_factory_new (
+    WockySession *session)
 {
-  GabbleJingleFactoryPrivate *priv = self->priv;
-
-  switch (status)
-    {
-    case TP_CONNECTION_STATUS_CONNECTING:
-      g_assert (priv->conn != NULL);
-      break;
-
-    case TP_CONNECTION_STATUS_CONNECTED:
-        {
-          gchar *stun_server = NULL;
-          guint stun_port = 0;
-
-          g_object_get (priv->conn,
-              "stun-server", &stun_server,
-              "stun-port", &stun_port,
-              NULL);
-
-          if (stun_server == NULL)
-            {
-              self->priv->get_stun_from_jingle = TRUE;
-            }
-          else
-            {
-              take_stun_server (self, stun_server, stun_port, FALSE);
-            }
-
-          g_object_get (priv->conn,
-              "fallback-stun-server", &stun_server,
-              "fallback-stun-port", &stun_port,
-              NULL);
-
-          if (stun_server != NULL)
-            {
-              take_stun_server (self, stun_server, stun_port, TRUE);
-            }
-
-          if (priv->conn->features &
-              GABBLE_CONNECTION_FEATURES_GOOGLE_JINGLE_INFO)
-            {
-              jingle_info_send_request (self);
-            }
-        }
-      break;
-
-    case TP_CONNECTION_STATUS_DISCONNECTED:
-      if (priv->jingle_handler_id != 0)
-        {
-          WockyPorter *p = wocky_session_get_porter (priv->conn->session);
-
-          wocky_porter_unregister_handler (p, priv->jingle_handler_id);
-          wocky_porter_unregister_handler (p, priv->jingle_info_handler_id);
-          priv->jingle_handler_id = 0;
-          priv->jingle_info_handler_id = 0;
-        }
-
-      break;
-    }
+  return g_object_new (GABBLE_TYPE_JINGLE_FACTORY,
+      "session", session,
+      NULL);
 }
 
 static void
-connection_porter_available_cb (
-    GabbleConnection *conn,
-    WockyPorter *porter,
-    gpointer user_data)
+attach_to_wocky_session (GabbleJingleFactory *self)
 {
-  GabbleJingleFactory *self = GABBLE_JINGLE_FACTORY (user_data);
   GabbleJingleFactoryPrivate *priv = self->priv;
 
-  g_assert (priv->jingle_handler_id == 0);
+  g_assert (priv->session != NULL);
+
+  g_assert (priv->porter == NULL);
+  priv->porter = g_object_ref (wocky_session_get_porter (priv->session));
 
   /* TODO: we could match different dialects here maybe? */
-  priv->jingle_handler_id = wocky_porter_register_handler_from_anyone (porter,
+  priv->jingle_handler_id = wocky_porter_register_handler_from_anyone (
+      priv->porter,
       WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET,
       WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, jingle_cb, self,
       NULL);
 
-  priv->jingle_info_handler_id = wocky_c2s_porter_register_handler_from_server (
-      WOCKY_C2S_PORTER (porter),
-      WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET,
-      WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, jingle_info_cb, self,
-      '(', "query", ':', NS_GOOGLE_JINGLE_INFO, ')', NULL);
+  priv->jingle_info = gabble_jingle_info_new (priv->porter);
+}
+
+void
+gabble_jingle_factory_stop (GabbleJingleFactory *self)
+{
+  GabbleJingleFactoryPrivate *priv = self->priv;
+
+  if (priv->porter != NULL &&
+      priv->jingle_handler_id != 0)
+    {
+      wocky_porter_unregister_handler (priv->porter, priv->jingle_handler_id);
+      priv->jingle_handler_id = 0;
+    }
 }
 
 /* The 'session' map is keyed by:
- * "\n\n"
+ * "\n"
  */
-#define SESSION_MAP_KEY_FORMAT "%u\n%s\n%s"
+#define SESSION_MAP_KEY_FORMAT "%s\n%s"
 
 static gchar *
-make_session_map_key (TpHandle peer,
+make_session_map_key (
     const gchar *jid,
     const gchar *sid)
 {
-  return g_strdup_printf (SESSION_MAP_KEY_FORMAT, peer, jid, sid);
+  return g_strdup_printf (SESSION_MAP_KEY_FORMAT, jid, sid);
 }
 
 static gchar *
 get_unique_sid_for (GabbleJingleFactory *factory,
-    TpHandle peer,
     const gchar *jid,
     gchar **key)
 {
@@ -673,7 +326,7 @@
       g_free (sid);
       g_free (key_);
       sid = g_strdup_printf ("%u", val);
-      key_ = make_session_map_key (peer, jid, sid);
+      key_ = make_session_map_key (jid, sid);
     }
   while (g_hash_table_lookup (factory->priv->sessions, key_) != NULL);
 
@@ -691,22 +344,17 @@
     GError **error)
 {
   GabbleJingleFactoryPrivate *priv = self->priv;
-  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   gchar *key;
   GabbleJingleSession *sess;
-  TpHandle peer;
-
-  peer = tp_handle_ensure (contact_repo, from, NULL, error);
 
-  if (peer == 0)
+  if (!wocky_decode_jid (from, NULL, NULL, NULL))
     {
       g_prefix_error (error, "Couldn't parse sender '%s': ", from);
       return NULL;
     }
 
   /* If we can ensure the handle, we can decode the jid */
-  key = make_session_map_key (peer, from, sid);
+  key = make_session_map_key (from, sid);
   sess = g_hash_table_lookup (priv->sessions, key);
   g_free (key);
 
@@ -714,8 +362,7 @@
     {
       if (action == JINGLE_ACTION_SESSION_INITIATE)
         {
-          sess = create_session (self, sid, peer, from, FALSE);
-          g_object_set (sess, "dialect", dialect, NULL);
+          sess = create_session (self, sid, from, dialect, FALSE);
           *new_session = TRUE;
         }
       else
@@ -731,7 +378,6 @@
       *new_session = FALSE;
     }
 
-  tp_handle_unref (contact_repo, peer);
   return sess;
 }
 
@@ -742,7 +388,6 @@
     gpointer user_data)
 {
   GabbleJingleFactory *self = GABBLE_JINGLE_FACTORY (user_data);
-  GabbleJingleFactoryPrivate *priv = self->priv;
   GError *error = NULL;
   const gchar *sid, *from;
   GabbleJingleSession *sess;
@@ -767,19 +412,24 @@
   if (!gabble_jingle_session_parse (sess, action, msg, &error))
     goto REQUEST_ERROR;
 
+  /* This has to be after the call to parse(), not inside create_session():
+   * until the session has parsed the session-initiate stanza, it does not know
+   * about its own contents, and we don't even know if the content types are
+   * something we understand. So it's essentially half-alive and useless to
+   * signal listeners.
+   */
   if (new_session)
-    g_signal_emit (self, signals[NEW_SESSION], 0, sess);
+    g_signal_emit (self, signals[NEW_SESSION], 0, sess, FALSE);
 
   /* all went well, we can acknowledge the IQ */
-  _gabble_connection_acknowledge_set_iq (priv->conn, msg);
+  wocky_porter_acknowledge_iq (porter, msg, NULL);
 
   return TRUE;
 
 REQUEST_ERROR:
   g_assert (error != NULL);
   DEBUG ("NAKing with error: %s", error->message);
-  wocky_porter_send_iq_gerror (wocky_session_get_porter (priv->conn->session),
-      msg, error);
+  wocky_porter_send_iq_gerror (porter, msg, error);
   g_error_free (error);
 
   if (sess != NULL && new_session)
@@ -788,6 +438,25 @@
   return TRUE;
 }
 
+static gboolean
+session_query_cap_cb (
+    GabbleJingleSession *session,
+    WockyContact *contact,
+    const gchar *cap_or_quirk,
+    gpointer user_data)
+{
+  GabbleJingleFactory *self = GABBLE_JINGLE_FACTORY (user_data);
+  gboolean ret;
+
+  /* Propagate the query out to the application. We can't depend on the
+   * application connecting to ::query-cap on the session because caps queries
+   * may happen while parsing the session-initiate stanza, which must happen
+   * before the session is announced to the application.
+   */
+  g_signal_emit (self, signals[QUERY_CAP], 0, contact, cap_or_quirk, &ret);
+  return ret;
+}
+
 /*
  * If sid is set to NULL a unique sid is generated and
  * the "local-initiator" property of the newly created
@@ -796,27 +465,38 @@
 static GabbleJingleSession *
 create_session (GabbleJingleFactory *fac,
     const gchar *sid,
-    TpHandle peer,
     const gchar *jid,
+    JingleDialect dialect,
     gboolean local_hold)
 {
   GabbleJingleFactoryPrivate *priv = fac->priv;
   GabbleJingleSession *sess;
   gboolean local_initiator;
   gchar *sid_, *key;
+  gpointer contact;
+  WockyContactFactory *factory;
 
+  factory = wocky_session_get_contact_factory (priv->session);
   g_assert (jid != NULL);
 
+  if (strchr (jid, '/') != NULL)
+    contact = wocky_contact_factory_ensure_resource_contact (factory, jid);
+  else
+    contact = wocky_contact_factory_ensure_bare_contact (factory, jid);
+
+  g_return_val_if_fail (contact != NULL, NULL);
+  g_return_val_if_fail (WOCKY_IS_CONTACT (contact), NULL);
+
   if (sid != NULL)
     {
-      key = make_session_map_key (peer, jid, sid);
+      key = make_session_map_key (jid, sid);
       sid_ = g_strdup (sid);
 
       local_initiator = FALSE;
     }
   else
     {
-      sid_ = get_unique_sid_for (fac, peer, jid, &key);
+      sid_ = get_unique_sid_for (fac, jid, &key);
 
       local_initiator = TRUE;
     }
@@ -825,8 +505,10 @@
    * get_unique_sid_for should have ensured the key is fresh. */
   g_assert (NULL == g_hash_table_lookup (priv->sessions, key));
 
-  sess = gabble_jingle_session_new (priv->conn, sid_, local_initiator, jid,
-      local_hold);
+  sess = gabble_jingle_session_new (
+      fac,
+      priv->porter,
+      sid_, local_initiator, contact, dialect, local_hold);
   g_signal_connect (sess, "terminated",
     (GCallback) session_terminated_cb, fac);
 
@@ -836,17 +518,24 @@
   DEBUG ("new session (%s, %s) @ %p", jid, sid_, sess);
 
   g_free (sid_);
+  g_object_unref (contact);
+
+  g_signal_connect (sess, "query-cap",
+      (GCallback) session_query_cap_cb, (GObject *) fac);
 
   return sess;
 }
 
 GabbleJingleSession *
 gabble_jingle_factory_create_session (GabbleJingleFactory *fac,
-    TpHandle peer,
     const gchar *jid,
+    JingleDialect dialect,
     gboolean local_hold)
 {
-  return create_session (fac, NULL, peer, jid, local_hold);
+  GabbleJingleSession *session = create_session (fac, NULL, jid, dialect, local_hold);
+
+  g_signal_emit (fac, signals[NEW_SESSION], 0, session, TRUE);
+  return session;
 }
 
 void
@@ -890,74 +579,26 @@
 
 static void
 session_terminated_cb (GabbleJingleSession *session,
-                       gboolean local_terminator,
-                       TpChannelGroupChangeReason reason,
-                       const gchar *text,
+                       gboolean local_terminator G_GNUC_UNUSED,
+                       JingleReason reason G_GNUC_UNUSED,
+                       const gchar *text G_GNUC_UNUSED,
                        GabbleJingleFactory *factory)
 {
-  gchar *key = make_session_map_key (session->peer,
+  gchar *key = make_session_map_key (
       gabble_jingle_session_get_peer_jid (session),
       gabble_jingle_session_get_sid (session));
 
   DEBUG ("removing terminated session with key %s", key);
 
+  g_signal_handlers_disconnect_by_func (session, session_query_cap_cb, factory);
   g_warn_if_fail (g_hash_table_remove (factory->priv->sessions, key));
 
   g_free (key);
 }
 
-const gchar *
-gabble_jingle_factory_get_google_relay_token (GabbleJingleFactory *self)
-{
-  return self->priv->relay_token;
-}
-
-gboolean
-gabble_jingle_factory_get_stun_server (GabbleJingleFactory *self,
-                                       gchar **stun_server,
-                                       guint *stun_port)
-{
-  if (self->priv->stun_server == NULL || self->priv->stun_port == 0)
-    {
-      if (self->priv->fallback_stun_server == NULL ||
-          self->priv->fallback_stun_port == 0)
-        return FALSE;
-
-      if (stun_server != NULL)
-        *stun_server = g_strdup (self->priv->fallback_stun_server);
-
-      if (stun_port != NULL)
-        *stun_port = self->priv->fallback_stun_port;
-
-      return TRUE;
-    }
-
-  if (stun_server != NULL)
-    *stun_server = g_strdup (self->priv->stun_server);
-
-  if (stun_port != NULL)
-    *stun_port = self->priv->stun_port;
-
-  return TRUE;
-}
-
-void
-gabble_jingle_factory_create_google_relay_session (
-    GabbleJingleFactory *fac,
-    guint components,
-    GabbleJingleFactoryRelaySessionCb callback,
-    gpointer user_data)
+GabbleJingleInfo *
+gabble_jingle_factory_get_jingle_info (
+    GabbleJingleFactory *self)
 {
-  GabbleJingleFactoryPrivate *priv = fac->priv;
-
-  g_return_if_fail (callback != NULL);
-
-  if (priv->google_resolver == NULL)
-    {
-      priv->google_resolver = gabble_google_relay_resolver_new ();
-    }
-
-  gabble_google_relay_resolver_resolve (priv->google_resolver,
-      components, priv->relay_server, priv->relay_http_port, priv->relay_token,
-      callback, user_data);
+  return self->priv->jingle_info;
 }
diff -Nru telepathy-gabble-0.15.4/src/jingle-factory.h telepathy-gabble-0.16.0/src/jingle-factory.h
--- telepathy-gabble-0.15.4/src/jingle-factory.h	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-factory.h	2012-03-07 20:26:07.000000000 +0000
@@ -22,102 +22,11 @@
 
 #include 
 
-#include "types.h"
+#include "jingle-info.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
-typedef enum { /*< skip >*/
-  /* not a jingle message */
-  JINGLE_DIALECT_ERROR,
-  /* old libjingle3 gtalk variant */
-  JINGLE_DIALECT_GTALK3,
-  /* new gtalk variant */
-  JINGLE_DIALECT_GTALK4,
-  /* jingle in the old 0.15 version days */
-  JINGLE_DIALECT_V015,
-  /* current jingle standard */
-  JINGLE_DIALECT_V032
-} JingleDialect;
-
-#define JINGLE_IS_GOOGLE_DIALECT(d)\
-    ((d == JINGLE_DIALECT_GTALK3) || (d == JINGLE_DIALECT_GTALK4))
-
-typedef enum { /*< skip >*/
-  JINGLE_STATE_INVALID = -1,
-  JINGLE_STATE_PENDING_CREATED = 0,
-  JINGLE_STATE_PENDING_INITIATE_SENT,
-  JINGLE_STATE_PENDING_INITIATED,
-  JINGLE_STATE_PENDING_ACCEPT_SENT,
-  JINGLE_STATE_ACTIVE,
-  JINGLE_STATE_ENDED,
-  MAX_JINGLE_STATES
-} JingleState;
-
-typedef enum { /*< skip >*/
-  JINGLE_ACTION_UNKNOWN,
-  JINGLE_ACTION_CONTENT_ACCEPT,
-  JINGLE_ACTION_CONTENT_ADD,
-  JINGLE_ACTION_CONTENT_MODIFY,
-  JINGLE_ACTION_CONTENT_REMOVE,
-  JINGLE_ACTION_CONTENT_REPLACE,
-  JINGLE_ACTION_CONTENT_REJECT,
-  JINGLE_ACTION_SESSION_ACCEPT,
-  JINGLE_ACTION_SESSION_INFO,
-  JINGLE_ACTION_SESSION_INITIATE,
-  JINGLE_ACTION_SESSION_TERMINATE,
-  JINGLE_ACTION_TRANSPORT_INFO,
-  JINGLE_ACTION_TRANSPORT_ACCEPT,
-  JINGLE_ACTION_DESCRIPTION_INFO,
-  JINGLE_ACTION_INFO
-} JingleAction;
-
-typedef enum { /*< skip >*/
-  JINGLE_CONTENT_SENDERS_NONE,
-  JINGLE_CONTENT_SENDERS_INITIATOR,
-  JINGLE_CONTENT_SENDERS_RESPONDER,
-  JINGLE_CONTENT_SENDERS_BOTH
-} JingleContentSenders;
-
-typedef enum { /*< skip >*/
-  JINGLE_TRANSPORT_UNKNOWN,
-  JINGLE_TRANSPORT_GOOGLE_P2P,
-  JINGLE_TRANSPORT_RAW_UDP,
-  JINGLE_TRANSPORT_ICE_UDP,
-} JingleTransportType;
-
-typedef enum { /*< skip >*/
-  JINGLE_TRANSPORT_PROTOCOL_UDP,
-  JINGLE_TRANSPORT_PROTOCOL_TCP
-} JingleTransportProtocol;
-
-typedef enum { /*< skip >*/
-  JINGLE_CANDIDATE_TYPE_LOCAL,
-  JINGLE_CANDIDATE_TYPE_STUN,
-  JINGLE_CANDIDATE_TYPE_RELAY
-} JingleCandidateType;
-
-typedef enum
-{
-  JINGLE_REASON_UNKNOWN,
-  JINGLE_REASON_ALTERNATIVE_SESSION,
-  JINGLE_REASON_BUSY,
-  JINGLE_REASON_CANCEL,
-  JINGLE_REASON_CONNECTIVITY_ERROR,
-  JINGLE_REASON_DECLINE,
-  JINGLE_REASON_EXPIRED,
-  JINGLE_REASON_FAILED_APPLICATION,
-  JINGLE_REASON_FAILED_TRANSPORT,
-  JINGLE_REASON_GENERAL_ERROR,
-  JINGLE_REASON_GONE,
-  JINGLE_REASON_INCOMPATIBLE_PARAMETERS,
-  JINGLE_REASON_MEDIA_ERROR,
-  JINGLE_REASON_SECURITY_ERROR,
-  JINGLE_REASON_SUCCESS,
-  JINGLE_REASON_TIMEOUT,
-  JINGLE_REASON_UNSUPPORTED_APPLICATIONS,
-  JINGLE_REASON_UNSUPPORTED_TRANSPORTS
-} JingleReason;
-
 typedef struct _GabbleJingleFactoryClass GabbleJingleFactoryClass;
 
 GType gabble_jingle_factory_get_type (void);
@@ -151,6 +60,11 @@
     GabbleJingleFactoryPrivate *priv;
 };
 
+GabbleJingleFactory *gabble_jingle_factory_new (
+    WockySession *session);
+
+void gabble_jingle_factory_stop (GabbleJingleFactory *self);
+
 void gabble_jingle_factory_register_content_type (GabbleJingleFactory *self,
     gchar *xmlns, GType content_type);
 GType gabble_jingle_factory_lookup_content_type (GabbleJingleFactory *self,
@@ -161,28 +75,14 @@
 GType gabble_jingle_factory_lookup_transport (GabbleJingleFactory *self,
     const gchar *xmlns);
 
-void _jingle_factory_unregister_session (GabbleJingleFactory *factory,
-    const gchar *sid);
-
 GabbleJingleSession *gabble_jingle_factory_create_session (
     GabbleJingleFactory *fac,
-    TpHandle peer,
     const gchar *jid,
+    JingleDialect dialect,
     gboolean local_hold);
 
-typedef void (*GabbleJingleFactoryRelaySessionCb) (GPtrArray *relays,
-    gpointer user_data);
-void gabble_jingle_factory_create_google_relay_session (
-    GabbleJingleFactory *self, guint components,
-    GabbleJingleFactoryRelaySessionCb callback, gpointer user_data);
-
-const gchar *gabble_jingle_factory_get_google_relay_token (
-    GabbleJingleFactory *self);
-
-gboolean gabble_jingle_factory_get_stun_server (GabbleJingleFactory *self,
-    gchar **stun_server, guint *stun_port);
-
-void gabble_jingle_factory_set_test_mode (void);
+GabbleJingleInfo *gabble_jingle_factory_get_jingle_info (
+    GabbleJingleFactory *fac);
 
 G_END_DECLS;
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-info.c telepathy-gabble-0.16.0/src/jingle-info.c
--- telepathy-gabble-0.15.4/src/jingle-info.c	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-info.c	2012-03-07 20:26:07.000000000 +0000
@@ -0,0 +1,599 @@
+/*
+ * jingle-info.c - exciting times with Google's jingleinfo extension
+ * Copyright © 2008–2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "jingle-info.h"
+
+#include 
+#include 
+
+#define DEBUG_FLAG GABBLE_DEBUG_MEDIA
+#include "debug.h"
+#include "google-relay.h"
+#include "gabble-signals-marshal.h"
+#include "namespaces.h"
+
+static gboolean jingle_info_cb (
+    WockyPorter *porter,
+    WockyStanza *stanza,
+    gpointer user_data);
+
+struct _GabbleJingleInfoPrivate {
+    WockyPorter *porter;
+    guint jingle_info_handler_id;
+
+    GabbleGoogleRelayResolver *google_resolver;
+
+    gchar *stun_server;
+    guint16 stun_port;
+    gchar *fallback_stun_server;
+    guint16 fallback_stun_port;
+    gchar *relay_token;
+
+    /* TRUE if the user has not explicitly specified a STUN server, and hence
+     * we should ask the XMPP server for one; FALSE if not.
+     */
+    gboolean get_stun_from_jingle;
+
+    gchar *relay_server;
+    guint16 relay_http_port;
+    guint16 relay_udp;
+    guint16 relay_tcp;
+    guint16 relay_ssltcp;
+
+};
+
+enum {
+    PROP_PORTER = 1,
+};
+
+enum {
+    STUN_SERVER_CHANGED = 0,
+    N_SIGNALS
+};
+
+static guint signals[N_SIGNALS];
+
+static gboolean test_mode = FALSE;
+
+void
+gabble_jingle_info_set_test_mode (void)
+{
+  test_mode = TRUE;
+}
+
+G_DEFINE_TYPE (GabbleJingleInfo, gabble_jingle_info, G_TYPE_OBJECT)
+
+static void
+gabble_jingle_info_init (GabbleJingleInfo *self)
+{
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GABBLE_TYPE_JINGLE_INFO,
+      GabbleJingleInfoPrivate);
+
+  self->priv->relay_http_port = 80;
+  self->priv->get_stun_from_jingle = TRUE;
+}
+
+static void
+gabble_jingle_info_get_property (
+    GObject *object,
+    guint property_id,
+    GValue *value,
+    GParamSpec *pspec)
+{
+  GabbleJingleInfo *self = GABBLE_JINGLE_INFO (object);
+  GabbleJingleInfoPrivate *priv = self->priv;
+
+  switch (property_id)
+    {
+      case PROP_PORTER:
+        g_value_set_object (value, priv->porter);
+        break;
+
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+gabble_jingle_info_set_property (
+    GObject *object,
+    guint property_id,
+    const GValue *value,
+    GParamSpec *pspec)
+{
+  GabbleJingleInfo *self = GABBLE_JINGLE_INFO (object);
+  GabbleJingleInfoPrivate *priv = self->priv;
+
+  switch (property_id)
+    {
+      case PROP_PORTER:
+        g_assert (priv->porter == NULL);
+        priv->porter = g_value_dup_object (value);
+        break;
+
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+gabble_jingle_info_constructed (GObject *object)
+{
+  GabbleJingleInfo *self = GABBLE_JINGLE_INFO (object);
+  GabbleJingleInfoPrivate *priv = self->priv;
+  GObjectClass *parent_class = gabble_jingle_info_parent_class;
+
+  if (parent_class->constructed != NULL)
+    parent_class->constructed (object);
+
+  g_assert (priv->porter != NULL);
+  priv->jingle_info_handler_id = wocky_c2s_porter_register_handler_from_server (
+      WOCKY_C2S_PORTER (priv->porter),
+      WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET,
+      WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, jingle_info_cb, self,
+      '(', "query", ':', NS_GOOGLE_JINGLE_INFO, ')', NULL);
+}
+
+static void
+gabble_jingle_info_dispose (GObject *object)
+{
+  GabbleJingleInfo *self = GABBLE_JINGLE_INFO (object);
+  GabbleJingleInfoPrivate *priv = self->priv;
+  GObjectClass *parent_class = gabble_jingle_info_parent_class;
+
+  if (priv->porter != NULL)
+    {
+      g_assert (priv->jingle_info_handler_id != 0);
+      wocky_porter_unregister_handler (priv->porter, priv->jingle_info_handler_id);
+      g_clear_object (&priv->porter);
+    }
+
+  if (priv->google_resolver != NULL)
+    {
+      gabble_google_relay_resolver_destroy (priv->google_resolver);
+      priv->google_resolver = NULL;
+    }
+
+  g_free (priv->stun_server);
+  priv->stun_server = NULL;
+  g_free (priv->fallback_stun_server);
+  priv->fallback_stun_server = NULL;
+  g_free (priv->relay_token);
+  priv->relay_token = NULL;
+  g_free (priv->relay_server);
+  priv->relay_server = NULL;
+
+  if (parent_class->dispose != NULL)
+    parent_class->dispose (object);
+}
+
+static void
+gabble_jingle_info_class_init (GabbleJingleInfoClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GParamSpec *param_spec;
+
+  object_class->get_property = gabble_jingle_info_get_property;
+  object_class->set_property = gabble_jingle_info_set_property;
+  object_class->constructed = gabble_jingle_info_constructed;
+  object_class->dispose = gabble_jingle_info_dispose;
+
+  g_type_class_add_private (klass, sizeof (GabbleJingleInfoPrivate));
+
+  param_spec = g_param_spec_object ("porter", "WockyC2SPorter",
+      "Porter for the current connection",
+      WOCKY_TYPE_C2S_PORTER,
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_PORTER, param_spec);
+
+  signals[STUN_SERVER_CHANGED] = g_signal_new ("stun-server-changed",
+      G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST,
+      0, NULL, NULL, gabble_marshal_VOID__STRING_UINT,
+      G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT);
+}
+
+GabbleJingleInfo *
+gabble_jingle_info_new (
+    WockyPorter *porter)
+{
+  return g_object_new (GABBLE_TYPE_JINGLE_INFO,
+      "porter", porter,
+      NULL);
+}
+
+typedef struct {
+    GabbleJingleInfo *factory;
+    gchar *stun_server;
+    guint16 stun_port;
+    gboolean fallback;
+    GCancellable *cancellable;
+} PendingStunServer;
+
+static void
+pending_stun_server_free (gpointer p)
+{
+  PendingStunServer *data = p;
+
+  if (data->factory != NULL)
+    g_object_remove_weak_pointer (G_OBJECT (data->factory),
+        (gpointer)&data->factory);
+
+  g_object_unref (data->cancellable);
+  g_free (data->stun_server);
+  g_slice_free (PendingStunServer, p);
+}
+
+static void
+stun_server_resolved_cb (GObject *resolver,
+                         GAsyncResult *result,
+                         gpointer user_data)
+{
+  PendingStunServer *data = user_data;
+  GabbleJingleInfo *self = data->factory;
+  GError *e = NULL;
+  gchar *stun_server;
+  GList *entries;
+
+  if (self != NULL)
+      g_object_weak_unref (G_OBJECT (self),
+          (GWeakNotify)g_cancellable_cancel, data->cancellable);
+
+  entries = g_resolver_lookup_by_name_finish (
+      G_RESOLVER (resolver), result, &e);
+
+  if (entries == NULL)
+    {
+      DEBUG ("Failed to resolve STUN server %s:%u: %s",
+          data->stun_server, data->stun_port, e->message);
+      g_error_free (e);
+      goto out;
+    }
+
+  stun_server = g_inet_address_to_string (entries->data);
+  g_resolver_free_addresses (entries);
+
+  DEBUG ("Resolved STUN server %s:%u to %s:%u", data->stun_server,
+      data->stun_port, stun_server, data->stun_port);
+
+  if (self == NULL)
+    {
+      g_free (stun_server);
+      goto out;
+    }
+
+  if (data->fallback)
+    {
+      g_free (self->priv->fallback_stun_server);
+      self->priv->fallback_stun_server = stun_server;
+      self->priv->fallback_stun_port = data->stun_port;
+    }
+  else
+    {
+      g_free (self->priv->stun_server);
+      self->priv->stun_server = stun_server;
+      self->priv->stun_port = data->stun_port;
+
+      g_signal_emit (self, signals[STUN_SERVER_CHANGED], 0,
+          stun_server, data->stun_port);
+    }
+
+out:
+  pending_stun_server_free (data);
+  g_object_unref (resolver);
+}
+
+void
+gabble_jingle_info_take_stun_server (
+    GabbleJingleInfo *self,
+    gchar *stun_server,
+    guint16 stun_port,
+    gboolean is_fallback)
+{
+  GResolver *resolver;
+  PendingStunServer *data;
+
+  if (stun_server == NULL)
+    return;
+
+  if (!is_fallback)
+    self->priv->get_stun_from_jingle = FALSE;
+
+  resolver = g_resolver_get_default ();
+  data = g_slice_new0 (PendingStunServer);
+
+  DEBUG ("Resolving %s STUN server %s:%u",
+      is_fallback ? "fallback" : "primary", stun_server, stun_port);
+  data->factory = self;
+  g_object_add_weak_pointer (G_OBJECT (self), (gpointer *) &data->factory);
+  data->stun_server = stun_server;
+  data->stun_port = stun_port;
+  data->fallback = is_fallback;
+
+  data->cancellable = g_cancellable_new ();
+  g_object_weak_ref (G_OBJECT (self), (GWeakNotify)g_cancellable_cancel,
+      data->cancellable);
+
+  g_resolver_lookup_by_name_async (resolver, stun_server,
+      data->cancellable, stun_server_resolved_cb, data);
+}
+
+static void
+got_jingle_info_stanza (
+    GabbleJingleInfo *self,
+    WockyStanza *stanza)
+{
+  WockyNode *node, *query_node;
+
+  query_node = wocky_node_get_child_ns (
+      wocky_stanza_get_top_node (stanza), "query", NS_GOOGLE_JINGLE_INFO);
+
+  if (query_node == NULL)
+    return;
+
+  if (self->priv->get_stun_from_jingle)
+    node = wocky_node_get_child (query_node, "stun");
+  else
+    node = NULL;
+
+  if (node != NULL)
+    {
+      node = wocky_node_get_child (node, "server");
+
+      if (node != NULL)
+        {
+          const gchar *server;
+          const gchar *port_attr;
+          guint port = 0;
+
+          server = wocky_node_get_attribute (node, "host");
+          port_attr = wocky_node_get_attribute (node, "udp");
+
+          if (port_attr != NULL)
+            port = atoi (port_attr);
+
+          if (server != NULL &&
+              port_attr != NULL && port > 0 && port <= G_MAXUINT16)
+            {
+              DEBUG ("jingle info: got stun server %s, port %u", server,
+                  port);
+              gabble_jingle_info_take_stun_server (self,
+                  g_strdup (server), port, FALSE);
+            }
+        }
+    }
+
+#ifdef ENABLE_GOOGLE_RELAY
+  node = wocky_node_get_child (query_node, "relay");
+
+  if (node != NULL)
+    {
+      WockyNode *subnode = wocky_node_get_child (node, "token");
+
+      if (subnode != NULL)
+        {
+          const gchar *token = subnode->content;
+
+          if (token != NULL)
+            {
+              DEBUG ("jingle info: got Google relay token %s", token);
+              g_free (self->priv->relay_token);
+              self->priv->relay_token = g_strdup (token);
+            }
+        }
+
+      subnode = wocky_node_get_child (node, "server");
+
+      if (subnode != NULL)
+        {
+          const gchar *server;
+          const gchar *port;
+
+          server = wocky_node_get_attribute (subnode, "host");
+
+          if (server != NULL)
+            {
+              DEBUG ("jingle info: got relay server %s", server);
+              g_free (self->priv->relay_server);
+              self->priv->relay_server = g_strdup (server);
+            }
+
+          if (test_mode)
+            {
+              /* this is not part of the real protocol, but we can't listen on
+               * port 80 in an unprivileged regression test */
+              port = wocky_node_get_attribute (subnode,
+                  "gabble-test-http-port");
+
+              if (port != NULL)
+                {
+                  DEBUG ("jingle info: diverting 'Google' HTTP requests to "
+                      "port %s", port);
+                  self->priv->relay_http_port = atoi (port);
+                }
+            }
+
+          /* FIXME: these are not really actually used anywhere at
+           * the moment, because we get the same info when creating
+           * relay session. */
+          port = wocky_node_get_attribute (subnode, "udp");
+
+          if (port != NULL)
+            {
+              DEBUG ("jingle info: got relay udp port %s", port);
+              self->priv->relay_udp = atoi (port);
+            }
+
+          port = wocky_node_get_attribute (subnode, "tcp");
+
+          if (port != NULL)
+            {
+              DEBUG ("jingle info: got relay tcp port %s", port);
+              self->priv->relay_tcp = atoi (port);
+            }
+
+          port = wocky_node_get_attribute (subnode, "tcpssl");
+
+          if (port != NULL)
+            {
+              DEBUG ("jingle info: got relay tcpssl port %s", port);
+              self->priv->relay_ssltcp = atoi (port);
+            }
+
+        }
+
+    }
+#endif  /* ENABLE_GOOGLE_RELAY */
+}
+
+static gboolean
+jingle_info_cb (
+    WockyPorter *porter,
+    WockyStanza *stanza,
+    gpointer user_data)
+{
+  GabbleJingleInfo *self = GABBLE_JINGLE_INFO (user_data);
+
+  got_jingle_info_stanza (self, stanza);
+  wocky_porter_acknowledge_iq (porter, stanza, NULL);
+
+  return TRUE;
+}
+
+static void
+jingle_info_reply_cb (
+    GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  WockyPorter *porter = WOCKY_PORTER (source);
+  GabbleJingleInfo *self = GABBLE_JINGLE_INFO (user_data);
+  WockyStanza *reply = NULL;
+  GError *error = NULL;
+
+  reply = wocky_porter_send_iq_finish (porter, result, &error);
+  if (reply != NULL &&
+      !wocky_stanza_extract_errors (reply, NULL, &error, NULL, NULL))
+    {
+      got_jingle_info_stanza (self, reply);
+    }
+  else
+    {
+      DEBUG ("jingle info request failed: %s", error->message);
+      g_clear_error (&error);
+    }
+
+  g_clear_object (&reply);
+  g_object_unref (self);
+}
+
+void
+gabble_jingle_info_send_request (GabbleJingleInfo *self)
+{
+  GabbleJingleInfoPrivate *priv = self->priv;
+  WockyStanza *stanza = wocky_stanza_build (
+      WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_GET, NULL,
+      wocky_porter_get_bare_jid (priv->porter),
+      '(', "query", ':', NS_GOOGLE_JINGLE_INFO, ')', NULL);
+
+  wocky_porter_send_iq_async (priv->porter, stanza, NULL, jingle_info_reply_cb,
+      g_object_ref (self));
+  g_object_unref (stanza);
+}
+
+gboolean
+gabble_jingle_info_get_stun_server (
+    GabbleJingleInfo *self,
+    gchar **stun_server,
+    guint *stun_port)
+{
+  if (self->priv->stun_server == NULL || self->priv->stun_port == 0)
+    {
+      if (self->priv->fallback_stun_server == NULL ||
+          self->priv->fallback_stun_port == 0)
+        return FALSE;
+
+      if (stun_server != NULL)
+        *stun_server = g_strdup (self->priv->fallback_stun_server);
+
+      if (stun_port != NULL)
+        *stun_port = self->priv->fallback_stun_port;
+
+      return TRUE;
+    }
+
+  if (stun_server != NULL)
+    *stun_server = g_strdup (self->priv->stun_server);
+
+  if (stun_port != NULL)
+    *stun_port = self->priv->stun_port;
+
+  return TRUE;
+}
+
+const gchar *
+gabble_jingle_info_get_google_relay_token (
+    GabbleJingleInfo *self)
+{
+  return self->priv->relay_token;
+}
+
+GabbleJingleRelay *
+gabble_jingle_relay_new (
+    GabbleJingleRelayType type,
+    const gchar *ip,
+    guint port,
+    const gchar *username,
+    const gchar *password,
+    guint component)
+{
+  GabbleJingleRelay ret = { type, g_strdup (ip), port, g_strdup (username),
+      g_strdup (password), component };
+
+  return g_slice_dup (GabbleJingleRelay, &ret);
+}
+
+void
+gabble_jingle_relay_free (GabbleJingleRelay *relay)
+{
+  g_free (relay->ip);
+  g_free (relay->username);
+  g_free (relay->password);
+  g_slice_free (GabbleJingleRelay, relay);
+}
+
+void
+gabble_jingle_info_create_google_relay_session (
+    GabbleJingleInfo *self,
+    guint components,
+    GabbleJingleInfoRelaySessionCb callback,
+    gpointer user_data)
+{
+  GabbleJingleInfoPrivate *priv = self->priv;
+
+  g_return_if_fail (callback != NULL);
+
+  if (priv->google_resolver == NULL)
+    {
+      priv->google_resolver = gabble_google_relay_resolver_new ();
+    }
+
+  gabble_google_relay_resolver_resolve (priv->google_resolver,
+      components, priv->relay_server, priv->relay_http_port, priv->relay_token,
+      callback, user_data);
+}
diff -Nru telepathy-gabble-0.15.4/src/jingle-info.h telepathy-gabble-0.16.0/src/jingle-info.h
--- telepathy-gabble-0.15.4/src/jingle-info.h	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-info.h	2012-03-07 20:26:07.000000000 +0000
@@ -0,0 +1,116 @@
+/*
+ * jingle-info.h - exciting times with Google's jingleinfo extension
+ * Copyright © 2008–2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef GABBLE_JINGLE_INFO_H
+#define GABBLE_JINGLE_INFO_H
+
+#include 
+#include 
+
+typedef struct _GabbleJingleInfo GabbleJingleInfo;
+typedef struct _GabbleJingleInfoClass GabbleJingleInfoClass;
+typedef struct _GabbleJingleInfoPrivate GabbleJingleInfoPrivate;
+
+struct _GabbleJingleInfoClass {
+    GObjectClass parent_class;
+};
+
+struct _GabbleJingleInfo {
+    GObject parent;
+
+    GabbleJingleInfoPrivate *priv;
+};
+
+GType gabble_jingle_info_get_type (void);
+
+GabbleJingleInfo *gabble_jingle_info_new (
+    WockyPorter *porter);
+
+void gabble_jingle_info_take_stun_server (
+    GabbleJingleInfo *self,
+    gchar *stun_server,
+    guint16 stun_port,
+    gboolean is_fallback);
+void gabble_jingle_info_send_request (GabbleJingleInfo *self);
+
+gboolean gabble_jingle_info_get_stun_server (
+    GabbleJingleInfo *self,
+    gchar **stun_server,
+    guint *stun_port);
+
+const gchar *gabble_jingle_info_get_google_relay_token (
+    GabbleJingleInfo *self);
+
+typedef enum {
+    GABBLE_JINGLE_RELAY_TYPE_UDP,
+    GABBLE_JINGLE_RELAY_TYPE_TCP,
+    GABBLE_JINGLE_RELAY_TYPE_TLS
+} GabbleJingleRelayType;
+#define GABBLE_N_JINGLE_RELAY_TYPES 3
+
+typedef struct {
+    GabbleJingleRelayType type;
+    gchar *ip;
+    guint port;
+    gchar *username;
+    gchar *password;
+    guint component;
+} GabbleJingleRelay;
+
+GabbleJingleRelay *gabble_jingle_relay_new (
+    GabbleJingleRelayType type,
+    const gchar *ip,
+    guint port,
+    const gchar *username,
+    const gchar *password,
+    guint component);
+void gabble_jingle_relay_free (GabbleJingleRelay *relay);
+
+/*
+ * @relays: (element-type GabbleJingleRelay) (transfer none): a possibly-empty
+ *  array of GabbleJingleRelay structs.
+ */
+typedef void (*GabbleJingleInfoRelaySessionCb) (
+    GPtrArray *relays,
+    gpointer user_data);
+void gabble_jingle_info_create_google_relay_session (
+    GabbleJingleInfo *self,
+    guint components,
+    GabbleJingleInfoRelaySessionCb callback,
+    gpointer user_data);
+
+void gabble_jingle_info_set_test_mode (void);
+
+/* TYPE MACROS */
+#define GABBLE_TYPE_JINGLE_INFO \
+  (gabble_jingle_info_get_type ())
+#define GABBLE_JINGLE_INFO(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_JINGLE_INFO, GabbleJingleInfo))
+#define GABBLE_JINGLE_INFO_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_JINGLE_INFO,\
+                           GabbleJingleInfoClass))
+#define GABBLE_IS_JINGLE_INFO(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_JINGLE_INFO))
+#define GABBLE_IS_JINGLE_INFO_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_JINGLE_INFO))
+#define GABBLE_JINGLE_INFO_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_JINGLE_INFO, \
+                              GabbleJingleInfoClass))
+
+#endif /* GABBLE_JINGLE_INFO_H */
diff -Nru telepathy-gabble-0.15.4/src/jingle-media-rtp.c telepathy-gabble-0.16.0/src/jingle-media-rtp.c
--- telepathy-gabble-0.15.4/src/jingle-media-rtp.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-media-rtp.c	2012-03-07 20:26:07.000000000 +0000
@@ -38,7 +38,6 @@
 #include "jingle-session.h"
 #include "namespaces.h"
 #include "presence-cache.h"
-#include "util.h"
 #include "jingle-transport-google.h"
 
 G_DEFINE_TYPE (GabbleJingleMediaRtp,
@@ -336,7 +335,7 @@
 
       if (priv->media_type == JINGLE_MEDIA_TYPE_VIDEO &&
           (JINGLE_IS_GOOGLE_DIALECT (dialect) ||
-           gabble_jingle_session_peer_has_quirk (content->session,
+           gabble_jingle_session_peer_has_cap (content->session,
                QUIRK_GOOGLE_WEBMAIL_CLIENT)))
         {
           jingle_transport_google_set_component_name (gtrans, "video_rtp", 1);
@@ -366,10 +365,10 @@
           return JINGLE_MEDIA_TYPE_NONE;
         }
 
-      if (!tp_strdiff (type, "audio"))
+      if (!wocky_strdiff (type, "audio"))
           return JINGLE_MEDIA_TYPE_AUDIO;
 
-      if (!tp_strdiff (type, "video"))
+      if (!wocky_strdiff (type, "video"))
         return JINGLE_MEDIA_TYPE_VIDEO;
 
       g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST,
@@ -395,17 +394,6 @@
   g_assert_not_reached ();
 }
 
-static gboolean
-content_has_cap (GabbleJingleContent *content, const gchar *cap)
-{
-  GabblePresence *presence = gabble_presence_cache_get (
-      content->conn->presence_cache, content->session->peer);
-
-  return (presence != NULL) && gabble_presence_resource_has_caps (presence,
-      gabble_jingle_session_get_peer_resource (content->session),
-      gabble_capability_set_predicate_has, cap);
-}
-
 static JingleFeedbackMessage *
 parse_rtcp_fb (GabbleJingleContent *content, WockyNode *node)
 {
@@ -413,7 +401,7 @@
   const gchar *type;
   const gchar *subtype;
 
-  if (tp_strdiff (pt_ns, NS_JINGLE_RTCP_FB))
+  if (wocky_strdiff (pt_ns, NS_JINGLE_RTCP_FB))
     return NULL;
 
   type = wocky_node_get_attribute (node, "type");
@@ -441,7 +429,7 @@
   guint trr_int;
   gchar *endptr = NULL;
 
-  if (tp_strdiff (pt_ns, NS_JINGLE_RTCP_FB))
+  if (wocky_strdiff (pt_ns, NS_JINGLE_RTCP_FB))
     return G_MAXUINT;
 
   txt = wocky_node_get_attribute (node, "value");
@@ -506,7 +494,7 @@
   wocky_node_iter_init (&i, node, NULL, NULL);
   while (wocky_node_iter_next (&i, ¶m))
     {
-      if (!tp_strdiff (param->name, "parameter"))
+      if (!wocky_strdiff (param->name, "parameter"))
         {
           const gchar *param_name, *param_value;
 
@@ -519,7 +507,7 @@
           g_hash_table_insert (p->params, g_strdup (param_name),
               g_strdup (param_value));
         }
-      else if (!tp_strdiff (param->name, "rtcp-fb"))
+      else if (!wocky_strdiff (param->name, "rtcp-fb"))
         {
           JingleFeedbackMessage *fb = parse_rtcp_fb (content, param);
 
@@ -529,7 +517,7 @@
               priv->has_rtcp_fb = TRUE;
             }
         }
-      else if (!tp_strdiff (param->name,
+      else if (!wocky_strdiff (param->name,
               "rtcp-fb-trr-int"))
         {
           guint trr_int = parse_rtcp_fb_trr_int (content, param);
@@ -602,10 +590,11 @@
 static gboolean
 codec_update_coherent (const JingleCodec *old_c,
                        const JingleCodec *new_c,
-                       GQuark domain,
-                       gint code,
                        GError **e)
 {
+  const GQuark domain = WOCKY_XMPP_ERROR;
+  const gint code = WOCKY_XMPP_ERROR_BAD_REQUEST;
+
   if (old_c == NULL)
     {
       g_set_error (e, domain, code, "Codec with id %u ('%s') unknown",
@@ -669,8 +658,7 @@
       new_c = l->data;
       old_c = g_hash_table_lookup (rc, GUINT_TO_POINTER ((guint) new_c->id));
 
-      if (!codec_update_coherent (old_c, new_c, WOCKY_XMPP_ERROR,
-            WOCKY_XMPP_ERROR_BAD_REQUEST, &e))
+      if (!codec_update_coherent (old_c, new_c, &e))
         goto out;
     }
 
@@ -691,7 +679,8 @@
   if (new_media_description != NULL)
     jingle_media_description_free (new_media_description);
 
-  tp_clear_pointer (&rc, g_hash_table_unref);
+  if (rc != NULL)
+    g_hash_table_unref (rc);
 
   if (e != NULL)
     {
@@ -738,7 +727,7 @@
     {
       const gchar *desc_ns =
         wocky_node_get_ns (desc_node);
-      video_session = !tp_strdiff (desc_ns, NS_GOOGLE_SESSION_VIDEO);
+      video_session = !wocky_strdiff (desc_ns, NS_GOOGLE_SESSION_VIDEO);
     }
 
   md = jingle_media_description_new ();
@@ -746,7 +735,7 @@
   wocky_node_iter_init (&i, desc_node, NULL, NULL);
   while (wocky_node_iter_next (&i, &node) && !description_error)
     {
-      if (!tp_strdiff (node->name, "payload-type"))
+      if (!wocky_strdiff (node->name, "payload-type"))
         {
           if (dialect == JINGLE_DIALECT_GTALK3)
             {
@@ -755,13 +744,13 @@
               if (priv->media_type == JINGLE_MEDIA_TYPE_AUDIO)
                 {
                   if (video_session &&
-                      tp_strdiff (pt_ns, NS_GOOGLE_SESSION_PHONE))
+                      wocky_strdiff (pt_ns, NS_GOOGLE_SESSION_PHONE))
                     continue;
                 }
               else if (priv->media_type == JINGLE_MEDIA_TYPE_VIDEO)
                 {
                   if (!(video_session && pt_ns == NULL)
-                      && tp_strdiff (pt_ns, NS_GOOGLE_SESSION_VIDEO))
+                      && wocky_strdiff (pt_ns, NS_GOOGLE_SESSION_VIDEO))
                     continue;
                 }
             }
@@ -779,12 +768,12 @@
                 is_avpf = TRUE;
             }
         }
-      else if (!tp_strdiff (node->name, "rtp-hdrext"))
+      else if (!wocky_strdiff (node->name, "rtp-hdrext"))
         {
           const gchar *pt_ns = wocky_node_get_ns (node);
           JingleRtpHeaderExtension *hdrext;
 
-          if (tp_strdiff (pt_ns, NS_JINGLE_RTP_HDREXT))
+          if (wocky_strdiff (pt_ns, NS_JINGLE_RTP_HDREXT))
             continue;
 
           hdrext = parse_rtp_header_extension (node);
@@ -800,7 +789,7 @@
             }
 
         }
-      else if (!tp_strdiff (node->name, "rtcp-fb"))
+      else if (!wocky_strdiff (node->name, "rtcp-fb"))
         {
           JingleFeedbackMessage *fb = parse_rtcp_fb (content, node);
 
@@ -815,7 +804,7 @@
               priv->has_rtcp_fb = TRUE;
             }
         }
-      else if (!tp_strdiff (node->name, "rtcp-fb-trr-int"))
+      else if (!wocky_strdiff (node->name, "rtcp-fb-trr-int"))
         {
           guint trr_int = parse_rtcp_fb_trr_int (content, node);
 
@@ -1088,10 +1077,10 @@
   JingleDialect dialect = gabble_jingle_session_get_dialect (content->session);
   WockyNode *desc_node;
 
-  if (content_has_cap (content, NS_JINGLE_RTCP_FB))
+  if (gabble_jingle_session_peer_has_cap (content->session, NS_JINGLE_RTCP_FB))
     priv->has_rtcp_fb = TRUE;
 
-  if (content_has_cap (content, NS_JINGLE_RTP_HDREXT))
+  if (gabble_jingle_session_peer_has_cap (content->session, NS_JINGLE_RTP_HDREXT))
     priv->has_rtp_hdrext = TRUE;
 
   desc_node = produce_description_node (dialect, priv->media_type,
@@ -1149,7 +1138,7 @@
       if (!g_hash_table_lookup_extended (b, a_key, NULL, &b_value))
         return FALSE;
 
-      if (tp_strdiff (a_value, b_value))
+      if (wocky_strdiff (a_value, b_value))
         return FALSE;
     }
 
@@ -1184,8 +1173,7 @@
       old_c = g_hash_table_lookup (old_table, GUINT_TO_POINTER (
             (guint) new_c->id));
 
-      if (!codec_update_coherent (old_c, new_c, TP_ERRORS,
-            TP_ERROR_INVALID_ARGUMENT, e))
+      if (!codec_update_coherent (old_c, new_c, e))
         goto out;
 
       if (!string_string_maps_equal (old_c->params, new_c->params))
@@ -1205,8 +1193,20 @@
   return ret;
 }
 
-/* Takes in a list of slice-allocated JingleCodec structs. Ready indicated
- * whether the codecs can regarded as ready to sent from now on */
+/*
+ * @self: a content in an RTP session
+ * @md: (transfer full): new media description for this content
+ * @ready: whether the codecs can regarded as ready to sent from now on
+ * @error: used to return a %WOCKY_XMPP_ERROR if the codec update is illegal.
+ *
+ * Sets or updates the media description (codecs, feedback messages, etc) for
+ * @self.
+ *
+ * Returns: %TRUE if no description was previously set, or if the update is
+ *  compatible with the existing description; %FALSE if the update is illegal
+ *  (due to adding previously-unknown codecs or renaming an existing codec, for
+ *  example)
+ */
 gboolean
 jingle_media_rtp_set_local_media_description (GabbleJingleMediaRtp *self,
                                               JingleMediaDescription *md,
diff -Nru telepathy-gabble-0.15.4/src/jingle-media-rtp.h telepathy-gabble-0.16.0/src/jingle-media-rtp.h
--- telepathy-gabble-0.15.4/src/jingle-media-rtp.h	2012-01-26 18:59:24.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-media-rtp.h	2012-03-07 20:26:07.000000000 +0000
@@ -21,9 +21,9 @@
 #define __JINGLE_MEDIA_RTP_H__
 
 #include 
-#include "types.h"
 
 #include "jingle-content.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-mint.c telepathy-gabble-0.16.0/src/jingle-mint.c
--- telepathy-gabble-0.15.4/src/jingle-mint.c	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-mint.c	2012-03-07 20:26:07.000000000 +0000
@@ -0,0 +1,344 @@
+/*
+ * jingle-mint.c - creates and configures a GabbleJingleFactory
+ * Copyright ©2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ *
+ * "Mint" is intended in the manufacturing sense: a mint is a factory which
+ * produces coins. . It was chosen
+ * in favour of "factory" because this is a "factory factory"; and in favour of
+ * "foundry" to make JingleFactory and this class have different initials.
+ */
+
+#include "jingle-mint.h"
+
+#define DEBUG_FLAG GABBLE_DEBUG_MEDIA
+#include "debug.h"
+
+#include "connection.h"
+#include "conn-presence.h"
+#include "jingle-factory.h"
+#include "jingle-session.h"
+#include "presence-cache.h"
+
+struct _GabbleJingleMintPrivate {
+    GabbleConnection *conn;
+
+    GabbleJingleFactory *factory;
+};
+
+enum {
+    INCOMING_SESSION = 0,
+    N_SIGNALS
+};
+
+static guint signals[N_SIGNALS];
+
+enum
+{
+  PROP_CONNECTION = 1,
+};
+
+static void connection_status_changed_cb (
+    GabbleConnection *conn,
+    guint status,
+    guint reason,
+    gpointer user_data);
+static void connection_porter_available_cb (
+    GabbleConnection *conn,
+    WockyPorter *porter,
+    gpointer user_data);
+
+static void factory_new_session_cb (
+    GabbleJingleFactory *factory,
+    GabbleJingleSession *session,
+    gboolean initiated_locally,
+    gpointer user_data);
+static gboolean factory_query_cap_cb (
+    GabbleJingleFactory *factory,
+    WockyContact *contact,
+    const gchar *cap_or_quirk,
+    gpointer user_data);
+
+G_DEFINE_TYPE (GabbleJingleMint, gabble_jingle_mint, G_TYPE_OBJECT)
+
+static void
+gabble_jingle_mint_init (GabbleJingleMint *self)
+{
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GABBLE_TYPE_JINGLE_MINT,
+      GabbleJingleMintPrivate);
+}
+
+static void
+gabble_jingle_mint_get_property (
+    GObject *object,
+    guint property_id,
+    GValue *value,
+    GParamSpec *pspec)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (object);
+  GabbleJingleMintPrivate *priv = self->priv;
+
+  switch (property_id)
+    {
+      case PROP_CONNECTION:
+        g_value_set_object (value, priv->conn);
+        break;
+
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+gabble_jingle_mint_set_property (
+    GObject *object,
+    guint property_id,
+    const GValue *value,
+    GParamSpec *pspec)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (object);
+  GabbleJingleMintPrivate *priv = self->priv;
+
+  switch (property_id)
+    {
+      case PROP_CONNECTION:
+        priv->conn = g_value_get_object (value);
+        break;
+
+      default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+gabble_jingle_mint_constructed (GObject *object)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (object);
+  GabbleJingleMintPrivate *priv = self->priv;
+  GObjectClass *parent_class = gabble_jingle_mint_parent_class;
+
+  if (parent_class->constructed != NULL)
+    parent_class->constructed (object);
+
+  tp_g_signal_connect_object (priv->conn, "status-changed",
+      (GCallback) connection_status_changed_cb, self, 0);
+  tp_g_signal_connect_object (priv->conn, "porter-available",
+      (GCallback) connection_porter_available_cb, self, 0);
+}
+
+static void
+gabble_jingle_mint_dispose (GObject *object)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (object);
+  GabbleJingleMintPrivate *priv = self->priv;
+  GObjectClass *parent_class = gabble_jingle_mint_parent_class;
+
+  g_clear_object (&priv->factory);
+
+  if (parent_class->dispose != NULL)
+    parent_class->dispose (object);
+}
+
+static void
+gabble_jingle_mint_class_init (GabbleJingleMintClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GParamSpec *param_spec;
+
+  object_class->get_property = gabble_jingle_mint_get_property;
+  object_class->set_property = gabble_jingle_mint_set_property;
+  object_class->constructed = gabble_jingle_mint_constructed;
+  object_class->dispose = gabble_jingle_mint_dispose;
+
+  g_type_class_add_private (klass, sizeof (GabbleJingleMintPrivate));
+
+  param_spec = g_param_spec_object ("connection", "GabbleConnection object",
+      "Gabble connection object that uses this JingleMint object",
+      GABBLE_TYPE_CONNECTION,
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+
+  signals[INCOMING_SESSION] = g_signal_new ("incoming-session",
+        G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
+        0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
+        G_TYPE_NONE, 1, GABBLE_TYPE_JINGLE_SESSION);
+}
+
+GabbleJingleMint *
+gabble_jingle_mint_new (
+    GabbleConnection *connection)
+{
+  return g_object_new (GABBLE_TYPE_JINGLE_MINT,
+      "connection", connection,
+      NULL);
+}
+
+static void
+connection_status_changed_cb (
+    GabbleConnection *conn,
+    guint status,
+    guint reason,
+    gpointer user_data)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (user_data);
+  GabbleJingleMintPrivate *priv = self->priv;
+
+  switch (status)
+    {
+    case TP_CONNECTION_STATUS_CONNECTING:
+      g_assert (priv->conn != NULL);
+      break;
+
+    case TP_CONNECTION_STATUS_CONNECTED:
+        {
+          GabbleJingleInfo *info = gabble_jingle_mint_get_info (self);
+          gchar *stun_server = NULL;
+          guint stun_port = 0;
+
+          g_object_get (priv->conn,
+              "stun-server", &stun_server,
+              "stun-port", &stun_port,
+              NULL);
+
+          if (stun_server != NULL)
+            gabble_jingle_info_take_stun_server (info,
+                stun_server, stun_port, FALSE);
+
+          g_object_get (priv->conn,
+              "fallback-stun-server", &stun_server,
+              "fallback-stun-port", &stun_port,
+              NULL);
+
+          if (stun_server != NULL)
+            gabble_jingle_info_take_stun_server (info,
+                stun_server, stun_port, TRUE);
+
+          if (priv->conn->features &
+              GABBLE_CONNECTION_FEATURES_GOOGLE_JINGLE_INFO)
+            {
+              gabble_jingle_info_send_request (info);
+            }
+        }
+      break;
+
+    case TP_CONNECTION_STATUS_DISCONNECTED:
+      if (priv->factory != NULL)
+        gabble_jingle_factory_stop (priv->factory);
+      break;
+    }
+}
+
+static void
+connection_porter_available_cb (
+    GabbleConnection *conn,
+    WockyPorter *porter,
+    gpointer user_data)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (user_data);
+  GabbleJingleMintPrivate *priv = self->priv;
+
+  /* If we have a WockyPorter, we should definitely have a WockySession */
+  g_assert (conn->session != NULL);
+
+  g_assert (priv->factory == NULL);
+  priv->factory = gabble_jingle_factory_new (conn->session);
+
+  tp_g_signal_connect_object (priv->factory, "new-session",
+      (GCallback) factory_new_session_cb, self, 0);
+  tp_g_signal_connect_object (priv->factory, "query-cap",
+      (GCallback) factory_query_cap_cb, self, 0);
+}
+
+static void
+session_about_to_initiate_cb (
+    GabbleJingleSession *session,
+    gpointer user_data)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (user_data);
+  GabbleJingleMintPrivate *priv = self->priv;
+  const gchar *peer_jid = gabble_jingle_session_get_peer_jid (session);
+  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+  TpHandle peer = tp_handle_ensure (contact_repo, peer_jid, NULL, NULL);
+
+  /* send directed presence (including our own caps, avatar etc.) to
+   * the peer, if we aren't already visible to them */
+  if (!conn_presence_visible_to (priv->conn, peer))
+    conn_presence_signal_own_presence (priv->conn, peer_jid, NULL);
+}
+
+static void
+factory_new_session_cb (
+    GabbleJingleFactory *factory,
+    GabbleJingleSession *session,
+    gboolean initiated_locally,
+    gpointer user_data)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (user_data);
+
+  if (initiated_locally)
+    tp_g_signal_connect_object (session, "about-to-initiate",
+        (GCallback) session_about_to_initiate_cb, self, 0);
+
+  /* Proxy the signal outwards if this is a new incoming session. */
+  if (!initiated_locally)
+    g_signal_emit (self, signals[INCOMING_SESSION], 0, session);
+}
+
+static gboolean
+factory_query_cap_cb (
+    GabbleJingleFactory *factory,
+    WockyContact *contact,
+    const gchar *cap_or_quirk,
+    gpointer user_data)
+{
+  GabbleJingleMint *self = GABBLE_JINGLE_MINT (user_data);
+  GabbleJingleMintPrivate *priv = self->priv;
+  GabblePresence *presence = gabble_presence_cache_get_for_contact (
+      priv->conn->presence_cache, contact);
+
+  if (presence == NULL)
+    return FALSE;
+
+  if (WOCKY_IS_RESOURCE_CONTACT (contact))
+    {
+      const gchar *peer_resource = wocky_resource_contact_get_resource (
+          WOCKY_RESOURCE_CONTACT (contact));
+
+      return gabble_presence_resource_has_caps (presence, peer_resource,
+          gabble_capability_set_predicate_has, cap_or_quirk);
+    }
+  else
+    {
+      return gabble_presence_has_cap (presence, cap_or_quirk);
+    }
+}
+
+GabbleJingleFactory *
+gabble_jingle_mint_get_factory (
+    GabbleJingleMint *self)
+{
+  return self->priv->factory;
+}
+
+GabbleJingleInfo *
+gabble_jingle_mint_get_info (
+    GabbleJingleMint *self)
+{
+  return gabble_jingle_factory_get_jingle_info (self->priv->factory);
+}
diff -Nru telepathy-gabble-0.15.4/src/jingle-mint.h telepathy-gabble-0.16.0/src/jingle-mint.h
--- telepathy-gabble-0.15.4/src/jingle-mint.h	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-mint.h	2012-03-07 20:26:07.000000000 +0000
@@ -0,0 +1,69 @@
+/*
+ * jingle-mint.h - creates and configures a GabbleJingleFactory
+ * Copyright ©2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef GABBLE_JINGLE_MINT_H
+#define GABBLE_JINGLE_MINT_H
+
+#include 
+#include "types.h"
+
+#include "jingle-info.h"
+#include "jingle-types.h"
+
+typedef struct _GabbleJingleMint GabbleJingleMint;
+typedef struct _GabbleJingleMintClass GabbleJingleMintClass;
+typedef struct _GabbleJingleMintPrivate GabbleJingleMintPrivate;
+
+struct _GabbleJingleMintClass {
+    GObjectClass parent_class;
+};
+
+struct _GabbleJingleMint {
+    GObject parent;
+
+    GabbleJingleMintPrivate *priv;
+};
+
+GType gabble_jingle_mint_get_type (void);
+
+GabbleJingleMint *gabble_jingle_mint_new (
+    GabbleConnection *connection);
+
+GabbleJingleFactory *gabble_jingle_mint_get_factory (
+    GabbleJingleMint *self);
+GabbleJingleInfo *gabble_jingle_mint_get_info (
+    GabbleJingleMint *self);
+
+/* TYPE MACROS */
+#define GABBLE_TYPE_JINGLE_MINT \
+  (gabble_jingle_mint_get_type ())
+#define GABBLE_JINGLE_MINT(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_JINGLE_MINT, GabbleJingleMint))
+#define GABBLE_JINGLE_MINT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_JINGLE_MINT,\
+                           GabbleJingleMintClass))
+#define GABBLE_IS_JINGLE_MINT(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_JINGLE_MINT))
+#define GABBLE_IS_JINGLE_MINT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_JINGLE_MINT))
+#define GABBLE_JINGLE_MINT_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_JINGLE_MINT, \
+                              GabbleJingleMintClass))
+
+#endif /* GABBLE_JINGLE_MINT_H */
diff -Nru telepathy-gabble-0.15.4/src/jingle-session.c telepathy-gabble-0.16.0/src/jingle-session.c
--- telepathy-gabble-0.15.4/src/jingle-session.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-session.c	2012-03-07 20:26:07.000000000 +0000
@@ -24,14 +24,11 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
 #include "gabble/capabilities.h"
-#include "connection.h"
-#include "conn-presence.h"
 #include "debug.h"
 #include "gabble-signals-marshal.h"
 #include "gabble-enumtypes.h"
@@ -42,8 +39,6 @@
  */
 #include "jingle-media-rtp.h"
 #include "namespaces.h"
-#include "presence-cache.h"
-#include "util.h"
 
 G_DEFINE_TYPE(GabbleJingleSession, gabble_jingle_session, G_TYPE_OBJECT);
 
@@ -54,6 +49,8 @@
   REMOTE_STATE_CHANGED,
   TERMINATED,
   CONTENT_REJECTED,
+  QUERY_CAP,
+  ABOUT_TO_INITIATE,
   LAST_SIGNAL
 };
 
@@ -62,10 +59,10 @@
 /* properties */
 enum
 {
-  PROP_CONNECTION = 1,
+  PROP_JINGLE_FACTORY = 1,
+  PROP_PORTER,
   PROP_SESSION_ID,
-  PROP_PEER_JID,
-  PROP_PEER,
+  PROP_PEER_CONTACT,
   PROP_LOCAL_INITIATOR,
   PROP_STATE,
   PROP_DIALECT,
@@ -77,11 +74,16 @@
 
 struct _GabbleJingleSessionPrivate
 {
-  GabbleConnection *conn;
-
-  gchar *peer_resource;
+  /* Borrowed; the factory owns us. */
+  GabbleJingleFactory *jingle_factory;
+  WockyPorter *porter;
+
+  WockyContact *peer_contact;
+  /* Borrowed from peer_contact if it's a WockyResourceContact. */
+  const gchar *peer_resource;
   gchar *peer_jid;
-  gchar *initiator;
+  /* Either borrowed from 'porter' or equal to peer_jid. */
+  const gchar *initiator;
   gboolean local_initiator;
 
   /* GabbleJingleContent objects keyed by content name.
@@ -178,6 +180,8 @@
 }
 
 static void gabble_jingle_session_send_held (GabbleJingleSession *sess);
+static void content_ready_cb (GabbleJingleContent *c, gpointer user_data);
+static void content_removed_cb (GabbleJingleContent *c, gpointer user_data);
 
 static void
 gabble_jingle_session_init (GabbleJingleSession *obj)
@@ -201,12 +205,30 @@
 }
 
 static void
+dispose_content_hash (
+    GabbleJingleSession *sess,
+    GHashTable **contents)
+{
+  GHashTableIter iter;
+  gpointer content;
+
+  g_hash_table_iter_init (&iter, *contents);
+  while (g_hash_table_iter_next (&iter, NULL, &content))
+    {
+      g_signal_handlers_disconnect_by_func (content, content_ready_cb, sess);
+      g_signal_handlers_disconnect_by_func (content, content_removed_cb, sess);
+      g_hash_table_iter_remove (&iter);
+    }
+
+  g_hash_table_unref (*contents);
+  *contents = NULL;
+}
+
+static void
 gabble_jingle_session_dispose (GObject *object)
 {
   GabbleJingleSession *sess = GABBLE_JINGLE_SESSION (object);
   GabbleJingleSessionPrivate *priv = sess->priv;
-  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
 
   if (priv->dispose_has_run)
     return;
@@ -217,27 +239,18 @@
   g_assert ((priv->state == JINGLE_STATE_PENDING_CREATED) ||
       (priv->state == JINGLE_STATE_ENDED));
 
-  g_hash_table_unref (priv->initiator_contents);
-  priv->initiator_contents = NULL;
+  dispose_content_hash (sess, &priv->initiator_contents);
+  dispose_content_hash (sess, &priv->responder_contents);
 
-  g_hash_table_unref (priv->responder_contents);
-  priv->responder_contents = NULL;
-
-  tp_handle_unref (contact_repo, sess->peer);
-  sess->peer = 0;
+  g_clear_object (&priv->peer_contact);
+  g_clear_object (&priv->porter);
 
   g_free (priv->sid);
   priv->sid = NULL;
 
-  g_free (priv->peer_resource);
-  priv->peer_resource = NULL;
-
   g_free (priv->peer_jid);
   priv->peer_jid = NULL;
 
-  g_free (priv->initiator);
-  priv->initiator = NULL;
-
   if (G_OBJECT_CLASS (gabble_jingle_session_parent_class)->dispose)
     G_OBJECT_CLASS (gabble_jingle_session_parent_class)->dispose (object);
 }
@@ -252,8 +265,11 @@
   GabbleJingleSessionPrivate *priv = sess->priv;
 
   switch (property_id) {
-    case PROP_CONNECTION:
-      g_value_set_object (value, priv->conn);
+    case PROP_JINGLE_FACTORY:
+      g_value_set_object (value, priv->jingle_factory);
+      break;
+    case PROP_PORTER:
+      g_value_set_object (value, priv->porter);
       break;
     case PROP_SESSION_ID:
       g_value_set_string (value, priv->sid);
@@ -261,8 +277,8 @@
     case PROP_LOCAL_INITIATOR:
       g_value_set_boolean (value, priv->local_initiator);
       break;
-    case PROP_PEER:
-      g_value_set_uint (value, sess->peer);
+    case PROP_PEER_CONTACT:
+      g_value_set_object (value, priv->peer_contact);
       break;
     case PROP_STATE:
       g_value_set_uint (value, priv->state);
@@ -295,9 +311,13 @@
   GabbleJingleSessionPrivate *priv = sess->priv;
 
   switch (property_id) {
-    case PROP_CONNECTION:
-      priv->conn = g_value_get_object (value);
-      g_assert (priv->conn != NULL);
+    case PROP_JINGLE_FACTORY:
+      priv->jingle_factory = g_value_get_object (value);
+      g_assert (priv->jingle_factory != NULL);
+      break;
+    case PROP_PORTER:
+      priv->porter = g_value_dup_object (value);
+      g_assert (priv->porter != NULL);
       break;
     case PROP_SESSION_ID:
       g_free (priv->sid);
@@ -309,8 +329,8 @@
     case PROP_DIALECT:
       priv->dialect = g_value_get_uint (value);
       break;
-    case PROP_PEER_JID:
-      priv->peer_jid = g_value_dup_string (value);
+    case PROP_PEER_CONTACT:
+      priv->peer_contact = g_value_dup_object (value);
       break;
     case PROP_LOCAL_HOLD:
       {
@@ -344,49 +364,44 @@
       G_OBJECT_CLASS (gabble_jingle_session_parent_class)->constructed;
   GabbleJingleSession *self = GABBLE_JINGLE_SESSION (object);
   GabbleJingleSessionPrivate *priv = self->priv;
-  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
 
   if (chain_up != NULL)
     chain_up (object);
 
-  g_assert (priv->conn != NULL);
-  g_assert (priv->peer_jid != NULL);
+  g_assert (priv->jingle_factory != NULL);
+  g_assert (priv->porter != NULL);
+  g_assert (priv->peer_contact != NULL);
   g_assert (priv->sid != NULL);
 
-  self->peer = tp_handle_ensure (contact_repo, priv->peer_jid, NULL, NULL);
+  priv->peer_jid = wocky_contact_dup_jid (priv->peer_contact);
 
   if (priv->local_initiator)
-    priv->initiator = gabble_connection_get_full_jid (priv->conn);
+    priv->initiator = wocky_porter_get_full_jid (priv->porter);
   else
-    priv->initiator = g_strdup (priv->peer_jid);
+    priv->initiator = priv->peer_jid;
 
-  /* FIXME Gabble resource part handling falls apart when it comes to mucs, so
-   * jump though some hoops here */
-  if (tp_dynamic_handle_repo_lookup_exact (contact_repo, priv->peer_jid) == 0)
-    {
-      /* The peer jid isn't exactly what is in the contact repo so it will have
-       * a resource */
-      if (wocky_decode_jid (priv->peer_jid, NULL, NULL,
-          &priv->peer_resource))
-        {
-          /* fake for gcc */;
-        }
-    }
+  if (WOCKY_IS_RESOURCE_CONTACT (priv->peer_contact))
+    priv->peer_resource = wocky_resource_contact_get_resource (
+        WOCKY_RESOURCE_CONTACT (priv->peer_contact));
 }
 
 GabbleJingleSession *
-gabble_jingle_session_new (GabbleConnection *connection,
+gabble_jingle_session_new (
+                           GabbleJingleFactory *factory,
+                           WockyPorter *porter,
                            const gchar *session_id,
                            gboolean local_initiator,
-                           const gchar *jid,
+                           WockyContact *peer,
+                           JingleDialect dialect,
                            gboolean local_hold)
 {
   return g_object_new (GABBLE_TYPE_JINGLE_SESSION,
       "session-id", session_id,
-      "connection", connection,
+      "jingle-factory", factory,
+      "porter", porter,
       "local-initiator", local_initiator,
-      "peer-jid", jid,
+      "peer-contact", peer,
+      "dialect", dialect,
       "local-hold", local_hold,
       NULL);
 }
@@ -405,11 +420,18 @@
   object_class->dispose = gabble_jingle_session_dispose;
 
   /* property definitions */
-  param_spec = g_param_spec_object ("connection", "GabbleConnection object",
-      "Gabble connection object used for exchanging messages.",
-      GABBLE_TYPE_CONNECTION,
+  param_spec = g_param_spec_object ("jingle-factory",
+      "GabbleJingleFactory object",
+      "The Jingle factory which created this session",
+      GABBLE_TYPE_JINGLE_FACTORY,
       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+  g_object_class_install_property (object_class, PROP_JINGLE_FACTORY, param_spec);
+
+  param_spec = g_param_spec_object ("porter", "WockyPorter",
+      "The WockyPorter for the current connection",
+      WOCKY_TYPE_PORTER,
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_PORTER, param_spec);
 
   param_spec = g_param_spec_string ("session-id", "Session ID",
       "A unique session identifier used throughout all communication.",
@@ -424,18 +446,18 @@
   g_object_class_install_property (object_class, PROP_LOCAL_INITIATOR,
       param_spec);
 
-  param_spec = g_param_spec_uint ("peer", "Session peer",
-      "The TpHandle representing the other party in the session.",
-      0, G_MAXUINT32, 0,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_PEER, param_spec);
-
-  param_spec = g_param_spec_string ("peer-jid", "Session peer's jid",
-      "The full jid of the contact with whom this session communicates",
-      NULL,
+  /**
+   * GabbleJingleSession:peer-contact:
+   *
+   * The #WockyContact representing the other party in the session. Note that
+   * if this is a #WockyBareContact (as opposed to a #WockyResourceContact) the
+   * session is with the contact's bare JID.
+   */
+  param_spec = g_param_spec_object ("peer-contact", "Session peer",
+      "The WockyContact representing the other party in the session.",
+      WOCKY_TYPE_CONTACT,
       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_PEER_JID,
-      param_spec);
+  g_object_class_install_property (object_class, PROP_PEER_CONTACT, param_spec);
 
   param_spec = g_param_spec_uint ("state", "Session state",
       "The current state that the session is in.",
@@ -485,6 +507,26 @@
         G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST,
         0, NULL, NULL, gabble_marshal_VOID__OBJECT_UINT_STRING,
         G_TYPE_NONE, 3, G_TYPE_OBJECT, G_TYPE_UINT, G_TYPE_STRING);
+
+  /*
+   * @contact: this call's peer (the artist commonly known as
+   *  gabble_jingle_session_get_peer_contact())
+   * @cap: the XEP-0115 feature string the session is interested in.
+   *
+   * Emitted when the session wants to check whether the peer has a particular
+   * capability. The handler should return %TRUE if @contact has @cap.
+   */
+  signals[QUERY_CAP] = g_signal_new ("query-cap",
+        G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST,
+        0, g_signal_accumulator_first_wins, NULL,
+        gabble_marshal_BOOLEAN__OBJECT_STRING,
+        G_TYPE_BOOLEAN, 2, WOCKY_TYPE_CONTACT, G_TYPE_STRING);
+
+  signals[ABOUT_TO_INITIATE] = g_signal_new ("about-to-initiate",
+        G_TYPE_FROM_CLASS (cls), G_SIGNAL_RUN_LAST,
+        0, NULL, NULL,
+        g_cclosure_marshal_VOID__VOID,
+        G_TYPE_NONE, 0);
 }
 
 typedef void (*HandlerFunc)(GabbleJingleSession *sess,
@@ -528,38 +570,38 @@
       return JINGLE_ACTION_UNKNOWN;
 
   /* synonyms, best deal with them right now */
-  if (!tp_strdiff (txt, "initiate") ||
-      !tp_strdiff (txt, "session-initiate"))
+  if (!wocky_strdiff (txt, "initiate") ||
+      !wocky_strdiff (txt, "session-initiate"))
         return JINGLE_ACTION_SESSION_INITIATE;
-  else if (!tp_strdiff (txt, "terminate") ||
-      !tp_strdiff (txt, "session-terminate") ||
-      !tp_strdiff (txt, "reject"))
+  else if (!wocky_strdiff (txt, "terminate") ||
+      !wocky_strdiff (txt, "session-terminate") ||
+      !wocky_strdiff (txt, "reject"))
         return JINGLE_ACTION_SESSION_TERMINATE;
-  else if (!tp_strdiff (txt, "accept") ||
-      !tp_strdiff (txt, "session-accept"))
+  else if (!wocky_strdiff (txt, "accept") ||
+      !wocky_strdiff (txt, "session-accept"))
         return JINGLE_ACTION_SESSION_ACCEPT;
-  else if (!tp_strdiff (txt, "candidates") ||
-      !tp_strdiff (txt, "transport-info"))
+  else if (!wocky_strdiff (txt, "candidates") ||
+      !wocky_strdiff (txt, "transport-info"))
         return JINGLE_ACTION_TRANSPORT_INFO;
-  else if (!tp_strdiff (txt, "content-accept"))
+  else if (!wocky_strdiff (txt, "content-accept"))
       return JINGLE_ACTION_CONTENT_ACCEPT;
-  else if (!tp_strdiff (txt, "content-add"))
+  else if (!wocky_strdiff (txt, "content-add"))
       return JINGLE_ACTION_CONTENT_ADD;
-  else if (!tp_strdiff (txt, "content-modify"))
+  else if (!wocky_strdiff (txt, "content-modify"))
       return JINGLE_ACTION_CONTENT_MODIFY;
-  else if (!tp_strdiff (txt, "content-replace"))
+  else if (!wocky_strdiff (txt, "content-replace"))
       return JINGLE_ACTION_CONTENT_REPLACE;
-  else if (!tp_strdiff (txt, "content-reject"))
+  else if (!wocky_strdiff (txt, "content-reject"))
       return JINGLE_ACTION_CONTENT_REJECT;
-  else if (!tp_strdiff (txt, "content-remove"))
+  else if (!wocky_strdiff (txt, "content-remove"))
       return JINGLE_ACTION_CONTENT_REMOVE;
-  else if (!tp_strdiff (txt, "session-info"))
+  else if (!wocky_strdiff (txt, "session-info"))
       return JINGLE_ACTION_SESSION_INFO;
-  else if (!tp_strdiff (txt, "transport-accept"))
+  else if (!wocky_strdiff (txt, "transport-accept"))
       return JINGLE_ACTION_TRANSPORT_ACCEPT;
-  else if (!tp_strdiff (txt, "description-info"))
+  else if (!wocky_strdiff (txt, "description-info"))
       return JINGLE_ACTION_DESCRIPTION_INFO;
-  else if (!tp_strdiff (txt, "info"))
+  else if (!wocky_strdiff (txt, "info"))
       return JINGLE_ACTION_INFO;
 
   return JINGLE_ACTION_UNKNOWN;
@@ -631,18 +673,17 @@
 static GabbleJingleContent *_get_any_content (GabbleJingleSession *session);
 
 gboolean
-gabble_jingle_session_peer_has_quirk (
+gabble_jingle_session_peer_has_cap (
     GabbleJingleSession *self,
-    const gchar *quirk)
+    const gchar *cap_or_quirk)
 {
   GabbleJingleSessionPrivate *priv = self->priv;
-  GabblePresence *presence = gabble_presence_cache_get (
-      priv->conn->presence_cache, self->peer);
+  gboolean ret;
 
-  return (presence != NULL &&
-      priv->peer_resource != NULL &&
-      gabble_presence_resource_has_caps (presence, priv->peer_resource,
-          gabble_capability_set_predicate_has, quirk));
+  g_signal_emit (self, signals[QUERY_CAP], 0,
+      priv->peer_contact, cap_or_quirk,
+      &ret);
+  return ret;
 }
 
 static gboolean
@@ -683,7 +724,7 @@
        * pick globally-unique content names.
        */
       if (creator == NULL &&
-          gabble_jingle_session_peer_has_quirk (sess,
+          gabble_jingle_session_peer_has_cap (sess,
               QUIRK_OMITS_CONTENT_CREATORS))
         {
           DEBUG ("working around missing 'creator' attribute");
@@ -693,11 +734,11 @@
           if (*c == NULL)
             *c = g_hash_table_lookup (priv->responder_contents, name);
         }
-      else if (!tp_strdiff (creator, "initiator"))
+      else if (!wocky_strdiff (creator, "initiator"))
         {
           *c = g_hash_table_lookup (priv->initiator_contents, name);
         }
-      else if (!tp_strdiff (creator, "responder"))
+      else if (!wocky_strdiff (creator, "responder"))
         {
           *c = g_hash_table_lookup (priv->responder_contents, name);
         }
@@ -747,9 +788,6 @@
     }
 }
 
-static void content_ready_cb (GabbleJingleContent *c, gpointer user_data);
-static void content_removed_cb (GabbleJingleContent *c, gpointer user_data);
-
 struct idle_content_reject_ctx {
     GabbleJingleSession *session;
     gchar *creator;
@@ -772,7 +810,7 @@
   wocky_node_set_attributes (node,
       "name", ctx->name, "creator", ctx->creator, NULL);
 
-  gabble_jingle_session_send (ctx->session, msg, NULL, NULL);
+  gabble_jingle_session_send (ctx->session, msg);
 
   g_object_unref (ctx->session);
   g_free (ctx->name);
@@ -809,13 +847,11 @@
   GabbleJingleContent *c;
   GHashTable *contents;
 
-  DEBUG ("session creating new content name %s, type %d, conn %p, jf %p",
-    name, type, priv->conn, priv->conn->jingle_factory);
+  DEBUG ("session creating new content name %s, type %d", name, type);
 
   /* FIXME: media-type is introduced by GabbleJingleMediaRTP, not by the
    * superclass, so this call is unsafe in the general case */
   c = g_object_new (content_type,
-                    "connection", priv->conn,
                     "session", sess,
                     "content-ns", content_ns,
                     "transport-ns", transport_ns,
@@ -885,7 +921,8 @@
       content_ns = wocky_node_get_ns (desc_node);
       DEBUG ("namespace: %s", content_ns);
       content_type = gabble_jingle_factory_lookup_content_type (
-          priv->conn->jingle_factory, content_ns);
+          gabble_jingle_session_get_factory (sess),
+          content_ns);
     }
 
   if (content_type == 0)
@@ -1011,21 +1048,23 @@
         wocky_node_get_child (node, "description");
       content_ns = wocky_node_get_ns (desc_node);
 
-      if (!tp_strdiff (content_ns, NS_GOOGLE_SESSION_VIDEO))
+      if (!wocky_strdiff (content_ns, NS_GOOGLE_SESSION_VIDEO))
         {
+          GabbleJingleFactory *factory =
+              gabble_jingle_session_get_factory (sess);
           GType content_type = 0;
 
           DEBUG ("GTalk v3 session with audio and video");
 
           /* audio and video content */
           content_type = gabble_jingle_factory_lookup_content_type (
-            priv->conn->jingle_factory, content_ns);
+            factory, content_ns);
           create_content (sess, content_type, JINGLE_MEDIA_TYPE_VIDEO,
             JINGLE_CONTENT_SENDERS_BOTH, NS_GOOGLE_SESSION_VIDEO, NULL,
               "video", node, error);
 
           content_type = gabble_jingle_factory_lookup_content_type (
-            priv->conn->jingle_factory, NS_GOOGLE_SESSION_PHONE);
+            factory, NS_GOOGLE_SESSION_PHONE);
           create_content (sess, content_type, JINGLE_MEDIA_TYPE_AUDIO,
             JINGLE_CONTENT_SENDERS_BOTH, NS_GOOGLE_SESSION_PHONE, NULL,
               "audio", node, error);
@@ -1235,7 +1274,7 @@
   const gchar *name = wocky_node_get_attribute (payload, "name");
   const gchar *creator = wocky_node_get_attribute (payload, "creator");
 
-  if (tp_strdiff (ns, NS_JINGLE_RTP_INFO))
+  if (wocky_strdiff (ns, NS_JINGLE_RTP_INFO))
     {
       *handled = FALSE;
       return TRUE;
@@ -1243,33 +1282,33 @@
 
   *handled = TRUE;
 
-  if (!tp_strdiff (elt, "active"))
+  if (!wocky_strdiff (elt, "active"))
     {
       /* Clear all states, we're active */
       mute_all (sess, FALSE);
       set_ringing (sess, FALSE);
       set_hold (sess, FALSE);
     }
-  else if (!tp_strdiff (elt, "ringing"))
+  else if (!wocky_strdiff (elt, "ringing"))
     {
       set_ringing (sess, TRUE);
     }
-  else if (!tp_strdiff (elt, "hold"))
+  else if (!wocky_strdiff (elt, "hold"))
     {
       set_hold (sess, TRUE);
     }
-  else if (!tp_strdiff (elt, "unhold"))
+  else if (!wocky_strdiff (elt, "unhold"))
     {
       set_hold (sess, FALSE);
     }
   /* XEP-0178 says that only  and  can have a name=''
    * attribute.
    */
-  else if (!tp_strdiff (elt, "mute"))
+  else if (!wocky_strdiff (elt, "mute"))
     {
       return set_mute (sess, name, creator, TRUE, error);
     }
-  else if (!tp_strdiff (elt, "unmute"))
+  else if (!wocky_strdiff (elt, "unmute"))
     {
       return set_mute (sess, name, creator, FALSE, error);
     }
@@ -1365,7 +1404,7 @@
 
       if (priv->dialect == JINGLE_DIALECT_GTALK4)
         {
-          if (!tp_strdiff (wocky_node_get_attribute (node, "type"),
+          if (!wocky_strdiff (wocky_node_get_attribute (node, "type"),
                 "candidates"))
             {
               GList *contents = gabble_jingle_session_get_contents (sess);
@@ -1740,7 +1779,7 @@
       GabbleJingleContent *c = GABBLE_JINGLE_CONTENT (li->data);
       const gchar *disposition = gabble_jingle_content_get_disposition (c);
 
-      if (!tp_strdiff (disposition, "session"))
+      if (!wocky_strdiff (disposition, "session"))
         mapper (sess, c, user_data);
     }
 
@@ -1796,55 +1835,44 @@
     }
 }
 
-static void
-_process_reply (GabbleConnection *conn,
-    WockyStanza *sent,
-    WockyStanza *reply,
-    GObject *obj,
-    gpointer cb_)
-{
-  JingleReplyHandler cb = cb_;
-  WockyStanzaSubType sub_type;
-
-  wocky_stanza_get_type_info (reply, NULL, &sub_type);
-  cb (obj, sub_type == WOCKY_STANZA_SUB_TYPE_RESULT, reply);
-}
-
 /**
  * gabble_jingle_session_send:
  * @sess: a session
  * @stanza: (transfer full): a stanza, of which this function will take ownership
- * @cb: callback for the IQ reply, or %NULL to ignore the reply
- * @weak_object: an object to pass to @cb, or %NULL
  *
- * Sends an IQ, optionally calling @cb for the reply. If @weak_object is not
- * NULL, @cb will only be called if @weak_object is still alive.
+ * A shorthand for sending a Jingle IQ without waiting for the reply.
  */
 void
 gabble_jingle_session_send (GabbleJingleSession *sess,
-    WockyStanza *stanza,
-    JingleReplyHandler cb,
-    GObject *weak_object)
+    WockyStanza *stanza)
 {
-  if (cb != NULL)
-    _gabble_connection_send_with_reply (sess->priv->conn, stanza,
-        _process_reply, weak_object, cb, NULL);
-  else
-    _gabble_connection_send_with_reply (sess->priv->conn, stanza,
-        NULL, NULL, NULL, NULL);
-
+  wocky_porter_send_iq_async (sess->priv->porter,
+      stanza, NULL, NULL, NULL);
   g_object_unref (stanza);
 }
 
 static void
-_on_initiate_reply (GObject *sess_as_obj,
-    gboolean success,
-    WockyStanza *reply)
+_on_initiate_reply (
+    GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
 {
-  GabbleJingleSession *sess = GABBLE_JINGLE_SESSION (sess_as_obj);
+  WockyPorter *porter = WOCKY_PORTER (source);
+  GabbleJingleSession *sess = GABBLE_JINGLE_SESSION (user_data);
   GabbleJingleSessionPrivate *priv = sess->priv;
+  WockyStanza *reply;
 
-  if (success)
+  if (priv->state != JINGLE_STATE_PENDING_INITIATE_SENT)
+    {
+      DEBUG ("Ignoring session-initiate reply; session %p is in state %u.",
+          sess, priv->state);
+      g_object_unref (sess);
+      return;
+    }
+
+  reply = wocky_porter_send_iq_finish (porter, result, NULL);
+  if (reply != NULL &&
+      !wocky_stanza_extract_errors (reply, NULL, NULL, NULL, NULL))
     {
       set_state (sess, JINGLE_STATE_PENDING_INITIATED, 0, NULL);
 
@@ -1862,16 +1890,33 @@
       set_state (sess, JINGLE_STATE_ENDED, JINGLE_REASON_UNKNOWN,
           NULL);
     }
+
+  g_clear_object (&reply);
+  g_object_unref (sess);
 }
 
 static void
-_on_accept_reply (GObject *sess_as_obj,
-    gboolean success,
-    WockyStanza *reply)
+_on_accept_reply (
+    GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
 {
-  GabbleJingleSession *sess = GABBLE_JINGLE_SESSION (sess_as_obj);
+  WockyPorter *porter = WOCKY_PORTER (source);
+  GabbleJingleSession *sess = GABBLE_JINGLE_SESSION (user_data);
+  GabbleJingleSessionPrivate *priv = sess->priv;
+  WockyStanza *reply;
+
+  if (priv->state != JINGLE_STATE_PENDING_ACCEPT_SENT)
+    {
+      DEBUG ("Ignoring session-accept reply; session %p is in state %u.",
+          sess, priv->state);
+      g_object_unref (sess);
+      return;
+    }
 
-  if (success)
+  reply = wocky_porter_send_iq_finish (porter, result, NULL);
+  if (reply != NULL &&
+      !wocky_stanza_extract_errors (reply, NULL, NULL, NULL, NULL))
     {
       set_state (sess, JINGLE_STATE_ACTIVE, 0, NULL);
       gabble_jingle_session_send_rtp_info (sess, "active");
@@ -1881,20 +1926,21 @@
       set_state (sess, JINGLE_STATE_ENDED, JINGLE_REASON_UNKNOWN,
           NULL);
     }
+
+  g_clear_object (&reply);
+  g_object_unref (sess);
 }
 
 static void
 try_session_initiate_or_accept (GabbleJingleSession *sess)
 {
   GabbleJingleSessionPrivate *priv = sess->priv;
-  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   WockyStanza *msg;
   WockyNode *sess_node;
   gboolean contents_ready = TRUE;
   JingleAction action;
   JingleState new_state;
-  JingleReplyHandler handler;
+  GAsyncReadyCallback handler;
 
   DEBUG ("Trying initiate or accept");
 
@@ -1916,11 +1962,7 @@
           return;
         }
 
-      /* send directed presence (including our own caps, avatar etc.) to
-       * the peer, if we aren't already visible to them */
-      if (!conn_presence_visible_to (priv->conn, sess->peer))
-        conn_presence_signal_own_presence (priv->conn,
-            tp_handle_inspect (contact_repo, sess->peer), NULL);
+      g_signal_emit (sess, signals[ABOUT_TO_INITIATE], 0);
 
       action = JINGLE_ACTION_SESSION_INITIATE;
       new_state = JINGLE_STATE_PENDING_INITIATE_SENT;
@@ -1993,7 +2035,9 @@
 
 
   _map_initial_contents (sess, _fill_content, sess_node);
-  gabble_jingle_session_send (sess, msg, handler, (GObject *) sess);
+  wocky_porter_send_iq_async (priv->porter,
+      msg, NULL, handler, g_object_ref (sess));
+  g_object_unref (msg);
   set_state (sess, new_state, 0, NULL);
 
   /* now all initial contents can transmit their candidates */
@@ -2097,11 +2141,11 @@
 
           wocky_node_add_child_with_content (r, reason_elt, NULL);
 
-          if (!tp_str_empty (text))
+          if (text != NULL && *text != '\0')
             wocky_node_add_child_with_content (r, "text", text);
         }
 
-      gabble_jingle_session_send (sess, msg, NULL, NULL);
+      gabble_jingle_session_send (sess, msg);
     }
 
   /* NOTE: on "terminated", jingle factory and media channel will unref
@@ -2219,7 +2263,8 @@
     }
 
   content_type = gabble_jingle_factory_lookup_content_type (
-      priv->conn->jingle_factory, content_ns);
+      gabble_jingle_session_get_factory (sess),
+      content_ns);
 
   g_assert (content_type != 0);
 
@@ -2308,7 +2353,7 @@
   /* This assertion is actually safe, because 'ready' is only emitted by
    * contents with disposition "session". But this is crazy.
    */
-  g_assert (!tp_strdiff (disposition, "session"));
+  g_assert (!wocky_strdiff (disposition, "session"));
 
   try_session_initiate_or_accept (sess);
 }
@@ -2333,7 +2378,7 @@
   notification->ns = g_quark_from_static_string (NS_JINGLE_RTP_INFO);
 
   /* This is just informational, so ignoring the reply. */
-  gabble_jingle_session_send (sess, message, NULL, NULL);
+  gabble_jingle_session_send (sess, message);
 }
 
 static void
@@ -2371,7 +2416,7 @@
 gabble_jingle_session_can_modify_contents (GabbleJingleSession *sess)
 {
   return !JINGLE_IS_GOOGLE_DIALECT (sess->priv->dialect) &&
-      !gabble_jingle_session_peer_has_quirk (sess, QUIRK_GOOGLE_WEBMAIL_CLIENT);
+      !gabble_jingle_session_peer_has_cap (sess, QUIRK_GOOGLE_WEBMAIL_CLIENT);
 }
 
 JingleDialect
@@ -2380,8 +2425,32 @@
   return sess->priv->dialect;
 }
 
+WockyContact *
+gabble_jingle_session_get_peer_contact (GabbleJingleSession *self)
+{
+  return self->priv->peer_contact;
+}
+
+/*
+ * gabble_jingle_session_get_peer_jid:
+ * @sess: a jingle session
+ *
+ * Returns: the full JID of the remote contact.
+ */
 const gchar *
 gabble_jingle_session_get_peer_jid (GabbleJingleSession *sess)
 {
   return sess->priv->peer_jid;
 }
+
+GabbleJingleFactory *
+gabble_jingle_session_get_factory (GabbleJingleSession *self)
+{
+  return self->priv->jingle_factory;
+}
+
+WockyPorter *
+gabble_jingle_session_get_porter (GabbleJingleSession *self)
+{
+  return self->priv->porter;
+}
diff -Nru telepathy-gabble-0.15.4/src/jingle-session.h telepathy-gabble-0.16.0/src/jingle-session.h
--- telepathy-gabble-0.15.4/src/jingle-session.h	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-session.h	2012-03-07 20:26:07.000000000 +0000
@@ -25,7 +25,7 @@
 
 #include "jingle-content.h"
 #include "jingle-factory.h"
-#include "types.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
@@ -65,14 +65,15 @@
 struct _GabbleJingleSession {
     GObject parent;
     GabbleJingleSessionPrivate *priv;
-
-    TpHandle peer;
 };
 
-GabbleJingleSession *gabble_jingle_session_new (GabbleConnection *connection,
+GabbleJingleSession *gabble_jingle_session_new (
+    GabbleJingleFactory *factory,
+    WockyPorter *porter,
     const gchar *session_id,
     gboolean local_initiator,
-    const gchar *jid,
+    WockyContact *peer,
+    JingleDialect dialect,
     gboolean local_hold);
 
 const gchar * gabble_jingle_session_detect (WockyStanza *stanza,
@@ -108,16 +109,13 @@
 JingleDialect gabble_jingle_session_get_dialect (GabbleJingleSession *sess);
 
 gboolean gabble_jingle_session_can_modify_contents (GabbleJingleSession *sess);
-gboolean gabble_jingle_session_peer_has_quirk (
+gboolean gabble_jingle_session_peer_has_cap (
     GabbleJingleSession *self,
-    const gchar *quirk);
+    const gchar *cap_or_quirk);
 
-typedef void (*JingleReplyHandler) (GObject *, gboolean success,
-    WockyStanza *reply);
-void gabble_jingle_session_send (GabbleJingleSession *sess,
-    WockyStanza *stanza,
-    JingleReplyHandler cb,
-    GObject *weak_object);
+void gabble_jingle_session_send (
+    GabbleJingleSession *sess,
+    WockyStanza *stanza);
 
 void gabble_jingle_session_set_local_hold (GabbleJingleSession *sess,
     gboolean held);
@@ -129,9 +127,13 @@
 gboolean gabble_jingle_session_defines_action (GabbleJingleSession *sess,
     JingleAction action);
 
+WockyContact *gabble_jingle_session_get_peer_contact (GabbleJingleSession *self);
 const gchar *gabble_jingle_session_get_peer_jid (GabbleJingleSession *sess);
 
 const gchar *gabble_jingle_session_get_reason_name (JingleReason reason);
 
+GabbleJingleFactory *gabble_jingle_session_get_factory (GabbleJingleSession *self);
+WockyPorter *gabble_jingle_session_get_porter (GabbleJingleSession *self);
+
 #endif /* __JINGLE_SESSION_H__ */
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-share.c telepathy-gabble-0.16.0/src/jingle-share.c
--- telepathy-gabble-0.15.4/src/jingle-share.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-share.c	2012-03-07 20:26:07.000000000 +0000
@@ -334,9 +334,9 @@
       const gchar *size;
       GabbleJingleShareManifestEntry *m = NULL;
 
-      if (!tp_strdiff (node->name, "folder"))
+      if (!wocky_strdiff (node->name, "folder"))
         folder = TRUE;
-      else if (!tp_strdiff (node->name, "file"))
+      else if (!wocky_strdiff (node->name, "file"))
         folder = FALSE;
       else
         continue;
@@ -383,13 +383,13 @@
           if (name == NULL)
             continue;
 
-          if (!tp_strdiff (name, "source-path"))
+          if (!wocky_strdiff (name, "source-path"))
             {
               const gchar *url = node->content;
               priv->manifest->source_url = g_strdup (url);
             }
 
-          if (!tp_strdiff (name, "preview-path"))
+          if (!wocky_strdiff (name, "preview-path"))
             {
               const gchar *url = node->content;
               priv->manifest->preview_url = g_strdup (url);
diff -Nru telepathy-gabble-0.15.4/src/jingle-share.h telepathy-gabble-0.16.0/src/jingle-share.h
--- telepathy-gabble-0.15.4/src/jingle-share.h	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-share.h	2012-03-07 20:26:07.000000000 +0000
@@ -21,9 +21,9 @@
 #define __JINGLE_SHARE_H__
 
 #include 
-#include "types.h"
 
 #include "jingle-content.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-tp-util.c telepathy-gabble-0.16.0/src/jingle-tp-util.c
--- telepathy-gabble-0.15.4/src/jingle-tp-util.c	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-tp-util.c	2012-03-07 20:26:07.000000000 +0000
@@ -0,0 +1,81 @@
+/*
+ * jingle-tp-util.c - Telepathy-flavoured Jingle utility functions
+ * Copyright © 2008–2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "jingle-tp-util.h"
+
+JingleMediaType
+jingle_media_type_from_tp (TpMediaStreamType type)
+{
+  switch (type)
+    {
+      case TP_MEDIA_STREAM_TYPE_AUDIO:
+        return JINGLE_MEDIA_TYPE_AUDIO;
+      case TP_MEDIA_STREAM_TYPE_VIDEO:
+        return JINGLE_MEDIA_TYPE_VIDEO;
+      default:
+        g_return_val_if_reached (JINGLE_MEDIA_TYPE_NONE);
+    }
+}
+
+TpMediaStreamType
+jingle_media_type_to_tp (JingleMediaType type)
+{
+  switch (type)
+    {
+      case JINGLE_MEDIA_TYPE_AUDIO:
+        return TP_MEDIA_STREAM_TYPE_AUDIO;
+      case JINGLE_MEDIA_TYPE_VIDEO:
+        return TP_MEDIA_STREAM_TYPE_VIDEO;
+      default:
+        g_return_val_if_reached (TP_MEDIA_STREAM_TYPE_AUDIO);
+    }
+}
+
+static const gchar * const relay_type_map[] = {
+    /* GABBLE_JINGLE_RELAY_TYPE_UDP */ "udp",
+    /* GABBLE_JINGLE_RELAY_TYPE_TCP */ "tcp",
+    /* GABBLE_JINGLE_RELAY_TYPE_TLS */ "tls",
+};
+
+GPtrArray *
+gabble_build_tp_relay_info (GPtrArray *relays)
+{
+  guint i;
+  GPtrArray *tp_relays = g_ptr_array_sized_new (relays->len);
+
+  g_ptr_array_set_free_func (tp_relays, (GDestroyNotify) g_hash_table_unref);
+
+  for (i = 0; i < relays->len; i++)
+    {
+      GabbleJingleRelay *relay = g_ptr_array_index (relays, i);
+
+      g_return_val_if_fail (relay->type < GABBLE_N_JINGLE_RELAY_TYPES, tp_relays);
+
+      g_ptr_array_add (tp_relays, tp_asv_new (
+          "type", G_TYPE_STRING, relay_type_map[relay->type],
+          "ip", G_TYPE_STRING, relay->ip,
+          "port", G_TYPE_UINT, relay->port,
+          "username", G_TYPE_STRING, relay->username,
+          "password", G_TYPE_STRING, relay->password,
+          "component", G_TYPE_UINT, relay->component,
+          NULL));
+    }
+
+  return tp_relays;
+}
diff -Nru telepathy-gabble-0.15.4/src/jingle-tp-util.h telepathy-gabble-0.16.0/src/jingle-tp-util.h
--- telepathy-gabble-0.15.4/src/jingle-tp-util.h	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-tp-util.h	2012-03-07 20:26:07.000000000 +0000
@@ -0,0 +1,31 @@
+/*
+ * jingle-tp-util.h - Header for Telepathy-flavoured Jingle utility functions
+ * Copyright © 2008–2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef GABBLE_JINGLE_TP_UTIL_H
+#define GABBLE_JINGLE_TP_UTIL_H
+
+#include 
+#include "jingle-content.h"
+
+JingleMediaType jingle_media_type_from_tp (TpMediaStreamType type);
+TpMediaStreamType jingle_media_type_to_tp (JingleMediaType type);
+
+GPtrArray *gabble_build_tp_relay_info (GPtrArray *relays);
+
+#endif /* GABBLE_JINGLE_TP_UTIL_H */
diff -Nru telepathy-gabble-0.15.4/src/jingle-transport-google.c telepathy-gabble-0.16.0/src/jingle-transport-google.c
--- telepathy-gabble-0.15.4/src/jingle-transport-google.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-transport-google.c	2012-03-07 20:26:07.000000000 +0000
@@ -27,13 +27,11 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
-#include "connection.h"
 #include "debug.h"
 #include "jingle-content.h"
 #include "jingle-factory.h"
 #include "jingle-session.h"
 #include "namespaces.h"
-#include "util.h"
 
 static void
 transport_iface_init (gpointer g_iface, gpointer iface_data);
@@ -275,11 +273,11 @@
       if (str == NULL)
           break;
 
-      if (!tp_strdiff (str, "udp"))
+      if (!wocky_strdiff (str, "udp"))
         {
           proto = JINGLE_TRANSPORT_PROTOCOL_UDP;
         }
-      else if (!tp_strdiff (str, "tcp"))
+      else if (!wocky_strdiff (str, "tcp"))
         {
           /* candiates on port 443 must be "ssltcp" */
           if (port == 443)
@@ -287,7 +285,7 @@
 
           proto = JINGLE_TRANSPORT_PROTOCOL_TCP;
         }
-      else if (!tp_strdiff (str, "ssltcp"))
+      else if (!wocky_strdiff (str, "ssltcp"))
         {
           /* "ssltcp" must use port 443 */
           if (port != 443)
@@ -313,15 +311,15 @@
       if (str == NULL)
           break;
 
-      if (!tp_strdiff (str, "local"))
+      if (!wocky_strdiff (str, "local"))
         {
           ctype = JINGLE_CANDIDATE_TYPE_LOCAL;
         }
-      else if (!tp_strdiff (str, "stun"))
+      else if (!wocky_strdiff (str, "stun"))
         {
           ctype = JINGLE_CANDIDATE_TYPE_STUN;
         }
-      else if (!tp_strdiff (str, "relay"))
+      else if (!wocky_strdiff (str, "relay"))
         {
           ctype = JINGLE_CANDIDATE_TYPE_RELAY;
         }
@@ -452,8 +450,9 @@
       wocky_node_set_attribute (cnode, "name", name);
     }
 
-  _gabble_connection_send_with_reply (priv->content->conn, msg, NULL, NULL,
-      NULL, NULL);
+  wocky_porter_send_iq_async (
+      gabble_jingle_session_get_porter (priv->content->session), msg,
+      NULL, NULL, NULL);
   g_object_unref (msg);
 }
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-transport-google.h telepathy-gabble-0.16.0/src/jingle-transport-google.h
--- telepathy-gabble-0.15.4/src/jingle-transport-google.h	2012-01-26 18:59:24.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-transport-google.h	2012-03-07 20:26:07.000000000 +0000
@@ -22,7 +22,7 @@
 
 #include 
 
-#include "types.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-transport-iceudp.c telepathy-gabble-0.16.0/src/jingle-transport-iceudp.c
--- telepathy-gabble-0.15.4/src/jingle-transport-iceudp.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-transport-iceudp.c	2012-03-07 20:26:07.000000000 +0000
@@ -27,13 +27,11 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_MEDIA
 
-#include "connection.h"
 #include "debug.h"
 #include "jingle-content.h"
 #include "jingle-factory.h"
 #include "jingle-session.h"
 #include "namespaces.h"
-#include "util.h"
 
 static void
 transport_iface_init (gpointer g_iface, gpointer iface_data);
@@ -287,7 +285,7 @@
           continue;
         }
 
-      if (!tp_strdiff (str, "udp"))
+      if (!wocky_strdiff (str, "udp"))
         {
           proto = JINGLE_TRANSPORT_PROTOCOL_UDP;
         }
@@ -313,18 +311,18 @@
           continue;
         }
 
-      if (!tp_strdiff (str, "host"))
+      if (!wocky_strdiff (str, "host"))
         {
           ctype = JINGLE_CANDIDATE_TYPE_LOCAL;
         }
-      else if (!tp_strdiff (str, "srflx") || !tp_strdiff (str, "prflx"))
+      else if (!wocky_strdiff (str, "srflx") || !wocky_strdiff (str, "prflx"))
         {
           /* FIXME Strictly speaking a prflx candidate should be a different
            * type, but the TP spec has now way to distinguish and it doesn't
            * matter much anyway.. */
           ctype = JINGLE_CANDIDATE_TYPE_STUN;
         }
-      else if (!tp_strdiff (str, "relay"))
+      else if (!wocky_strdiff (str, "relay"))
         {
           ctype = JINGLE_CANDIDATE_TYPE_RELAY;
         }
@@ -436,7 +434,7 @@
         {
           username = c->username;
         }
-      else if (tp_strdiff (username, c->username))
+      else if (wocky_strdiff (username, c->username))
         {
           DEBUG ("found a candidate with a different username (%s not %s); "
               "will send in a separate batch", c->username, username);
@@ -518,8 +516,9 @@
           TRUE, &trans_node);
       inject_candidates (iface, trans_node);
 
-      _gabble_connection_send_with_reply (priv->content->conn, msg, NULL, NULL,
-          NULL, NULL);
+      wocky_porter_send_iq_async (
+          gabble_jingle_session_get_porter (priv->content->session), msg,
+          NULL, NULL, NULL);
       g_object_unref (msg);
     }
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-transport-iceudp.h telepathy-gabble-0.16.0/src/jingle-transport-iceudp.h
--- telepathy-gabble-0.15.4/src/jingle-transport-iceudp.h	2012-01-26 18:59:24.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-transport-iceudp.h	2012-03-07 20:26:07.000000000 +0000
@@ -22,7 +22,7 @@
 
 #include 
 
-#include "types.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-transport-iface.h telepathy-gabble-0.16.0/src/jingle-transport-iface.h
--- telepathy-gabble-0.15.4/src/jingle-transport-iface.h	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-transport-iface.h	2012-03-07 20:26:07.000000000 +0000
@@ -24,7 +24,7 @@
 #include 
 
 #include "jingle-factory.h"
-#include "types.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-transport-rawudp.c telepathy-gabble-0.16.0/src/jingle-transport-rawudp.c
--- telepathy-gabble-0.15.4/src/jingle-transport-rawudp.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-transport-rawudp.c	2012-03-07 20:26:07.000000000 +0000
@@ -33,7 +33,6 @@
 #include "jingle-factory.h"
 #include "jingle-session.h"
 #include "namespaces.h"
-#include "util.h"
 
 static void
 transport_iface_init (gpointer g_iface, gpointer iface_data);
diff -Nru telepathy-gabble-0.15.4/src/jingle-transport-rawudp.h telepathy-gabble-0.16.0/src/jingle-transport-rawudp.h
--- telepathy-gabble-0.15.4/src/jingle-transport-rawudp.h	2012-01-26 18:59:24.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-transport-rawudp.h	2012-03-07 20:26:07.000000000 +0000
@@ -22,7 +22,7 @@
 
 #include 
 
-#include "types.h"
+#include "jingle-types.h"
 
 G_BEGIN_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/jingle-types.h telepathy-gabble-0.16.0/src/jingle-types.h
--- telepathy-gabble-0.15.4/src/jingle-types.h	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/jingle-types.h	2012-03-07 20:26:07.000000000 +0000
@@ -0,0 +1,126 @@
+/*
+ * jingle-types.h - Header for Jingle-related enums and typedefs
+ * Copyright © 2008–2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef GABBLE_JINGLE_ENUMS_H
+#define GABBLE_JINGLE_ENUMS_H
+
+typedef struct _GabbleJingleFactory GabbleJingleFactory;
+typedef struct _GabbleJingleSession GabbleJingleSession;
+typedef struct _GabbleJingleContent GabbleJingleContent;
+typedef struct _GabbleJingleTransportGoogle GabbleJingleTransportGoogle;
+typedef struct _GabbleJingleTransportRawUdp GabbleJingleTransportRawUdp;
+typedef struct _GabbleJingleTransportIceUdp GabbleJingleTransportIceUdp;
+typedef struct _GabbleJingleMediaRtp GabbleJingleMediaRtp;
+typedef struct _GabbleJingleShare GabbleJingleShare;
+typedef struct _JingleCandidate JingleCandidate;
+
+typedef enum { /*< skip >*/
+  /* not a jingle message */
+  JINGLE_DIALECT_ERROR,
+  /* old libjingle3 gtalk variant */
+  JINGLE_DIALECT_GTALK3,
+  /* new gtalk variant */
+  JINGLE_DIALECT_GTALK4,
+  /* jingle in the old 0.15 version days */
+  JINGLE_DIALECT_V015,
+  /* current jingle standard */
+  JINGLE_DIALECT_V032
+} JingleDialect;
+
+#define JINGLE_IS_GOOGLE_DIALECT(d)\
+    ((d == JINGLE_DIALECT_GTALK3) || (d == JINGLE_DIALECT_GTALK4))
+
+typedef enum { /*< skip >*/
+  JINGLE_STATE_INVALID = -1,
+  JINGLE_STATE_PENDING_CREATED = 0,
+  JINGLE_STATE_PENDING_INITIATE_SENT,
+  JINGLE_STATE_PENDING_INITIATED,
+  JINGLE_STATE_PENDING_ACCEPT_SENT,
+  JINGLE_STATE_ACTIVE,
+  JINGLE_STATE_ENDED,
+  MAX_JINGLE_STATES
+} JingleState;
+
+typedef enum { /*< skip >*/
+  JINGLE_ACTION_UNKNOWN,
+  JINGLE_ACTION_CONTENT_ACCEPT,
+  JINGLE_ACTION_CONTENT_ADD,
+  JINGLE_ACTION_CONTENT_MODIFY,
+  JINGLE_ACTION_CONTENT_REMOVE,
+  JINGLE_ACTION_CONTENT_REPLACE,
+  JINGLE_ACTION_CONTENT_REJECT,
+  JINGLE_ACTION_SESSION_ACCEPT,
+  JINGLE_ACTION_SESSION_INFO,
+  JINGLE_ACTION_SESSION_INITIATE,
+  JINGLE_ACTION_SESSION_TERMINATE,
+  JINGLE_ACTION_TRANSPORT_INFO,
+  JINGLE_ACTION_TRANSPORT_ACCEPT,
+  JINGLE_ACTION_DESCRIPTION_INFO,
+  JINGLE_ACTION_INFO
+} JingleAction;
+
+typedef enum { /*< skip >*/
+  JINGLE_CONTENT_SENDERS_NONE,
+  JINGLE_CONTENT_SENDERS_INITIATOR,
+  JINGLE_CONTENT_SENDERS_RESPONDER,
+  JINGLE_CONTENT_SENDERS_BOTH
+} JingleContentSenders;
+
+typedef enum { /*< skip >*/
+  JINGLE_TRANSPORT_UNKNOWN,
+  JINGLE_TRANSPORT_GOOGLE_P2P,
+  JINGLE_TRANSPORT_RAW_UDP,
+  JINGLE_TRANSPORT_ICE_UDP,
+} JingleTransportType;
+
+typedef enum { /*< skip >*/
+  JINGLE_TRANSPORT_PROTOCOL_UDP,
+  JINGLE_TRANSPORT_PROTOCOL_TCP
+} JingleTransportProtocol;
+
+typedef enum { /*< skip >*/
+  JINGLE_CANDIDATE_TYPE_LOCAL,
+  JINGLE_CANDIDATE_TYPE_STUN,
+  JINGLE_CANDIDATE_TYPE_RELAY
+} JingleCandidateType;
+
+typedef enum
+{
+  JINGLE_REASON_UNKNOWN,
+  JINGLE_REASON_ALTERNATIVE_SESSION,
+  JINGLE_REASON_BUSY,
+  JINGLE_REASON_CANCEL,
+  JINGLE_REASON_CONNECTIVITY_ERROR,
+  JINGLE_REASON_DECLINE,
+  JINGLE_REASON_EXPIRED,
+  JINGLE_REASON_FAILED_APPLICATION,
+  JINGLE_REASON_FAILED_TRANSPORT,
+  JINGLE_REASON_GENERAL_ERROR,
+  JINGLE_REASON_GONE,
+  JINGLE_REASON_INCOMPATIBLE_PARAMETERS,
+  JINGLE_REASON_MEDIA_ERROR,
+  JINGLE_REASON_SECURITY_ERROR,
+  JINGLE_REASON_SUCCESS,
+  JINGLE_REASON_TIMEOUT,
+  JINGLE_REASON_UNSUPPORTED_APPLICATIONS,
+  JINGLE_REASON_UNSUPPORTED_TRANSPORTS
+} JingleReason;
+
+
+#endif /* GABBLE_JINGLE_ENUMS_H */
diff -Nru telepathy-gabble-0.15.4/src/legacy-caps.c telepathy-gabble-0.16.0/src/legacy-caps.c
--- telepathy-gabble-0.15.4/src/legacy-caps.c	2012-01-26 18:59:24.000000000 +0000
+++ telepathy-gabble-0.16.0/src/legacy-caps.c	2012-03-26 18:00:06.000000000 +0000
@@ -25,12 +25,16 @@
 
 #define DEBUG_FLAG GABBLE_DEBUG_PRESENCE
 #include "debug.h"
+#ifdef ENABLE_VOIP
 #include "media-factory.h"
+#endif
 
 const CapabilityConversionData capabilities_conversions[] =
 {
+#ifdef ENABLE_VOIP
   { TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
     _gabble_media_factory_typeflags_to_caps,
     _gabble_media_factory_caps_to_typeflags },
+#endif
   { NULL, NULL, NULL}
 };
diff -Nru telepathy-gabble-0.15.4/src/Makefile.am telepathy-gabble-0.16.0/src/Makefile.am
--- telepathy-gabble-0.15.4/src/Makefile.am	2012-02-21 20:29:25.000000000 +0000
+++ telepathy-gabble-0.16.0/src/Makefile.am	2012-04-02 20:49:19.000000000 +0000
@@ -19,8 +19,6 @@
     auth-manager.c \
     base64.h \
     base64.c \
-    base-call-channel.h \
-    base-call-channel.c \
     bytestream-factory.h \
     bytestream-factory.c \
     bytestream-ibb.h \
@@ -33,18 +31,6 @@
     bytestream-multiple.c \
     bytestream-socks5.h \
     bytestream-socks5.c \
-    call-content.h \
-    call-content.c \
-    call-channel.h \
-    call-channel.c \
-    call-muc-channel.h \
-    call-muc-channel.c \
-    call-member.h \
-    call-member.c \
-    call-member-content.h \
-    call-member-content.c \
-    call-stream.h \
-    call-stream.c \
     capabilities.c \
     caps-hash.h \
     caps-hash.c \
@@ -85,46 +71,22 @@
     error.h \
     gabble.c \
     gabble.h \
-    google-relay.c \
-    google-relay.h \
     im-channel.h \
     im-channel.c \
     im-factory.h \
     im-factory.c \
-    jingle-content.h \
-    jingle-content.c \
-    jingle-factory.h \
-    jingle-factory.c \
-    jingle-share.h \
-    jingle-share.c \
-    jingle-media-rtp.h \
-    jingle-media-rtp.c \
-    jingle-session.h \
-    jingle-session.c \
-    jingle-transport-google.h \
-    jingle-transport-google.c \
-    jingle-transport-rawudp.h \
-    jingle-transport-rawudp.c \
-    jingle-transport-iceudp.h \
-    jingle-transport-iceudp.c \
-    jingle-transport-iface.h \
-    jingle-transport-iface.c \
     legacy-caps.h \
     legacy-caps.c \
-    media-channel.h \
-    media-channel-internal.h \
-    media-channel.c \
-    media-channel-hold.c \
-    media-stream.h \
-    media-stream.c \
-    media-factory.h \
-    media-factory.c \
     message-util.h \
     message-util.c \
     muc-channel.h \
     muc-channel.c \
     muc-factory.h \
     muc-factory.c \
+    muc-tube-dbus.h \
+    muc-tube-dbus.c \
+    muc-tube-stream.h \
+    muc-tube-stream.c \
     namespaces.h \
     olpc-activity.h \
     olpc-activity.c \
@@ -180,22 +142,71 @@
     ft-channel.c \
     ft-channel.h \
     ft-manager.c \
-    ft-manager.h \
-    gtalk-file-collection.h \
-    gtalk-file-collection.c
-else
-EXTRA_DIST += \
-    ft-channel.c \
-    ft-channel.h \
-    ft-manager.c \
-    ft-manager.h \
-    gtalk-file-collection.h \
-    gtalk-file-collection.c
+    ft-manager.h
+endif
+
+if ENABLE_VOIP
+libgabble_convenience_la_SOURCES += \
+    base-call-channel.h \
+    base-call-channel.c \
+    call-content.h \
+    call-content.c \
+    call-channel.h \
+    call-channel.c \
+    call-muc-channel.h \
+    call-muc-channel.c \
+    call-member.h \
+    call-member.c \
+    call-member-content.h \
+    call-member-content.c \
+    call-stream.h \
+    call-stream.c \
+    google-relay.c \
+    google-relay.h \
+    jingle-content.h \
+    jingle-content.c \
+    jingle-factory.h \
+    jingle-factory.c \
+    jingle-info.c \
+    jingle-info.h \
+    jingle-share.h \
+    jingle-share.c \
+    jingle-media-rtp.h \
+    jingle-media-rtp.c \
+    jingle-mint.h \
+    jingle-mint.c \
+    jingle-session.h \
+    jingle-session.c \
+    jingle-tp-util.h \
+    jingle-tp-util.c \
+    jingle-transport-google.h \
+    jingle-transport-google.c \
+    jingle-transport-rawudp.h \
+    jingle-transport-rawudp.c \
+    jingle-transport-iceudp.h \
+    jingle-transport-iceudp.c \
+    jingle-transport-iface.h \
+    jingle-transport-iface.c \
+    jingle-types.h \
+    media-channel.h \
+    media-channel-internal.h \
+    media-channel.c \
+    media-channel-hold.c \
+    media-stream.h \
+    media-stream.c \
+    media-factory.h \
+    media-factory.c
+endif
+
+if ENABLE_JINGLE_FILE_TRANSFER
+libgabble_convenience_la_SOURCES += \
+    gtalk-file-collection.c \
+    gtalk-file-collection.h
 endif
 
 enumtype_sources = \
     $(top_srcdir)/src/connection.h \
-    $(top_srcdir)/src/jingle-factory.h \
+    $(top_srcdir)/src/jingle-types.h \
     $(top_srcdir)/src/room-config.h \
     $(top_srcdir)/src/presence.h
 
@@ -228,9 +239,15 @@
 
 noinst_LTLIBRARIES = libgabble-convenience.la
 
-lib_LTLIBRARIES = libgabble-plugins.la
+pluginexeclib_LTLIBRARIES = libgabble-plugins.la
 
-libgabble_plugins_la_LDFLAGS = -shared -no-undefined -avoid-version
+# Gabble's plugin API is not stable yet (it can't be, since neither is Wocky),
+# so use -release to make the SONAME of the plugin library change with every
+# Gabble release.
+libgabble_plugins_la_LDFLAGS = \
+   -no-undefined \
+   -release $(VERSION) \
+   $(NULL)
 
 libgabble_plugins_la_LIBADD = \
    $(ALL_LIBS)
@@ -250,7 +267,7 @@
 	    @SOUP_CFLAGS@ @NICE_CFLAGS@ @GMODULE_CFLAGS@ \
 	    -I $(top_srcdir)/lib -I $(top_builddir)/lib \
 	    -DG_LOG_DOMAIN=\"gabble\" \
-	    -DPLUGIN_DIR=\"$(libdir)/telepathy/gabble-0\"
+	    -DPLUGIN_DIR=\"$(pluginexecdir)\"
 
 # following flag is requied to make getnameinfo work
 if WINDOWS
diff -Nru telepathy-gabble-0.15.4/src/Makefile.in telepathy-gabble-0.16.0/src/Makefile.in
--- telepathy-gabble-0.15.4/src/Makefile.in	2012-02-21 20:31:34.000000000 +0000
+++ telepathy-gabble-0.16.0/src/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -41,23 +41,68 @@
 @ENABLE_FILE_TRANSFER_TRUE@    ft-channel.c \
 @ENABLE_FILE_TRANSFER_TRUE@    ft-channel.h \
 @ENABLE_FILE_TRANSFER_TRUE@    ft-manager.c \
-@ENABLE_FILE_TRANSFER_TRUE@    ft-manager.h \
-@ENABLE_FILE_TRANSFER_TRUE@    gtalk-file-collection.h \
-@ENABLE_FILE_TRANSFER_TRUE@    gtalk-file-collection.c
-
-@ENABLE_FILE_TRANSFER_FALSE@am__append_2 = \
-@ENABLE_FILE_TRANSFER_FALSE@    ft-channel.c \
-@ENABLE_FILE_TRANSFER_FALSE@    ft-channel.h \
-@ENABLE_FILE_TRANSFER_FALSE@    ft-manager.c \
-@ENABLE_FILE_TRANSFER_FALSE@    ft-manager.h \
-@ENABLE_FILE_TRANSFER_FALSE@    gtalk-file-collection.h \
-@ENABLE_FILE_TRANSFER_FALSE@    gtalk-file-collection.c
+@ENABLE_FILE_TRANSFER_TRUE@    ft-manager.h
+
+@ENABLE_VOIP_TRUE@am__append_2 = \
+@ENABLE_VOIP_TRUE@    base-call-channel.h \
+@ENABLE_VOIP_TRUE@    base-call-channel.c \
+@ENABLE_VOIP_TRUE@    call-content.h \
+@ENABLE_VOIP_TRUE@    call-content.c \
+@ENABLE_VOIP_TRUE@    call-channel.h \
+@ENABLE_VOIP_TRUE@    call-channel.c \
+@ENABLE_VOIP_TRUE@    call-muc-channel.h \
+@ENABLE_VOIP_TRUE@    call-muc-channel.c \
+@ENABLE_VOIP_TRUE@    call-member.h \
+@ENABLE_VOIP_TRUE@    call-member.c \
+@ENABLE_VOIP_TRUE@    call-member-content.h \
+@ENABLE_VOIP_TRUE@    call-member-content.c \
+@ENABLE_VOIP_TRUE@    call-stream.h \
+@ENABLE_VOIP_TRUE@    call-stream.c \
+@ENABLE_VOIP_TRUE@    google-relay.c \
+@ENABLE_VOIP_TRUE@    google-relay.h \
+@ENABLE_VOIP_TRUE@    jingle-content.h \
+@ENABLE_VOIP_TRUE@    jingle-content.c \
+@ENABLE_VOIP_TRUE@    jingle-factory.h \
+@ENABLE_VOIP_TRUE@    jingle-factory.c \
+@ENABLE_VOIP_TRUE@    jingle-info.c \
+@ENABLE_VOIP_TRUE@    jingle-info.h \
+@ENABLE_VOIP_TRUE@    jingle-share.h \
+@ENABLE_VOIP_TRUE@    jingle-share.c \
+@ENABLE_VOIP_TRUE@    jingle-media-rtp.h \
+@ENABLE_VOIP_TRUE@    jingle-media-rtp.c \
+@ENABLE_VOIP_TRUE@    jingle-mint.h \
+@ENABLE_VOIP_TRUE@    jingle-mint.c \
+@ENABLE_VOIP_TRUE@    jingle-session.h \
+@ENABLE_VOIP_TRUE@    jingle-session.c \
+@ENABLE_VOIP_TRUE@    jingle-tp-util.h \
+@ENABLE_VOIP_TRUE@    jingle-tp-util.c \
+@ENABLE_VOIP_TRUE@    jingle-transport-google.h \
+@ENABLE_VOIP_TRUE@    jingle-transport-google.c \
+@ENABLE_VOIP_TRUE@    jingle-transport-rawudp.h \
+@ENABLE_VOIP_TRUE@    jingle-transport-rawudp.c \
+@ENABLE_VOIP_TRUE@    jingle-transport-iceudp.h \
+@ENABLE_VOIP_TRUE@    jingle-transport-iceudp.c \
+@ENABLE_VOIP_TRUE@    jingle-transport-iface.h \
+@ENABLE_VOIP_TRUE@    jingle-transport-iface.c \
+@ENABLE_VOIP_TRUE@    jingle-types.h \
+@ENABLE_VOIP_TRUE@    media-channel.h \
+@ENABLE_VOIP_TRUE@    media-channel-internal.h \
+@ENABLE_VOIP_TRUE@    media-channel.c \
+@ENABLE_VOIP_TRUE@    media-channel-hold.c \
+@ENABLE_VOIP_TRUE@    media-stream.h \
+@ENABLE_VOIP_TRUE@    media-stream.c \
+@ENABLE_VOIP_TRUE@    media-factory.h \
+@ENABLE_VOIP_TRUE@    media-factory.c
+
+@ENABLE_JINGLE_FILE_TRANSFER_TRUE@am__append_3 = \
+@ENABLE_JINGLE_FILE_TRANSFER_TRUE@    gtalk-file-collection.c \
+@ENABLE_JINGLE_FILE_TRANSFER_TRUE@    gtalk-file-collection.h
 
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(top_srcdir)/tools/check-coding-style.mk
 
 # following flag is requied to make getnameinfo work
-@WINDOWS_TRUE@am__append_3 = -D_WIN32_WINNT=0x0501
+@WINDOWS_TRUE@am__append_4 = -D_WIN32_WINNT=0x0501
 subdir = src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_config_dir.m4 \
@@ -100,8 +145,9 @@
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)"
-LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+am__installdirs = "$(DESTDIR)$(pluginexeclibdir)" \
+	"$(DESTDIR)$(libexecdir)"
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(pluginexeclib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libgabble_convenience_la_DEPENDENCIES =  \
 	$(top_builddir)/extensions/libgabble-extensions.la \
@@ -109,38 +155,26 @@
 	$(am__DEPENDENCIES_1)
 am__libgabble_convenience_la_SOURCES_DIST = addressing-util.h \
 	addressing-util.c auth-manager.h auth-manager.c base64.h \
-	base64.c base-call-channel.h base-call-channel.c \
-	bytestream-factory.h bytestream-factory.c bytestream-ibb.h \
-	bytestream-ibb.c bytestream-iface.h bytestream-iface.c \
-	bytestream-muc.h bytestream-muc.c bytestream-multiple.h \
-	bytestream-multiple.c bytestream-socks5.h bytestream-socks5.c \
-	call-content.h call-content.c call-channel.h call-channel.c \
-	call-muc-channel.h call-muc-channel.c call-member.h \
-	call-member.c call-member-content.h call-member-content.c \
-	call-stream.h call-stream.c capabilities.c caps-hash.h \
-	caps-hash.c caps-channel-manager.c conn-addressing.h \
-	conn-addressing.c conn-aliasing.h conn-aliasing.c \
-	conn-avatars.h conn-avatars.c conn-client-types.h \
-	conn-client-types.c conn-contact-info.h conn-contact-info.c \
-	conn-location.h conn-location.c conn-olpc.h conn-olpc.c \
-	conn-power-saving.h conn-power-saving.c conn-presence.h \
-	conn-presence.c conn-sidecars.h conn-sidecars.c conn-util.h \
-	conn-util.c conn-mail-notif.h conn-mail-notif.c connection.h \
-	connection.c connection-manager.h connection-manager.c debug.h \
-	debug.c disco.h disco.c error.c error.h gabble.c gabble.h \
-	google-relay.c google-relay.h im-channel.h im-channel.c \
-	im-factory.h im-factory.c jingle-content.h jingle-content.c \
-	jingle-factory.h jingle-factory.c jingle-share.h \
-	jingle-share.c jingle-media-rtp.h jingle-media-rtp.c \
-	jingle-session.h jingle-session.c jingle-transport-google.h \
-	jingle-transport-google.c jingle-transport-rawudp.h \
-	jingle-transport-rawudp.c jingle-transport-iceudp.h \
-	jingle-transport-iceudp.c jingle-transport-iface.h \
-	jingle-transport-iface.c legacy-caps.h legacy-caps.c \
-	media-channel.h media-channel-internal.h media-channel.c \
-	media-channel-hold.c media-stream.h media-stream.c \
-	media-factory.h media-factory.c message-util.h message-util.c \
-	muc-channel.h muc-channel.c muc-factory.h muc-factory.c \
+	base64.c bytestream-factory.h bytestream-factory.c \
+	bytestream-ibb.h bytestream-ibb.c bytestream-iface.h \
+	bytestream-iface.c bytestream-muc.h bytestream-muc.c \
+	bytestream-multiple.h bytestream-multiple.c \
+	bytestream-socks5.h bytestream-socks5.c capabilities.c \
+	caps-hash.h caps-hash.c caps-channel-manager.c \
+	conn-addressing.h conn-addressing.c conn-aliasing.h \
+	conn-aliasing.c conn-avatars.h conn-avatars.c \
+	conn-client-types.h conn-client-types.c conn-contact-info.h \
+	conn-contact-info.c conn-location.h conn-location.c \
+	conn-olpc.h conn-olpc.c conn-power-saving.h \
+	conn-power-saving.c conn-presence.h conn-presence.c \
+	conn-sidecars.h conn-sidecars.c conn-util.h conn-util.c \
+	conn-mail-notif.h conn-mail-notif.c connection.h connection.c \
+	connection-manager.h connection-manager.c debug.h debug.c \
+	disco.h disco.c error.c error.h gabble.c gabble.h im-channel.h \
+	im-channel.c im-factory.h im-factory.c legacy-caps.h \
+	legacy-caps.c message-util.h message-util.c muc-channel.h \
+	muc-channel.c muc-factory.h muc-factory.c muc-tube-dbus.h \
+	muc-tube-dbus.c muc-tube-stream.h muc-tube-stream.c \
 	namespaces.h olpc-activity.h olpc-activity.c plugin-loader.h \
 	plugin-loader.c presence.h presence.c presence-cache.h \
 	presence-cache.c protocol.h protocol.c private-tubes-factory.h \
@@ -155,38 +189,64 @@
 	tube-iface.c tubes-channel.h tubes-channel.c tube-dbus.h \
 	tube-dbus.c tube-stream.h tube-stream.c types.h util.h util.c \
 	vcard-manager.h vcard-manager.c ft-channel.c ft-channel.h \
-	ft-manager.c ft-manager.h gtalk-file-collection.h \
-	gtalk-file-collection.c
-@ENABLE_FILE_TRANSFER_TRUE@am__objects_1 = ft-channel.lo ft-manager.lo \
-@ENABLE_FILE_TRANSFER_TRUE@	gtalk-file-collection.lo
+	ft-manager.c ft-manager.h base-call-channel.h \
+	base-call-channel.c call-content.h call-content.c \
+	call-channel.h call-channel.c call-muc-channel.h \
+	call-muc-channel.c call-member.h call-member.c \
+	call-member-content.h call-member-content.c call-stream.h \
+	call-stream.c google-relay.c google-relay.h jingle-content.h \
+	jingle-content.c jingle-factory.h jingle-factory.c \
+	jingle-info.c jingle-info.h jingle-share.h jingle-share.c \
+	jingle-media-rtp.h jingle-media-rtp.c jingle-mint.h \
+	jingle-mint.c jingle-session.h jingle-session.c \
+	jingle-tp-util.h jingle-tp-util.c jingle-transport-google.h \
+	jingle-transport-google.c jingle-transport-rawudp.h \
+	jingle-transport-rawudp.c jingle-transport-iceudp.h \
+	jingle-transport-iceudp.c jingle-transport-iface.h \
+	jingle-transport-iface.c jingle-types.h media-channel.h \
+	media-channel-internal.h media-channel.c media-channel-hold.c \
+	media-stream.h media-stream.c media-factory.h media-factory.c \
+	gtalk-file-collection.c gtalk-file-collection.h
+@ENABLE_FILE_TRANSFER_TRUE@am__objects_1 = ft-channel.lo ft-manager.lo
+@ENABLE_VOIP_TRUE@am__objects_2 = base-call-channel.lo call-content.lo \
+@ENABLE_VOIP_TRUE@	call-channel.lo call-muc-channel.lo \
+@ENABLE_VOIP_TRUE@	call-member.lo call-member-content.lo \
+@ENABLE_VOIP_TRUE@	call-stream.lo google-relay.lo \
+@ENABLE_VOIP_TRUE@	jingle-content.lo jingle-factory.lo \
+@ENABLE_VOIP_TRUE@	jingle-info.lo jingle-share.lo \
+@ENABLE_VOIP_TRUE@	jingle-media-rtp.lo jingle-mint.lo \
+@ENABLE_VOIP_TRUE@	jingle-session.lo jingle-tp-util.lo \
+@ENABLE_VOIP_TRUE@	jingle-transport-google.lo \
+@ENABLE_VOIP_TRUE@	jingle-transport-rawudp.lo \
+@ENABLE_VOIP_TRUE@	jingle-transport-iceudp.lo \
+@ENABLE_VOIP_TRUE@	jingle-transport-iface.lo media-channel.lo \
+@ENABLE_VOIP_TRUE@	media-channel-hold.lo media-stream.lo \
+@ENABLE_VOIP_TRUE@	media-factory.lo
+@ENABLE_JINGLE_FILE_TRANSFER_TRUE@am__objects_3 =  \
+@ENABLE_JINGLE_FILE_TRANSFER_TRUE@	gtalk-file-collection.lo
 am_libgabble_convenience_la_OBJECTS = addressing-util.lo \
-	auth-manager.lo base64.lo base-call-channel.lo \
-	bytestream-factory.lo bytestream-ibb.lo bytestream-iface.lo \
-	bytestream-muc.lo bytestream-multiple.lo bytestream-socks5.lo \
-	call-content.lo call-channel.lo call-muc-channel.lo \
-	call-member.lo call-member-content.lo call-stream.lo \
-	capabilities.lo caps-hash.lo caps-channel-manager.lo \
-	conn-addressing.lo conn-aliasing.lo conn-avatars.lo \
-	conn-client-types.lo conn-contact-info.lo conn-location.lo \
-	conn-olpc.lo conn-power-saving.lo conn-presence.lo \
-	conn-sidecars.lo conn-util.lo conn-mail-notif.lo connection.lo \
+	auth-manager.lo base64.lo bytestream-factory.lo \
+	bytestream-ibb.lo bytestream-iface.lo bytestream-muc.lo \
+	bytestream-multiple.lo bytestream-socks5.lo capabilities.lo \
+	caps-hash.lo caps-channel-manager.lo conn-addressing.lo \
+	conn-aliasing.lo conn-avatars.lo conn-client-types.lo \
+	conn-contact-info.lo conn-location.lo conn-olpc.lo \
+	conn-power-saving.lo conn-presence.lo conn-sidecars.lo \
+	conn-util.lo conn-mail-notif.lo connection.lo \
 	connection-manager.lo debug.lo disco.lo error.lo gabble.lo \
-	google-relay.lo im-channel.lo im-factory.lo jingle-content.lo \
-	jingle-factory.lo jingle-share.lo jingle-media-rtp.lo \
-	jingle-session.lo jingle-transport-google.lo \
-	jingle-transport-rawudp.lo jingle-transport-iceudp.lo \
-	jingle-transport-iface.lo legacy-caps.lo media-channel.lo \
-	media-channel-hold.lo media-stream.lo media-factory.lo \
-	message-util.lo muc-channel.lo muc-factory.lo olpc-activity.lo \
-	plugin-loader.lo presence.lo presence-cache.lo protocol.lo \
+	im-channel.lo im-factory.lo legacy-caps.lo message-util.lo \
+	muc-channel.lo muc-factory.lo muc-tube-dbus.lo \
+	muc-tube-stream.lo olpc-activity.lo plugin-loader.lo \
+	presence.lo presence-cache.lo protocol.lo \
 	private-tubes-factory.lo request-pipeline.lo roster.lo \
 	room-config.lo roomlist-channel.lo roomlist-manager.lo \
 	search-channel.lo search-manager.lo server-sasl-channel.lo \
 	server-tls-channel.lo server-tls-manager.lo sidecar.lo \
 	tls-certificate.lo tube-iface.lo tubes-channel.lo tube-dbus.lo \
-	tube-stream.lo util.lo vcard-manager.lo $(am__objects_1)
-am__objects_2 = gabble-signals-marshal.lo gabble-enumtypes.lo
-nodist_libgabble_convenience_la_OBJECTS = $(am__objects_2)
+	tube-stream.lo util.lo vcard-manager.lo $(am__objects_1) \
+	$(am__objects_2) $(am__objects_3)
+am__objects_4 = gabble-signals-marshal.lo gabble-enumtypes.lo
+nodist_libgabble_convenience_la_OBJECTS = $(am__objects_4)
 libgabble_convenience_la_OBJECTS =  \
 	$(am_libgabble_convenience_la_OBJECTS) \
 	$(nodist_libgabble_convenience_la_OBJECTS)
@@ -384,6 +444,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -405,41 +467,28 @@
     gabble-enumtypes.c
 
 CLEANFILES = $(BUILT_SOURCES)
-EXTRA_DIST = $(am__append_2)
+EXTRA_DIST = 
 libgabble_convenience_la_SOURCES = addressing-util.h addressing-util.c \
 	auth-manager.h auth-manager.c base64.h base64.c \
-	base-call-channel.h base-call-channel.c bytestream-factory.h \
-	bytestream-factory.c bytestream-ibb.h bytestream-ibb.c \
-	bytestream-iface.h bytestream-iface.c bytestream-muc.h \
-	bytestream-muc.c bytestream-multiple.h bytestream-multiple.c \
-	bytestream-socks5.h bytestream-socks5.c call-content.h \
-	call-content.c call-channel.h call-channel.c \
-	call-muc-channel.h call-muc-channel.c call-member.h \
-	call-member.c call-member-content.h call-member-content.c \
-	call-stream.h call-stream.c capabilities.c caps-hash.h \
-	caps-hash.c caps-channel-manager.c conn-addressing.h \
-	conn-addressing.c conn-aliasing.h conn-aliasing.c \
-	conn-avatars.h conn-avatars.c conn-client-types.h \
-	conn-client-types.c conn-contact-info.h conn-contact-info.c \
-	conn-location.h conn-location.c conn-olpc.h conn-olpc.c \
-	conn-power-saving.h conn-power-saving.c conn-presence.h \
-	conn-presence.c conn-sidecars.h conn-sidecars.c conn-util.h \
-	conn-util.c conn-mail-notif.h conn-mail-notif.c connection.h \
-	connection.c connection-manager.h connection-manager.c debug.h \
-	debug.c disco.h disco.c error.c error.h gabble.c gabble.h \
-	google-relay.c google-relay.h im-channel.h im-channel.c \
-	im-factory.h im-factory.c jingle-content.h jingle-content.c \
-	jingle-factory.h jingle-factory.c jingle-share.h \
-	jingle-share.c jingle-media-rtp.h jingle-media-rtp.c \
-	jingle-session.h jingle-session.c jingle-transport-google.h \
-	jingle-transport-google.c jingle-transport-rawudp.h \
-	jingle-transport-rawudp.c jingle-transport-iceudp.h \
-	jingle-transport-iceudp.c jingle-transport-iface.h \
-	jingle-transport-iface.c legacy-caps.h legacy-caps.c \
-	media-channel.h media-channel-internal.h media-channel.c \
-	media-channel-hold.c media-stream.h media-stream.c \
-	media-factory.h media-factory.c message-util.h message-util.c \
-	muc-channel.h muc-channel.c muc-factory.h muc-factory.c \
+	bytestream-factory.h bytestream-factory.c bytestream-ibb.h \
+	bytestream-ibb.c bytestream-iface.h bytestream-iface.c \
+	bytestream-muc.h bytestream-muc.c bytestream-multiple.h \
+	bytestream-multiple.c bytestream-socks5.h bytestream-socks5.c \
+	capabilities.c caps-hash.h caps-hash.c caps-channel-manager.c \
+	conn-addressing.h conn-addressing.c conn-aliasing.h \
+	conn-aliasing.c conn-avatars.h conn-avatars.c \
+	conn-client-types.h conn-client-types.c conn-contact-info.h \
+	conn-contact-info.c conn-location.h conn-location.c \
+	conn-olpc.h conn-olpc.c conn-power-saving.h \
+	conn-power-saving.c conn-presence.h conn-presence.c \
+	conn-sidecars.h conn-sidecars.c conn-util.h conn-util.c \
+	conn-mail-notif.h conn-mail-notif.c connection.h connection.c \
+	connection-manager.h connection-manager.c debug.h debug.c \
+	disco.h disco.c error.c error.h gabble.c gabble.h im-channel.h \
+	im-channel.c im-factory.h im-factory.c legacy-caps.h \
+	legacy-caps.c message-util.h message-util.c muc-channel.h \
+	muc-channel.c muc-factory.h muc-factory.c muc-tube-dbus.h \
+	muc-tube-dbus.c muc-tube-stream.h muc-tube-stream.c \
 	namespaces.h olpc-activity.h olpc-activity.c plugin-loader.h \
 	plugin-loader.c presence.h presence.c presence-cache.h \
 	presence-cache.c protocol.h protocol.c private-tubes-factory.h \
@@ -453,10 +502,11 @@
 	sidecar.c tls-certificate.h tls-certificate.c tube-iface.h \
 	tube-iface.c tubes-channel.h tubes-channel.c tube-dbus.h \
 	tube-dbus.c tube-stream.h tube-stream.c types.h util.h util.c \
-	vcard-manager.h vcard-manager.c $(am__append_1)
+	vcard-manager.h vcard-manager.c $(am__append_1) \
+	$(am__append_2) $(am__append_3)
 enumtype_sources = \
     $(top_srcdir)/src/connection.h \
-    $(top_srcdir)/src/jingle-factory.h \
+    $(top_srcdir)/src/jingle-types.h \
     $(top_srcdir)/src/room-config.h \
     $(top_srcdir)/src/presence.h
 
@@ -482,8 +532,16 @@
 telepathy_gabble_LDADD = libgabble-convenience.la
 telepathy_gabble_LDFLAGS = -export-dynamic
 noinst_LTLIBRARIES = libgabble-convenience.la
-lib_LTLIBRARIES = libgabble-plugins.la
-libgabble_plugins_la_LDFLAGS = -shared -no-undefined -avoid-version
+pluginexeclib_LTLIBRARIES = libgabble-plugins.la
+
+# Gabble's plugin API is not stable yet (it can't be, since neither is Wocky),
+# so use -release to make the SONAME of the plugin library change with every
+# Gabble release.
+libgabble_plugins_la_LDFLAGS = \
+   -no-undefined \
+   -release $(VERSION) \
+   $(NULL)
+
 libgabble_plugins_la_LIBADD = \
    $(ALL_LIBS)
 
@@ -500,8 +558,8 @@
 	@DBUS_CFLAGS@ @GLIB_CFLAGS@ @WOCKY_CFLAGS@ @TP_GLIB_CFLAGS@ \
 	@SOUP_CFLAGS@ @NICE_CFLAGS@ @GMODULE_CFLAGS@ -I \
 	$(top_srcdir)/lib -I $(top_builddir)/lib \
-	-DG_LOG_DOMAIN=\"gabble\" \
-	-DPLUGIN_DIR=\"$(libdir)/telepathy/gabble-0\" $(am__append_3)
+	-DG_LOG_DOMAIN=\"gabble\" -DPLUGIN_DIR=\"$(pluginexecdir)\" \
+	$(am__append_4)
 ALL_LIBS = @DBUS_LIBS@ @GLIB_LIBS@ @WOCKY_LIBS@ @TP_GLIB_LIBS@ \
 	    @SOUP_LIBS@ @NICE_LIBS@ @GMODULE_LIBS@
 
@@ -541,41 +599,41 @@
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+install-pluginexeclibLTLIBRARIES: $(pluginexeclib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	test -z "$(pluginexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(pluginexeclibdir)"
+	@list='$(pluginexeclib_LTLIBRARIES)'; test -n "$(pluginexeclibdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
 	    list2="$$list2 $$p"; \
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pluginexeclibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pluginexeclibdir)"; \
 	}
 
-uninstall-libLTLIBRARIES:
+uninstall-pluginexeclibLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	@list='$(pluginexeclib_LTLIBRARIES)'; test -n "$(pluginexeclibdir)" || list=; \
 	for p in $$list; do \
 	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pluginexeclibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pluginexeclibdir)/$$f"; \
 	done
 
-clean-libLTLIBRARIES:
-	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-
-clean-noinstLTLIBRARIES:
-	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+clean-pluginexeclibLTLIBRARIES:
+	-test -z "$(pluginexeclib_LTLIBRARIES)" || rm -f $(pluginexeclib_LTLIBRARIES)
+	@list='$(pluginexeclib_LTLIBRARIES)'; for p in $$list; do \
 	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
 	  test "$$dir" != "$$p" || dir=.; \
 	  echo "rm -f \"$${dir}/so_locations\""; \
@@ -584,7 +642,7 @@
 libgabble-convenience.la: $(libgabble_convenience_la_OBJECTS) $(libgabble_convenience_la_DEPENDENCIES) $(EXTRA_libgabble_convenience_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(LINK)  $(libgabble_convenience_la_OBJECTS) $(libgabble_convenience_la_LIBADD) $(LIBS)
 libgabble-plugins.la: $(libgabble_plugins_la_OBJECTS) $(libgabble_plugins_la_DEPENDENCIES) $(EXTRA_libgabble_plugins_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(libgabble_plugins_la_LINK) -rpath $(libdir) $(libgabble_plugins_la_OBJECTS) $(libgabble_plugins_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(libgabble_plugins_la_LINK) -rpath $(pluginexeclibdir) $(libgabble_plugins_la_OBJECTS) $(libgabble_plugins_la_LIBADD) $(LIBS)
 install-libexecPROGRAMS: $(libexec_PROGRAMS)
 	@$(NORMAL_INSTALL)
 	test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
@@ -697,9 +755,12 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/im-factory.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-content.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-factory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-info.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-media-rtp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-mint.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-session.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-share.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-tp-util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-transport-google.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-transport-iceudp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jingle-transport-iface.Plo@am__quote@
@@ -713,6 +774,8 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message-util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muc-channel.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muc-factory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muc-tube-dbus.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muc-tube-stream.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/olpc-activity.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin-connection.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin-loader.Plo@am__quote@
@@ -856,7 +919,7 @@
 	$(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)"; do \
+	for dir in "$(DESTDIR)$(pluginexeclibdir)" "$(DESTDIR)$(libexecdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: $(BUILT_SOURCES)
@@ -894,9 +957,9 @@
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \
-	clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
-	mostlyclean-am
+clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
+	clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+	clean-pluginexeclibLTLIBRARIES mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
@@ -922,7 +985,8 @@
 
 install-dvi-am:
 
-install-exec-am: install-libLTLIBRARIES install-libexecPROGRAMS
+install-exec-am: install-libexecPROGRAMS \
+	install-pluginexeclibLTLIBRARIES
 
 install-html: install-html-am
 
@@ -962,26 +1026,27 @@
 
 ps-am:
 
-uninstall-am: uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS
+uninstall-am: uninstall-libexecPROGRAMS \
+	uninstall-pluginexeclibLTLIBRARIES
 
 .MAKE: all check check-am install install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
-	clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \
-	clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
-	ctags distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-libLTLIBRARIES install-libexecPROGRAMS \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-libLTLIBRARIES \
-	uninstall-libexecPROGRAMS
+	clean-generic clean-libexecPROGRAMS clean-libtool \
+	clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+	clean-pluginexeclibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am \
+	install-libexecPROGRAMS install-man install-pdf install-pdf-am \
+	install-pluginexeclibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-libexecPROGRAMS uninstall-pluginexeclibLTLIBRARIES
 
 check-coding-style:
 	@fail=0; \
diff -Nru telepathy-gabble-0.15.4/src/media-channel.c telepathy-gabble-0.16.0/src/media-channel.c
--- telepathy-gabble-0.15.4/src/media-channel.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/media-channel.c	2012-03-07 20:26:07.000000000 +0000
@@ -43,6 +43,7 @@
 #include "jingle-factory.h"
 #include "jingle-media-rtp.h"
 #include "jingle-session.h"
+#include "jingle-tp-util.h"
 #include "media-factory.h"
 #include "media-stream.h"
 #include "namespaces.h"
@@ -301,19 +302,21 @@
 
 static void
 create_session (GabbleMediaChannel *chan,
-    TpHandle peer,
-    const gchar *jid)
+    const gchar *jid,
+    JingleDialect dialect)
 {
   GabbleMediaChannelPrivate *priv = chan->priv;
   gboolean local_hold = (priv->hold_state != TP_LOCAL_HOLD_STATE_UNHELD);
+  GabbleJingleFactory *jf;
 
   g_assert (priv->session == NULL);
 
   DEBUG ("%p: Creating new outgoing session", chan);
 
+  jf = gabble_jingle_mint_get_factory (priv->conn->jingle_mint);
+  g_return_if_fail (jf != NULL);
   priv->session = g_object_ref (
-      gabble_jingle_factory_create_session (priv->conn->jingle_factory,
-          peer, jid, local_hold));
+      gabble_jingle_factory_create_session (jf, jid, dialect, local_hold));
 
   _latch_to_session (chan);
 }
@@ -328,7 +331,7 @@
   TpDBusDaemon *bus;
   TpIntSet *set;
   TpHandleRepoIface *contact_handles;
-  GabbleJingleFactory *jf;
+  GabbleJingleInfo *ji;
   const gchar *relay_token;
   gchar *stun_server;
   guint stun_port;
@@ -349,9 +352,16 @@
       contact_handles, conn->self_handle);
 
   if (priv->session != NULL)
-      priv->creator = priv->session->peer;
+    {
+      priv->peer = ensure_handle_from_contact (priv->conn,
+          gabble_jingle_session_get_peer_contact (priv->session));
+      g_return_val_if_fail (priv->peer != 0, NULL);
+      priv->creator = priv->peer;
+    }
   else
+    {
       priv->creator = conn->self_handle;
+    }
 
   /* automatically add creator to channel, but also ref them again (because
    * priv->creator is the InitiatorHandle) */
@@ -374,9 +384,9 @@
       0);
 
   /* Set up Google relay related properties */
-  jf = priv->conn->jingle_factory;
+  ji = gabble_jingle_mint_get_info (priv->conn->jingle_mint);
 
-  if (gabble_jingle_factory_get_stun_server (jf, &stun_server,
+  if (gabble_jingle_info_get_stun_server (ji, &stun_server,
         &stun_port))
     {
       g_object_set (obj,
@@ -386,7 +396,7 @@
       g_free (stun_server);
     }
 
-  relay_token = gabble_jingle_factory_get_google_relay_token (jf);
+  relay_token = gabble_jingle_info_get_google_relay_token (ji);
 
   if (relay_token != NULL)
     {
@@ -403,7 +413,7 @@
        */
       set = tp_intset_new_containing (conn->self_handle);
       tp_group_mixin_change_members (obj, "", NULL, NULL, set, NULL,
-          priv->session->peer, TP_CHANNEL_GROUP_CHANGE_REASON_INVITED);
+          priv->peer, TP_CHANNEL_GROUP_CHANGE_REASON_INVITED);
       tp_intset_destroy (set);
 
       /* Set up signal callbacks, emit session handler, initialize streams,
@@ -534,10 +544,8 @@
 
         if (priv->initial_peer != 0)
           peer = priv->initial_peer;
-        else if (priv->session != NULL)
-          g_object_get (priv->session,
-              "peer", &peer,
-              NULL);
+        else
+          peer = priv->peer;
 
         g_value_set_uint (value, peer);
         break;
@@ -1134,16 +1142,11 @@
   if (priv->session)
     {
       GValue handler = { 0, };
-      TpHandle member;
 
       g_value_init (&handler, info_type);
       g_value_take_boxed (&handler,
           dbus_g_type_specialized_construct (info_type));
 
-      g_object_get (priv->session,
-                    "peer", &member,
-                    NULL);
-
       dbus_g_type_struct_set (&handler,
           0, priv->object_path,
           1, "rtp",
@@ -1188,7 +1191,6 @@
     {
       GValue entry = { 0, };
       guint id;
-      TpHandle peer;
       TpMediaStreamType type;
       TpMediaStreamState connection_state;
       CombinedStreamDirection combined_direction;
@@ -1200,15 +1202,13 @@
           "combined-direction", &combined_direction,
           NULL);
 
-      g_object_get (priv->session, "peer", &peer, NULL);
-
       g_value_init (&entry, info_type);
       g_value_take_boxed (&entry,
           dbus_g_type_specialized_construct (info_type));
 
       dbus_g_type_struct_set (&entry,
           0, id,
-          1, peer,
+          1, priv->peer,
           2, type,
           3, connection_state,
           4, COMBINED_DIRECTION_GET_DIRECTION (combined_direction),
@@ -1709,11 +1709,10 @@
           transport_ns, dialect);
 
       jid = gabble_peer_to_jid (priv->conn, peer, peer_resource);
-      create_session (chan, peer, jid);
+      priv->peer = peer;
+      create_session (chan, jid, dialect);
       g_free (jid);
 
-      g_object_set (priv->session, "dialect", dialect, NULL);
-
       /* Change nat-traversal if we need to */
       if (!tp_strdiff (transport_ns, NS_JINGLE_TRANSPORT_ICEUDP))
         {
@@ -1916,21 +1915,12 @@
       goto error;
     }
 
-  if (priv->session != NULL)
+  if (priv->peer != 0 && priv->peer != contact_handle)
     {
-      TpHandle peer;
-
-      g_object_get (priv->session,
-          "peer", &peer,
-          NULL);
-
-      if (peer != contact_handle)
-        {
-          g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
-              "cannot add streams for %u: this channel's peer is %u",
-              contact_handle, peer);
-          goto error;
-        }
+      g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+          "cannot add streams for %u: this channel's peer is %u",
+          contact_handle, priv->peer);
+      goto error;
     }
 
   if (!_gabble_media_channel_request_contents (self, contact_handle, types,
@@ -2121,19 +2111,12 @@
       /* yes: check we don't have a peer already, and if not add this one to
        * remote pending (but don't send an invitation yet).
        */
-      if (priv->session != NULL)
+      if (priv->peer != 0 && priv->peer != handle)
         {
-          TpHandle peer;
-
-          g_object_get (priv->session, "peer", &peer, NULL);
-
-          if (peer != handle)
-            {
-              g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
-                  "handle %u cannot be added: this channel's peer is %u",
-                  handle, peer);
-              return FALSE;
-            }
+          g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+              "handle %u cannot be added: this channel's peer is %u",
+              handle, priv->peer);
+          return FALSE;
         }
 
       /* We can't delay the request at this time, but if there's a chance
@@ -2375,26 +2358,24 @@
   TpGroupMixin *mixin = TP_GROUP_MIXIN (channel);
   guint terminator;
   JingleState state;
-  TpHandle peer;
   TpIntSet *set;
 
   DEBUG ("called");
 
   g_object_get (session,
                 "state", &state,
-                "peer", &peer,
                 NULL);
 
   if (local_terminator)
       terminator = mixin->self_handle;
   else
-      terminator = peer;
+      terminator = priv->peer;
 
   set = tp_intset_new ();
 
   /* remove us and the peer from the member list */
   tp_intset_add (set, mixin->self_handle);
-  tp_intset_add (set, peer);
+  tp_intset_add (set, priv->peer);
 
   tp_group_mixin_change_members ((GObject *) channel,
       text, NULL, set, NULL, NULL, terminator,
@@ -2464,21 +2445,19 @@
   GabbleMediaChannelPrivate *priv = channel->priv;
   TpGroupMixin *mixin = TP_GROUP_MIXIN (channel);
   JingleState state;
-  TpHandle peer;
   TpIntSet *set;
 
   DEBUG ("called");
 
   g_object_get (session,
                 "state", &state,
-                "peer", &peer,
                 NULL);
 
-  set = tp_intset_new_containing (peer);
+  set = tp_intset_new_containing (priv->peer);
 
   if (state >= JINGLE_STATE_PENDING_INITIATE_SENT &&
       state < JINGLE_STATE_ACTIVE &&
-      !tp_handle_set_is_member (mixin->members, peer))
+      !tp_handle_set_is_member (mixin->members, priv->peer))
     {
       /* The first time we send anything to the other user, they materialise
        * in remote-pending if necessary */
@@ -2500,7 +2479,7 @@
 
       /* add the peer to the member list */
       tp_group_mixin_change_members (as_object, "", set, NULL, NULL, NULL,
-          peer, TP_CHANNEL_GROUP_CHANGE_REASON_NONE);
+          priv->peer, TP_CHANNEL_GROUP_CHANGE_REASON_NONE);
     }
 
   tp_intset_destroy (set);
@@ -2661,8 +2640,9 @@
   object_path = g_strdup_printf ("%s/MediaStream%u",
       priv->object_path, id);
 
-  stream = gabble_media_stream_new (object_path, c, name, id,
-      nat_traversal, relays, local_hold);
+  stream = gabble_media_stream_new (
+      tp_base_connection_get_dbus_daemon (TP_BASE_CONNECTION (priv->conn)),
+      object_path, c, name, id, nat_traversal, relays, local_hold);
   mtype = gabble_media_stream_get_media_type (stream);
 
   if (mtype == TP_MEDIA_STREAM_TYPE_AUDIO)
@@ -2724,7 +2704,7 @@
     mtype == TP_MEDIA_STREAM_TYPE_AUDIO ? "audio" : "video");
 
   tp_svc_channel_type_streamed_media_emit_stream_added (
-      chan, id, priv->session->peer, mtype);
+      chan, id, priv->peer, mtype);
 
   /* StreamAdded does not include the stream's direction and pending send
    * information, so we call the notify::combined-direction handler in order to
@@ -2798,11 +2778,13 @@
                          gpointer user_data)
 {
   StreamCreationData *d = user_data;
+  GPtrArray *tp_relays = gabble_build_tp_relay_info (relays);
 
   if (d->content != NULL && d->self != NULL)
-    construct_stream (d->self, d->content, d->name, d->nat_traversal, relays,
+    construct_stream (d->self, d->content, d->name, d->nat_traversal, tp_relays,
       d->initial);
 
+  g_ptr_array_unref (tp_relays);
   stream_creation_data_free (d);
 }
 
@@ -2890,8 +2872,9 @@
          * don't yet know whether there will be RTCP. */
         d->nat_traversal = "gtalk-p2p";
         DEBUG ("Attempting to create Google relay session");
-        gabble_jingle_factory_create_google_relay_session (
-            self->priv->conn->jingle_factory, 2, google_relay_session_cb, d);
+        gabble_jingle_info_create_google_relay_session (
+            gabble_jingle_mint_get_info (self->priv->conn->jingle_mint),
+            2, google_relay_session_cb, d);
         return;
 
       case JINGLE_TRANSPORT_ICE_UDP:
diff -Nru telepathy-gabble-0.15.4/src/media-channel-hold.c telepathy-gabble-0.16.0/src/media-channel-hold.c
--- telepathy-gabble-0.15.4/src/media-channel-hold.c	2012-01-18 12:45:07.000000000 +0000
+++ telepathy-gabble-0.16.0/src/media-channel-hold.c	2012-03-07 20:26:07.000000000 +0000
@@ -347,7 +347,7 @@
   priv->call_state = call_state;
 
   tp_svc_channel_interface_call_state_emit_call_state_changed (self,
-      priv->session->peer, call_state);
+      priv->peer, call_state);
 }
 
 
@@ -357,11 +357,14 @@
     DBusGMethodInvocation *context)
 {
   GabbleMediaChannel *self = (GabbleMediaChannel *) iface;
+  GabbleMediaChannelPrivate *priv = self->priv;
   GHashTable *states = g_hash_table_new (g_direct_hash, g_direct_equal);
 
-  if (self->priv->session != NULL)
-    g_hash_table_insert (states, GUINT_TO_POINTER (self->priv->session->peer),
-        GUINT_TO_POINTER (self->priv->call_state));
+  if (priv->peer != 0)
+    {
+      g_hash_table_insert (states, GUINT_TO_POINTER (priv->peer),
+          GUINT_TO_POINTER (priv->call_state));
+    }
 
   tp_svc_channel_interface_call_state_return_from_get_call_states (context,
       states);
diff -Nru telepathy-gabble-0.15.4/src/media-channel-internal.h telepathy-gabble-0.16.0/src/media-channel-internal.h
--- telepathy-gabble-0.15.4/src/media-channel-internal.h	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/src/media-channel-internal.h	2012-03-07 20:26:07.000000000 +0000
@@ -40,6 +40,7 @@
   gchar *object_path;
   TpHandle creator;
   TpHandle initial_peer;
+  TpHandle peer;
   gboolean peer_in_rp;
 
   GabbleJingleSession *session;
diff -Nru telepathy-gabble-0.15.4/src/media-factory.c telepathy-gabble-0.16.0/src/media-factory.c
--- telepathy-gabble-0.15.4/src/media-factory.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/media-factory.c	2012-03-07 20:26:07.000000000 +0000
@@ -375,7 +375,7 @@
   TpHandle initiator;
 
   if (sess != NULL)
-    initiator = sess->peer;
+    initiator = peer;
   else
     initiator = conn->self_handle;
 
@@ -441,12 +441,14 @@
 }
 
 static void
-new_jingle_session_cb (GabbleJingleFactory *jf,
+new_jingle_session_cb (GabbleJingleMint *jm,
     GabbleJingleSession *sess,
     gpointer data)
 {
   GabbleMediaFactory *self = GABBLE_MEDIA_FACTORY (data);
   GabbleMediaFactoryPrivate *priv = self->priv;
+  TpHandleRepoIface *contacts;
+  TpHandle peer;
 
   if (gabble_jingle_session_get_content_type (sess) !=
       GABBLE_TYPE_JINGLE_MEDIA_RTP)
@@ -455,17 +457,25 @@
   if (gabble_muc_factory_handle_jingle_session (priv->conn->muc_factory, sess))
     {
       /* Muji channel the muc factory is taking care of it */
+      return;
     }
-  else if (self->priv->use_call_channels)
+
+  contacts = tp_base_connection_get_handles (TP_BASE_CONNECTION (priv->conn),
+      TP_HANDLE_TYPE_CONTACT);
+  peer = tp_handle_ensure (contacts, gabble_jingle_session_get_peer_jid (sess),
+      NULL, NULL);
+
+  if (self->priv->use_call_channels)
     {
-      new_call_channel (self, sess, sess->peer,
+      new_call_channel (self, sess, peer,
         FALSE, NULL,
         FALSE, NULL,
         NULL);
     }
   else
     {
-      GabbleMediaChannel *chan = new_media_channel (self, sess, sess->peer,
+      GabbleMediaChannel *chan = new_media_channel (self, sess,
+          peer,
           FALSE, FALSE, FALSE);
       GList *cs;
 
@@ -505,7 +515,7 @@
   switch (status)
     {
     case TP_CONNECTION_STATUS_CONNECTING:
-      g_signal_connect (priv->conn->jingle_factory, "new-session",
+      g_signal_connect (priv->conn->jingle_mint, "incoming-session",
           G_CALLBACK (new_jingle_session_cb), self);
       break;
 
diff -Nru telepathy-gabble-0.15.4/src/media-stream.c telepathy-gabble-0.16.0/src/media-stream.c
--- telepathy-gabble-0.15.4/src/media-stream.c	2012-01-18 12:45:07.000000000 +0000
+++ telepathy-gabble-0.16.0/src/media-stream.c	2012-03-07 20:26:07.000000000 +0000
@@ -73,7 +73,8 @@
 /* properties */
 enum
 {
-  PROP_OBJECT_PATH = 1,
+  PROP_DBUS_DAEMON = 1,
+  PROP_OBJECT_PATH,
   PROP_NAME,
   PROP_ID,
   PROP_MEDIA_TYPE,
@@ -97,6 +98,7 @@
   GabbleJingleContent *content;
 
   GabbleMediaSessionMode mode;
+  TpDBusDaemon *dbus_daemon;
   gchar *object_path;
   guint id;
   guint media_type;
@@ -159,7 +161,9 @@
 static void update_sending (GabbleMediaStream *stream, gboolean start_sending);
 
 GabbleMediaStream *
-gabble_media_stream_new (const gchar *object_path,
+gabble_media_stream_new (
+    TpDBusDaemon *dbus_daemon,
+    const gchar *object_path,
     GabbleJingleContent *content,
     const gchar *name,
     guint id,
@@ -179,6 +183,7 @@
     }
 
   result = g_object_new (GABBLE_TYPE_MEDIA_STREAM,
+      "dbus-daemon", dbus_daemon,
       "object-path", object_path,
       "content", content,
       "name", name,
@@ -267,8 +272,7 @@
   GObject *obj;
   GabbleMediaStream *stream;
   GabbleMediaStreamPrivate *priv;
-  TpDBusDaemon *bus;
-  GabbleConnection *connection;
+  GabbleJingleFactory *jf;
   gchar *stun_server;
   guint stun_port;
 
@@ -283,12 +287,11 @@
   /* STUN servers are needed as soon as the stream appears, so there's little
    * point in waiting for them - either they've already been resolved, or
    * we're too late to use them for this stream */
-  g_object_get (priv->content,
-      "connection", &connection,
-      NULL);
+  jf = gabble_jingle_session_get_factory (priv->content->session);
 
   /* maybe one day we'll support multiple STUN servers */
-  if (gabble_jingle_factory_get_stun_server (connection->jingle_factory,
+  if (gabble_jingle_info_get_stun_server (
+        gabble_jingle_factory_get_jingle_info (jf),
         &stun_server, &stun_port))
     {
       GValueArray *va = g_value_array_new (2);
@@ -303,10 +306,8 @@
     }
 
   /* go for the bus */
-  bus = tp_base_connection_get_dbus_daemon ((TpBaseConnection *) connection);
-  tp_dbus_daemon_register_object (bus, priv->object_path, obj);
-
-  g_object_unref (connection);
+  g_assert (priv->dbus_daemon != NULL);
+  tp_dbus_daemon_register_object (priv->dbus_daemon, priv->object_path, obj);
 
   update_direction (stream, priv->content);
 
@@ -343,6 +344,9 @@
   GabbleMediaStreamPrivate *priv = stream->priv;
 
   switch (property_id) {
+    case PROP_DBUS_DAEMON:
+      g_value_set_object (value, priv->dbus_daemon);
+      break;
     case PROP_OBJECT_PATH:
       g_value_set_string (value, priv->object_path);
       break;
@@ -405,6 +409,10 @@
       g_free (priv->object_path);
       priv->object_path = g_value_dup_string (value);
       break;
+    case PROP_DBUS_DAEMON:
+      g_assert (priv->dbus_daemon == NULL);
+      priv->dbus_daemon = g_value_dup_object (value);
+      break;
     case PROP_NAME:
       g_free (stream->name);
       stream->name = g_value_dup_string (value);
@@ -529,6 +537,12 @@
   object_class->dispose = gabble_media_stream_dispose;
   object_class->finalize = gabble_media_stream_finalize;
 
+  param_spec = g_param_spec_object ("dbus-daemon", "TpDBusDaemon",
+      "Bus on which to export this object",
+      TP_TYPE_DBUS_DAEMON,
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_DBUS_DAEMON, param_spec);
+
   param_spec = g_param_spec_string ("object-path", "D-Bus object path",
                                     "The D-Bus object path used for this "
                                     "object on the bus.",
@@ -694,6 +708,7 @@
 
   tp_clear_object (&priv->content);
   tp_clear_pointer (&self->name, g_free);
+  g_clear_object (&priv->dbus_daemon);
 
   if (G_OBJECT_CLASS (gabble_media_stream_parent_class)->dispose)
     G_OBJECT_CLASS (gabble_media_stream_parent_class)->dispose (object);
@@ -1031,6 +1046,7 @@
   JingleMediaDescription *md;
   const GPtrArray *hdrexts;
   GHashTable *fbs;
+  GError *wocky_error = NULL;
 
   DEBUG ("putting list of %d supported codecs from stream-engine into cache",
       codecs->len);
@@ -1178,8 +1194,14 @@
 
   jingle_media_description_simplify (md);
 
-  return jingle_media_rtp_set_local_media_description (
-      GABBLE_JINGLE_MEDIA_RTP (priv->content), md, ready, error);
+  if (jingle_media_rtp_set_local_media_description (
+          GABBLE_JINGLE_MEDIA_RTP (priv->content), md, ready, &wocky_error))
+    return TRUE;
+
+  g_set_error_literal (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+      wocky_error->message);
+  g_clear_error (&wocky_error);
+  return FALSE;
 }
 
 /**
diff -Nru telepathy-gabble-0.15.4/src/media-stream.h telepathy-gabble-0.16.0/src/media-stream.h
--- telepathy-gabble-0.15.4/src/media-stream.h	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/src/media-stream.h	2012-03-07 20:26:07.000000000 +0000
@@ -23,7 +23,8 @@
 
 #include 
 
-#include "types.h"
+#include "jingle-types.h"
+#include 
 #include 
 #include 
 #include 
@@ -98,7 +99,9 @@
     guint requested_dir, GError **error);
 void gabble_media_stream_accept_pending_local_send (GabbleMediaStream *stream);
 
-GabbleMediaStream *gabble_media_stream_new (const gchar *object_path,
+GabbleMediaStream *gabble_media_stream_new (
+    TpDBusDaemon *dbus_daemon,
+    const gchar *object_path,
     GabbleJingleContent *content,
     const gchar *name,
     guint id,
diff -Nru telepathy-gabble-0.15.4/src/muc-channel.c telepathy-gabble-0.16.0/src/muc-channel.c
--- telepathy-gabble-0.15.4/src/muc-channel.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-channel.c	2012-04-02 20:49:19.000000000 +0000
@@ -49,7 +49,6 @@
 #include "presence.h"
 #include "util.h"
 #include "presence-cache.h"
-#include "call-muc-channel.h"
 #include "gabble-signals-marshal.h"
 #include "gabble-enumtypes.h"
 
@@ -63,11 +62,13 @@
 static void password_iface_init (gpointer, gpointer);
 static void chat_state_iface_init (gpointer, gpointer);
 static void subject_iface_init (gpointer, gpointer);
+#ifdef ENABLE_VOIP
 static void gabble_muc_channel_start_call_creation (GabbleMucChannel *gmuc,
     GHashTable *request);
 static void muc_call_channel_finish_requests (GabbleMucChannel *self,
     GabbleCallMucChannel *call,
     GError *error);
+#endif
 
 G_DEFINE_TYPE_WITH_CODE (GabbleMucChannel, gabble_muc_channel,
     TP_TYPE_BASE_CHANNEL,
@@ -115,7 +116,10 @@
     PRE_PRESENCE,
     NEW_TUBE,
 
+#ifdef ENABLE_VOIP
     NEW_CALL,
+#endif
+
     LAST_SIGNAL
 };
 
@@ -201,6 +205,7 @@
   WockyMuc *wmuc;
   GabbleTubesChannel *tube;
 
+#ifdef ENABLE_VOIP
   /* Current active call */
   GabbleCallMucChannel *call;
   /* All calls, active one + potential ended ones */
@@ -209,6 +214,7 @@
   /* List of GSimpleAsyncResults for the various request for a call */
   GList *call_requests;
   gboolean call_initiating;
+#endif
 
   GCancellable *requests_cancellable;
 
@@ -1174,6 +1180,7 @@
                   g_cclosure_marshal_VOID__OBJECT,
                   G_TYPE_NONE, 1, GABBLE_TYPE_TUBES_CHANNEL);
 
+#ifdef ENABLE_VOIP
   signals[NEW_CALL] = g_signal_new ("new-call",
                   G_OBJECT_CLASS_TYPE (gabble_muc_channel_class),
                   G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
@@ -1183,6 +1190,7 @@
                   G_TYPE_NONE, 2,
                   GABBLE_TYPE_CALL_MUC_CHANNEL,
                   G_TYPE_POINTER);
+#endif
 
   gabble_muc_channel_class->dbus_props_class.interfaces = prop_interfaces;
   tp_dbus_properties_mixin_class_init (object_class,
@@ -1477,11 +1485,17 @@
   g_object_ref (chan);
 
   gabble_muc_channel_close_tube (chan);
+
+#ifdef ENABLE_VOIP
   muc_call_channel_finish_requests (chan, NULL, &error);
+#endif
+
   g_cancellable_cancel (priv->requests_cancellable);
 
+#ifdef ENABLE_VOIP
   while (priv->calls != NULL)
     tp_base_channel_close (TP_BASE_CHANNEL (priv->calls->data));
+#endif
 
   set = tp_intset_new_containing (TP_GROUP_MIXIN (chan)->self_handle);
   tp_group_mixin_change_members ((GObject *) chan, reason,
@@ -2269,7 +2283,9 @@
     gpointer data)
 {
   GabbleMucChannel *gmuc = GABBLE_MUC_CHANNEL (data);
+#ifdef ENABLE_VOIP
   GabbleMucChannelPrivate *priv = gmuc->priv;
+#endif
   TpBaseChannel *base = TP_BASE_CHANNEL (gmuc);
   TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
   GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
@@ -2309,6 +2325,7 @@
 
   handle_tube_presence (gmuc, handle, stanza);
 
+#ifdef ENABLE_VOIP
   if (!priv->call_initiating && priv->call == NULL)
     {
       WockyNode *m;
@@ -2322,6 +2339,7 @@
           gabble_muc_channel_start_call_creation (gmuc, NULL);
         }
     }
+#endif
 
   /* zap the handle refs we created */
   tp_handle_unref (contact_repo, handle);
@@ -3489,6 +3507,7 @@
     }
 }
 
+#ifdef ENABLE_VOIP
 GabbleCallMucChannel *
 gabble_muc_channel_get_call (GabbleMucChannel *gmuc)
 {
@@ -3700,7 +3719,6 @@
   return TRUE;
 }
 
-
 gboolean
 gabble_muc_channel_handle_jingle_session (GabbleMucChannel *self,
     GabbleJingleSession *session)
@@ -3715,6 +3733,7 @@
 
   return TRUE;
 }
+#endif
 
 void
 gabble_muc_channel_teardown (GabbleMucChannel *gmuc)
diff -Nru telepathy-gabble-0.15.4/src/muc-channel.h telepathy-gabble-0.16.0/src/muc-channel.h
--- telepathy-gabble-0.15.4/src/muc-channel.h	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-channel.h	2012-04-02 20:49:19.000000000 +0000
@@ -22,6 +22,8 @@
 #ifndef __GABBLE_MUC_CHANNEL_H__
 #define __GABBLE_MUC_CHANNEL_H__
 
+#include "config.h"
+
 #include 
 #include 
 
@@ -32,7 +34,9 @@
 
 #include "types.h"
 #include "tubes-channel.h"
+#ifdef ENABLE_VOIP
 #include "call-muc-channel.h"
+#endif
 
 G_BEGIN_DECLS
 
@@ -94,6 +98,7 @@
     TpHandle initiator,
     gboolean requested);
 
+#ifdef ENABLE_VOIP
 GabbleCallMucChannel * gabble_muc_channel_get_call (GabbleMucChannel *gmuc);
 GList * gabble_muc_channel_get_call_channels (GabbleMucChannel *self);
 
@@ -110,6 +115,7 @@
 
 gboolean gabble_muc_channel_handle_jingle_session (GabbleMucChannel *channel,
     GabbleJingleSession *session);
+#endif
 
 void gabble_muc_channel_update_configuration_async (
     GabbleMucChannel *self,
diff -Nru telepathy-gabble-0.15.4/src/muc-factory.c telepathy-gabble-0.16.0/src/muc-factory.c
--- telepathy-gabble-0.15.4/src/muc-factory.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-factory.c	2012-04-02 20:49:19.000000000 +0000
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -38,7 +39,9 @@
 #include "debug.h"
 #include "disco.h"
 #include "im-channel.h"
+#ifdef ENABLE_VOIP
 #include "media-factory.h"
+#endif
 #include "message-util.h"
 #include "muc-channel.h"
 #include "namespaces.h"
@@ -47,7 +50,9 @@
 #include "tube-dbus.h"
 #include "tube-stream.h"
 #include "util.h"
+#ifdef ENABLE_VOIP
 #include "call-muc-channel.h"
+#endif
 
 static void channel_manager_iface_init (gpointer, gpointer);
 
@@ -394,6 +399,7 @@
       TP_EXPORTABLE_CHANNEL (chan));
 }
 
+#ifdef ENABLE_VOIP
 static void
 muc_channel_new_call (GabbleMucChannel *muc,
     GabbleCallMucChannel *call,
@@ -410,6 +416,7 @@
   g_signal_connect (call, "closed",
     G_CALLBACK (muc_sub_channel_closed_cb), fac);
 }
+#endif
 
 static void
 muc_channel_new_tube (GabbleMucChannel *channel,
@@ -494,8 +501,10 @@
 
   g_signal_connect (chan, "closed", (GCallback) muc_channel_closed_cb, fac);
   g_signal_connect (chan, "new-tube", (GCallback) muc_channel_new_tube, fac);
+#ifdef ENABLE_VOIP
   g_signal_connect (chan, "new-call",
       (GCallback) muc_channel_new_call, fac);
+#endif
 
   g_hash_table_insert (priv->text_channels, GUINT_TO_POINTER (handle), chan);
 
@@ -994,8 +1003,10 @@
       g_object_unref (tube);
     }
 
+#ifdef ENABLE_VOIP
   g_list_foreach (gabble_muc_channel_get_call_channels (gmuc),
       (GFunc) data->foreach, data->user_data);
+#endif
 }
 
 static void
@@ -1162,12 +1173,14 @@
   func (type, table, gabble_tube_dbus_channel_get_allowed_properties (),
       user_data);
 
+#ifdef ENABLE_VOIP
   /* Muc Channel.Type.Call */
   g_value_set_static_string (channel_type_value,
       TP_IFACE_CHANNEL_TYPE_CALL);
   func (type, table,
       gabble_media_factory_call_channel_allowed_properties (),
       user_data);
+#endif
 
   g_hash_table_unref (table);
 }
@@ -1740,6 +1753,7 @@
       require_new, handle, error);
 }
 
+#ifdef ENABLE_VOIP
 static void
 call_muc_channel_request_cb (GObject *source,
   GAsyncResult *result,
@@ -1836,6 +1850,7 @@
 error:
   return FALSE;
 }
+#endif
 
 typedef gboolean (*ChannelTypeHandlerFunc) (
     GabbleMucFactory *self,
@@ -1855,7 +1870,9 @@
     { TP_IFACE_CHANNEL_TYPE_TUBES, handle_tubes_channel_request },
     { TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, handle_stream_tube_channel_request },
     { TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, handle_dbus_tube_channel_request },
+#ifdef ENABLE_VOIP
     { TP_IFACE_CHANNEL_TYPE_CALL, handle_call_channel_request },
+#endif
     { NULL }
 };
 
@@ -1957,6 +1974,7 @@
       FALSE);
 }
 
+#ifdef ENABLE_VOIP
 gboolean
 gabble_muc_factory_handle_jingle_session (GabbleMucFactory *self,
   GabbleJingleSession *session)
@@ -1983,7 +2001,7 @@
 
   return FALSE;
 }
-
+#endif
 
 static void
 channel_manager_iface_init (gpointer g_iface,
diff -Nru telepathy-gabble-0.15.4/src/muc-factory.h telepathy-gabble-0.16.0/src/muc-factory.h
--- telepathy-gabble-0.15.4/src/muc-factory.h	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-factory.h	2012-03-26 18:00:06.000000000 +0000
@@ -20,10 +20,15 @@
 #ifndef __MUC_FACTORY_H__
 #define __MUC_FACTORY_H__
 
+#include "config.h"
+
 #include 
 #include 
 
 #include "bytestream-iface.h"
+#ifdef ENABLE_VOIP
+#include "jingle-types.h"
+#endif
 #include "types.h"
 
 G_BEGIN_DECLS
@@ -69,8 +74,10 @@
 
 void gabble_muc_factory_broadcast_presence (GabbleMucFactory *self);
 
+#ifdef ENABLE_VOIP
 gboolean gabble_muc_factory_handle_jingle_session (GabbleMucFactory *self,
   GabbleJingleSession *session);
+#endif
 
 G_END_DECLS
 
diff -Nru telepathy-gabble-0.15.4/src/muc-tube-dbus.c telepathy-gabble-0.16.0/src/muc-tube-dbus.c
--- telepathy-gabble-0.15.4/src/muc-tube-dbus.c	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-tube-dbus.c	2012-02-29 20:02:02.000000000 +0000
@@ -0,0 +1,45 @@
+/*
+ * muc-tube-dbus.c - Source for GabbleMucTubeDBus
+ * Copyright (C) 2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "muc-tube-dbus.h"
+
+G_DEFINE_TYPE (GabbleMucTubeDBus, gabble_muc_tube_dbus,
+    GABBLE_TYPE_TUBE_DBUS)
+
+static const gchar *gabble_muc_tube_dbus_interfaces[] = {
+    TP_IFACE_CHANNEL_INTERFACE_GROUP,
+    TP_IFACE_CHANNEL_INTERFACE_TUBE,
+    NULL
+};
+
+static void
+gabble_muc_tube_dbus_init (GabbleMucTubeDBus *self)
+{
+}
+
+static void
+gabble_muc_tube_dbus_class_init (
+    GabbleMucTubeDBusClass *gabble_muc_tube_dbus_class)
+{
+  TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (
+      gabble_muc_tube_dbus_class);
+
+  base_class->interfaces = gabble_muc_tube_dbus_interfaces;
+  base_class->target_handle_type = TP_HANDLE_TYPE_ROOM;
+}
diff -Nru telepathy-gabble-0.15.4/src/muc-tube-dbus.h telepathy-gabble-0.16.0/src/muc-tube-dbus.h
--- telepathy-gabble-0.15.4/src/muc-tube-dbus.h	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-tube-dbus.h	2012-02-29 20:02:02.000000000 +0000
@@ -0,0 +1,60 @@
+/*
+ * muc-tube-dbus.h - Header for GabbleMucTubeDBus
+ * Copyright (C) 2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GABBLE_MUC_TUBE_DBUS_H__
+#define __GABBLE_MUC_TUBE_DBUS_H__
+
+#include 
+
+#include "tube-dbus.h"
+
+G_BEGIN_DECLS
+
+typedef struct _GabbleMucTubeDBus GabbleMucTubeDBus;
+typedef struct _GabbleMucTubeDBusClass GabbleMucTubeDBusClass;
+
+struct _GabbleMucTubeDBusClass {
+  GabbleTubeDBusClass parent_class;
+};
+
+struct _GabbleMucTubeDBus {
+  GabbleTubeDBus parent;
+};
+
+GType gabble_muc_tube_dbus_get_type (void);
+
+/* TYPE MACROS */
+#define GABBLE_TYPE_MUC_TUBE_DBUS \
+  (gabble_muc_tube_dbus_get_type ())
+#define GABBLE_MUC_TUBE_DBUS(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MUC_TUBE_DBUS, GabbleMucTubeDBus))
+#define GABBLE_MUC_TUBE_DBUS_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MUC_TUBE_DBUS,\
+                           GabbleMucTubeDBusClass))
+#define GABBLE_IS_MUC_TUBE_DBUS(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_MUC_TUBE_DBUS))
+#define GABBLE_IS_MUC_TUBE_DBUS_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_MUC_TUBE_DBUS))
+#define GABBLE_MUC_TUBE_DBUS_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MUC_TUBE_DBUS,\
+                              GabbleMucTubeDBusClass))
+
+G_END_DECLS
+
+#endif /* #ifndef __GABBLE_MUC_TUBE_DBUS_H__ */
diff -Nru telepathy-gabble-0.15.4/src/muc-tube-stream.c telepathy-gabble-0.16.0/src/muc-tube-stream.c
--- telepathy-gabble-0.15.4/src/muc-tube-stream.c	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-tube-stream.c	2012-02-29 20:02:02.000000000 +0000
@@ -0,0 +1,45 @@
+/*
+ * muc-tube-stream.c - Source for GabbleMucTubeStream
+ * Copyright (C) 2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "muc-tube-stream.h"
+
+G_DEFINE_TYPE (GabbleMucTubeStream, gabble_muc_tube_stream,
+    GABBLE_TYPE_TUBE_STREAM)
+
+static const gchar *gabble_muc_tube_stream_interfaces[] = {
+    TP_IFACE_CHANNEL_INTERFACE_GROUP,
+    TP_IFACE_CHANNEL_INTERFACE_TUBE,
+    NULL
+};
+
+static void
+gabble_muc_tube_stream_init (GabbleMucTubeStream *self)
+{
+}
+
+static void
+gabble_muc_tube_stream_class_init (
+    GabbleMucTubeStreamClass *gabble_muc_tube_stream_class)
+{
+  TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (
+      gabble_muc_tube_stream_class);
+
+  base_class->interfaces = gabble_muc_tube_stream_interfaces;
+  base_class->target_handle_type = TP_HANDLE_TYPE_ROOM;
+}
diff -Nru telepathy-gabble-0.15.4/src/muc-tube-stream.h telepathy-gabble-0.16.0/src/muc-tube-stream.h
--- telepathy-gabble-0.15.4/src/muc-tube-stream.h	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/src/muc-tube-stream.h	2012-02-29 20:02:02.000000000 +0000
@@ -0,0 +1,60 @@
+/*
+ * muc-tube-stream.h - Header for GabbleMucTubeStream
+ * Copyright (C) 2012 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GABBLE_MUC_TUBE_STREAM_H__
+#define __GABBLE_MUC_TUBE_STREAM_H__
+
+#include 
+
+#include "tube-stream.h"
+
+G_BEGIN_DECLS
+
+typedef struct _GabbleMucTubeStream GabbleMucTubeStream;
+typedef struct _GabbleMucTubeStreamClass GabbleMucTubeStreamClass;
+
+struct _GabbleMucTubeStreamClass {
+  GabbleTubeStreamClass parent_class;
+};
+
+struct _GabbleMucTubeStream {
+  GabbleTubeStream parent;
+};
+
+GType gabble_muc_tube_stream_get_type (void);
+
+/* TYPE MACROS */
+#define GABBLE_TYPE_MUC_TUBE_STREAM \
+  (gabble_muc_tube_stream_get_type ())
+#define GABBLE_MUC_TUBE_STREAM(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_MUC_TUBE_STREAM, GabbleMucTubeStream))
+#define GABBLE_MUC_TUBE_STREAM_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_MUC_TUBE_STREAM,\
+                           GabbleMucTubeStreamClass))
+#define GABBLE_IS_MUC_TUBE_STREAM(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_MUC_TUBE_STREAM))
+#define GABBLE_IS_MUC_TUBE_STREAM_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_MUC_TUBE_STREAM))
+#define GABBLE_MUC_TUBE_STREAM_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MUC_TUBE_STREAM,\
+                              GabbleMucTubeStreamClass))
+
+G_END_DECLS
+
+#endif /* #ifndef __GABBLE_MUC_TUBE_STREAM_H__ */
diff -Nru telepathy-gabble-0.15.4/src/presence-cache.c telepathy-gabble-0.16.0/src/presence-cache.c
--- telepathy-gabble-0.15.4/src/presence-cache.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/presence-cache.c	2012-03-07 20:26:07.000000000 +0000
@@ -1997,6 +1997,17 @@
   return g_hash_table_lookup (priv->presence, GUINT_TO_POINTER (handle));
 }
 
+GabblePresence *
+gabble_presence_cache_get_for_contact (
+    GabblePresenceCache *cache,
+    WockyContact *contact)
+{
+  GabblePresenceCachePrivate *priv = cache->priv;
+  TpHandle handle = ensure_handle_from_contact (priv->conn, contact);
+
+  return g_hash_table_lookup (priv->presence, GUINT_TO_POINTER (handle));
+}
+
 void
 gabble_presence_cache_maybe_remove (
     GabblePresenceCache *cache,
diff -Nru telepathy-gabble-0.15.4/src/presence-cache.h telepathy-gabble-0.16.0/src/presence-cache.h
--- telepathy-gabble-0.15.4/src/presence-cache.h	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/presence-cache.h	2012-03-07 20:26:07.000000000 +0000
@@ -99,6 +99,9 @@
 GabblePresenceCache *gabble_presence_cache_new (GabbleConnection *conn);
 GabblePresence *gabble_presence_cache_get (GabblePresenceCache *cache,
     TpHandle handle);
+GabblePresence *gabble_presence_cache_get_for_contact (
+    GabblePresenceCache *cache,
+    WockyContact *contact);
 void gabble_presence_cache_update (GabblePresenceCache *cache,
     TpHandle handle, const gchar *resource, GabblePresenceId presence_id,
     const gchar *status_message, gint8 priority);
diff -Nru telepathy-gabble-0.15.4/src/protocol.c telepathy-gabble-0.16.0/src/protocol.c
--- telepathy-gabble-0.15.4/src/protocol.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/protocol.c	2012-04-02 20:49:25.000000000 +0000
@@ -32,7 +32,9 @@
 #include "connection.h"
 #include "connection-manager.h"
 #include "im-factory.h"
+#ifdef ENABLE_VOIP
 #include "media-factory.h"
+#endif
 #include "private-tubes-factory.h"
 #include "roomlist-manager.h"
 #include "search-manager.h"
@@ -156,6 +158,12 @@
     TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GUINT_TO_POINTER (30),
     0 /* unused */, NULL, NULL },
 
+  { TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_DOWNLOAD_AT_CONNECTION,
+    DBUS_TYPE_BOOLEAN_AS_STRING, G_TYPE_BOOLEAN,
+    TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT | TP_CONN_MGR_PARAM_FLAG_DBUS_PROPERTY,
+    GUINT_TO_POINTER (TRUE),
+    0 /* unused */, NULL, NULL },
+
   { GABBLE_PROP_CONNECTION_INTERFACE_GABBLE_DECLOAK_DECLOAK_AUTOMATICALLY,
     DBUS_TYPE_BOOLEAN_AS_STRING, G_TYPE_BOOLEAN,
     TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT |
@@ -243,6 +251,8 @@
   SAME ("alias"),
   SAME ("fallback-socks5-proxies"),
   SAME ("keepalive-interval"),
+  MAP (TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_DOWNLOAD_AT_CONNECTION,
+       "download-roster-at-connection"),
   MAP (GABBLE_PROP_CONNECTION_INTERFACE_GABBLE_DECLOAK_DECLOAK_AUTOMATICALLY,
        "decloak-automatically"),
   SAME ("fallback-servers"),
@@ -345,7 +355,9 @@
           GABBLE_TYPE_FT_MANAGER,
 #endif
           GABBLE_TYPE_IM_FACTORY,
+#ifdef ENABLE_VOIP
           GABBLE_TYPE_MEDIA_FACTORY,
+#endif
           GABBLE_TYPE_MUC_FACTORY,
           GABBLE_TYPE_ROOMLIST_MANAGER,
           GABBLE_TYPE_SEARCH_MANAGER,
diff -Nru telepathy-gabble-0.15.4/src/roster.c telepathy-gabble-0.16.0/src/roster.c
--- telepathy-gabble-0.15.4/src/roster.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/roster.c	2012-04-02 20:49:25.000000000 +0000
@@ -1795,19 +1795,28 @@
     case TP_CONNECTION_STATUS_CONNECTED:
         {
           WockyStanza *stanza;
+          TpBaseContactList *base = TP_BASE_CONTACT_LIST (self);
 
           self->priv->cancel_on_disconnect = g_cancellable_new ();
 
-          DEBUG ("requesting roster");
+          if (tp_base_contact_list_get_download_at_connection (base))
+            {
+              DEBUG ("requesting roster");
 
-          stanza = _gabble_roster_message_new (self, WOCKY_STANZA_SUB_TYPE_GET,
-              NULL);
+              stanza = _gabble_roster_message_new (self, WOCKY_STANZA_SUB_TYPE_GET,
+                  NULL);
 
-          conn_util_send_iq_async (conn, stanza,
-              self->priv->cancel_on_disconnect,
-              roster_received_cb, tp_weak_ref_new (self, NULL, NULL));
+              conn_util_send_iq_async (conn, stanza,
+                  self->priv->cancel_on_disconnect,
+                  roster_received_cb, tp_weak_ref_new (self, NULL, NULL));
 
-          g_object_unref (stanza);
+              g_object_unref (stanza);
+            }
+          else
+            {
+              DEBUG ("don't request the roster because the property"
+                     " ContactList.DownloadAtConnection is FALSE");
+            }
         }
       break;
 
@@ -2773,7 +2782,7 @@
     }
 
   gabble_simple_async_succeed_or_fail_in_idle (self, callback, user_data,
-      gabble_roster_request_subscription_async, error);
+      gabble_roster_authorize_publication_async, error);
   g_clear_error (&error);
 }
 
@@ -2951,12 +2960,46 @@
 
   tp_base_contact_list_contacts_changed (base, changed, removed);
   gabble_simple_async_succeed_or_fail_in_idle (self, callback, user_data,
-      gabble_roster_request_subscription_async, error);
+      gabble_roster_unpublish_async, error);
   g_clear_error (&error);
   tp_handle_set_destroy (changed);
   tp_handle_set_destroy (removed);
 }
 
+static void
+gabble_roster_download_async (TpBaseContactList *base,
+    GAsyncReadyCallback callback,
+    gpointer user_data)
+{
+  GabbleRoster *self = GABBLE_ROSTER (base);
+  GError *error = NULL;
+
+  if (!tp_base_contact_list_get_download_at_connection (base))
+    {
+      WockyStanza *stanza;
+
+      DEBUG ("Downloading roster requested");
+
+      stanza = _gabble_roster_message_new (self, WOCKY_STANZA_SUB_TYPE_GET,
+          NULL);
+
+      conn_util_send_iq_async (self->priv->conn, stanza,
+          self->priv->cancel_on_disconnect,
+          roster_received_cb, tp_weak_ref_new (self, NULL, NULL));
+
+      g_object_unref (stanza);
+    }
+  else
+    {
+      DEBUG ("Downloading roster requested but it is already requested at "
+             "connection. Just do nothing and return.");
+    }
+
+  gabble_simple_async_succeed_or_fail_in_idle (self, callback, user_data,
+      gabble_roster_download_async, error);
+  g_clear_error (&error);
+}
+
 static TpHandleSet *
 gabble_roster_dup_blocked_contacts (TpBaseContactList *base)
 {
@@ -3541,6 +3584,7 @@
 
   base_class->dup_states = gabble_roster_dup_states;
   base_class->dup_contacts = gabble_roster_dup_contacts;
+  base_class->download_async = gabble_roster_download_async;
 
   signals[NICKNAMES_UPDATE] = g_signal_new (
     "nicknames-update",
diff -Nru telepathy-gabble-0.15.4/src/tube-dbus.c telepathy-gabble-0.16.0/src/tube-dbus.c
--- telepathy-gabble-0.15.4/src/tube-dbus.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/tube-dbus.c	2012-04-02 20:49:19.000000000 +0000
@@ -27,9 +27,7 @@
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -48,6 +46,7 @@
 #include "debug.h"
 #include "disco.h"
 #include "gabble-signals-marshal.h"
+#include "muc-tube-dbus.h"
 #include "namespaces.h"
 #include "presence-cache.h"
 #include "tube-iface.h"
@@ -62,14 +61,11 @@
  * arbitrary limit on the queue size set to 4MB. */
 #define MAX_QUEUE_SIZE (4096*1024)
 
-static void channel_iface_init (gpointer, gpointer);
 static void tube_iface_init (gpointer g_iface, gpointer iface_data);
 static void dbustube_iface_init (gpointer g_iface, gpointer iface_data);
 
-G_DEFINE_TYPE_WITH_CODE (GabbleTubeDBus, gabble_tube_dbus, G_TYPE_OBJECT,
-    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
-      tp_dbus_properties_mixin_iface_init);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
+G_DEFINE_TYPE_WITH_CODE (GabbleTubeDBus, gabble_tube_dbus,
+    TP_TYPE_BASE_CHANNEL,
     G_IMPLEMENT_INTERFACE (GABBLE_TYPE_TUBE_IFACE, tube_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_DBUS_TUBE,
       dbustube_iface_init);
@@ -77,14 +73,9 @@
       NULL);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
       tp_external_group_mixin_iface_init);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL));
+);
 
 static const gchar *gabble_tube_dbus_interfaces[] = {
-    TP_IFACE_CHANNEL_INTERFACE_GROUP,
-    /* If more interfaces are added, either keep Group as the first, or change
-     * the implementations of gabble_tube_dbus_get_interfaces () and
-     * gabble_tube_dbus_get_property () too */
     TP_IFACE_CHANNEL_INTERFACE_TUBE,
     NULL
 };
@@ -110,29 +101,17 @@
 /* properties */
 enum
 {
-  PROP_OBJECT_PATH = 1,
-  PROP_CHANNEL_TYPE,
-  PROP_CONNECTION,
-  PROP_INTERFACES,
-  PROP_HANDLE,
-  PROP_HANDLE_TYPE,
-  PROP_SELF_HANDLE,
+  PROP_SELF_HANDLE = 1,
   PROP_ID,
   PROP_BYTESTREAM,
   PROP_STREAM_ID,
   PROP_TYPE,
-  PROP_INITIATOR_HANDLE,
   PROP_SERVICE,
   PROP_PARAMETERS,
   PROP_STATE,
   PROP_DBUS_ADDRESS,
   PROP_DBUS_NAME,
   PROP_DBUS_NAMES,
-  PROP_CHANNEL_DESTROYED,
-  PROP_CHANNEL_PROPERTIES,
-  PROP_REQUESTED,
-  PROP_TARGET_ID,
-  PROP_INITIATOR_ID,
   PROP_MUC,
   PROP_SUPPORTED_ACCESS_CONTROLS,
   LAST_PROPERTY
@@ -140,15 +119,10 @@
 
 struct _GabbleTubeDBusPrivate
 {
-  GabbleConnection *conn;
-  char *object_path;
-  TpHandle handle;
-  TpHandleType handle_type;
   TpHandle self_handle;
   guint id;
   GabbleBytestreamIface *bytestream;
   gchar *stream_id;
-  TpHandle initiator;
   gchar *service;
   GHashTable *parameters;
   GabbleMucChannel *muc;
@@ -160,7 +134,6 @@
    * incoming tubes, always TRUE.
    */
   gboolean offered;
-  gboolean requested;
 
   /* our unique D-Bus name on the virtual tube bus (NULL for 1-1 D-Bus tubes)*/
   gchar *dbus_local_name;
@@ -187,8 +160,6 @@
   /* Number of bytes that will be in the next message, 0 if unknown */
   guint32 reassembly_bytes_needed;
 
-  gboolean closed;
-
   gboolean dispose_has_run;
 };
 
@@ -197,9 +168,6 @@
 static void data_received_cb (GabbleBytestreamIface *stream, TpHandle sender,
     GString *data, gpointer user_data);
 
-static void gabble_tube_dbus_close (GabbleTubeIface *tube, gboolean
-    closed_remotely);
-
 /*
  * Characters used are permissible both in filenames and in D-Bus names. (See
  * D-Bus specification for restrictions.)
@@ -346,22 +314,25 @@
 }
 
 static void
-do_close (GabbleTubeDBus *self)
+gabble_tube_dbus_close (TpBaseChannel *base)
 {
+  GabbleTubeDBus *self = GABBLE_TUBE_DBUS (base);
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
 
-  if (priv->closed)
-    return;
-  priv->closed = TRUE;
+  /* Take a ref to ourselves as when we emit tube-closed
+   * GabbleTubesChannel will drop our last ref but we still need to
+   * declare ourselves as destroyed. This is rubbish, but will
+   * disappear when we finally remove the Tubes channel type.. */
+  g_object_ref (base);
 
   if (priv->bytestream != NULL)
-    {
-      gabble_bytestream_iface_close (priv->bytestream, NULL);
-    }
+    gabble_bytestream_iface_close (priv->bytestream, NULL);
   else
-    {
-      g_signal_emit (G_OBJECT (self), signals[CLOSED], 0);
-    }
+    g_signal_emit (G_OBJECT (self), signals[CLOSED],0);
+
+  tp_base_channel_destroyed (base);
+
+  g_object_unref (base);
 }
 
 /* There is two step to enable receiving a D-Bus connection from the local
@@ -447,7 +418,7 @@
   /* TODO: we should remove this call once muc D-Bus tube new API are
    * implemented  as the server should already exist. */
   if (!create_dbus_server (self, NULL))
-    do_close (self);
+    tp_base_channel_close (TP_BASE_CHANNEL (self));
 
   if (priv->dbus_srv != NULL)
     {
@@ -536,8 +507,12 @@
 {
   GabbleTubeDBus *self = GABBLE_TUBE_DBUS (object);
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (
+      TP_BASE_CHANNEL (self));
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+      base_conn, TP_HANDLE_TYPE_CONTACT);
+
+  DEBUG ("called");
 
   if (priv->dispose_has_run)
     return;
@@ -545,9 +520,7 @@
   priv->dispose_has_run = TRUE;
 
   if (priv->bytestream != NULL)
-    {
-      gabble_bytestream_iface_close (priv->bytestream, NULL);
-    }
+    gabble_bytestream_iface_close (priv->bytestream, NULL);
 
   if (priv->dbus_conn != NULL)
     dbus_connection_close (priv->dbus_conn);
@@ -596,8 +569,6 @@
   if (priv->reassembly_buffer)
     g_string_free (priv->reassembly_buffer, TRUE);
 
-  tp_handle_unref (contact_repo, priv->initiator);
-
   if (G_OBJECT_CLASS (gabble_tube_dbus_parent_class)->dispose)
     G_OBJECT_CLASS (gabble_tube_dbus_parent_class)->dispose (object);
 }
@@ -608,16 +579,13 @@
   GabbleTubeDBus *self = GABBLE_TUBE_DBUS (object);
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
 
-  g_free (priv->object_path);
   g_free (priv->stream_id);
   g_free (priv->service);
   g_hash_table_unref (priv->parameters);
   g_array_unref (priv->supported_access_controls);
 
   if (priv->muc != NULL)
-    {
-      tp_external_group_mixin_finalize (object);
-    }
+    tp_external_group_mixin_finalize (object);
 
   G_OBJECT_CLASS (gabble_tube_dbus_parent_class)->finalize (object);
 }
@@ -630,38 +598,9 @@
 {
   GabbleTubeDBus *self = GABBLE_TUBE_DBUS (object);
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
-  TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn;
 
   switch (property_id)
     {
-      case PROP_OBJECT_PATH:
-        g_value_set_string (value, priv->object_path);
-        break;
-      case PROP_CHANNEL_TYPE:
-        g_value_set_static_string (value,
-            TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
-        break;
-      case PROP_CONNECTION:
-        g_value_set_object (value, priv->conn);
-        break;
-     case PROP_INTERFACES:
-        if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
-          {
-            /* 1-1 tubes - omit the Group interface */
-            g_value_set_boxed (value, gabble_tube_dbus_interfaces + 1);
-          }
-        else
-          {
-            /* MUC tubes */
-            g_value_set_boxed (value, gabble_tube_dbus_interfaces);
-          }
-        break;
-      case PROP_HANDLE:
-        g_value_set_uint (value, priv->handle);
-        break;
-      case PROP_HANDLE_TYPE:
-        g_value_set_uint (value, priv->handle_type);
-        break;
       case PROP_SELF_HANDLE:
         g_value_set_uint (value, priv->self_handle);
         break;
@@ -677,9 +616,6 @@
       case PROP_TYPE:
         g_value_set_uint (value, TP_TUBE_TYPE_DBUS);
         break;
-      case PROP_INITIATOR_HANDLE:
-        g_value_set_uint (value, priv->initiator);
-        break;
       case PROP_SERVICE:
         g_value_set_string (value, priv->service);
         break;
@@ -698,71 +634,6 @@
       case PROP_DBUS_NAMES:
         g_value_set_boxed (value, priv->dbus_names);
         break;
-      case PROP_CHANNEL_DESTROYED:
-        g_value_set_boolean (value, priv->closed);
-        break;
-      case PROP_CHANNEL_PROPERTIES:
-        {
-          GHashTable *properties;
-
-          properties = tp_dbus_properties_mixin_make_properties_hash (object,
-              TP_IFACE_CHANNEL, "TargetHandle",
-              TP_IFACE_CHANNEL, "TargetHandleType",
-              TP_IFACE_CHANNEL, "ChannelType",
-              TP_IFACE_CHANNEL, "TargetID",
-              TP_IFACE_CHANNEL, "InitiatorHandle",
-              TP_IFACE_CHANNEL, "InitiatorID",
-              TP_IFACE_CHANNEL, "Requested",
-              TP_IFACE_CHANNEL, "Interfaces",
-              TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "ServiceName",
-              TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "SupportedAccessControls",
-              NULL);
-
-          if (priv->initiator != priv->self_handle)
-            {
-              /* channel has not been requested so Parameters is immutable */
-              GValue *prop_value = g_slice_new0 (GValue);
-
-              /* FIXME: use tp_dbus_properties_mixin_add_properties once it's
-               * added in tp-glib */
-              tp_dbus_properties_mixin_get (object,
-                  TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
-                  prop_value, NULL);
-              g_assert (G_IS_VALUE (prop_value));
-
-              g_hash_table_insert (properties,
-                  g_strdup_printf ("%s.%s", TP_IFACE_CHANNEL_INTERFACE_TUBE,
-                    "Parameters"), prop_value);
-            }
-
-          g_value_take_boxed (value, properties);
-        }
-        break;
-      case PROP_REQUESTED:
-        g_value_set_boolean (value, priv->requested);
-        break;
-      case PROP_INITIATOR_ID:
-          {
-            TpHandleRepoIface *repo = tp_base_connection_get_handles (
-                base_conn, TP_HANDLE_TYPE_CONTACT);
-
-            /* some channel can have o.f.T.Channel.InitiatorHandle == 0 but
-             * tubes always have an initiator */
-            g_assert (priv->initiator != 0);
-
-            g_value_set_string (value,
-                tp_handle_inspect (repo, priv->initiator));
-          }
-        break;
-      case PROP_TARGET_ID:
-          {
-            TpHandleRepoIface *repo = tp_base_connection_get_handles (
-                base_conn, priv->handle_type);
-
-            g_value_set_string (value,
-                tp_handle_inspect (repo, priv->handle));
-          }
-        break;
       case PROP_MUC:
         g_value_set_object (value, priv->muc);
         break;
@@ -786,23 +657,6 @@
 
   switch (property_id)
     {
-      case PROP_OBJECT_PATH:
-        g_free (priv->object_path);
-        priv->object_path = g_value_dup_string (value);
-        break;
-      case PROP_CHANNEL_TYPE:
-        /* this property is writable in the interface, but not actually
-         * meaningfully changeable on this channel, so we do nothing */
-        break;
-      case PROP_CONNECTION:
-        priv->conn = g_value_get_object (value);
-        break;
-      case PROP_HANDLE:
-        priv->handle = g_value_get_uint (value);
-        break;
-      case PROP_HANDLE_TYPE:
-        priv->handle_type = g_value_get_uint (value);
-        break;
       case PROP_SELF_HANDLE:
         priv->self_handle = g_value_get_uint (value);
         break;
@@ -831,9 +685,6 @@
         g_free (priv->stream_id);
         priv->stream_id = g_value_dup_string (value);
         break;
-      case PROP_INITIATOR_HANDLE:
-        priv->initiator = g_value_get_uint (value);
-        break;
       case PROP_SERVICE:
         g_free (priv->service);
         priv->service = g_value_dup_string (value);
@@ -846,51 +697,36 @@
       case PROP_MUC:
         priv->muc = g_value_get_object (value);
         break;
-      case PROP_REQUESTED:
-        priv->requested = g_value_get_boolean (value);
-        break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
         break;
     }
 }
 
-static GObject *
-gabble_tube_dbus_constructor (GType type,
-                              guint n_props,
-                              GObjectConstructParam *props)
-{
-  GObject *obj;
-  GabbleTubeDBus *self;
-  GabbleTubeDBusPrivate *priv;
-  TpDBusDaemon *bus;
-  TpHandleRepoIface *contact_repo;
-  TpBaseConnection *base;
+static void
+gabble_tube_dbus_constructed (GObject *obj)
+{
+  GabbleTubeDBus *self = GABBLE_TUBE_DBUS (obj);
+  GabbleTubeDBusPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (obj);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
+  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+      base_conn, TP_HANDLE_TYPE_CONTACT);
   guint access_control;
 
-  obj = G_OBJECT_CLASS (gabble_tube_dbus_parent_class)->
-    constructor (type, n_props, props);
-  self = GABBLE_TUBE_DBUS (obj);
-
-  priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
-  base = (TpBaseConnection *) priv->conn;
-
-  /* Ref the initiator handle */
-  g_assert (base != NULL);
-  g_assert (priv->initiator != 0);
-  contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT);
-  tp_handle_ref (contact_repo, priv->initiator);
-
-  DEBUG ("Registering at '%s'", priv->object_path);
+  void (*chain_up) (GObject *) =
+    ((GObjectClass *) gabble_tube_dbus_parent_class)->constructed;
 
-  bus = tp_base_connection_get_dbus_daemon (base);
-  tp_dbus_daemon_register_object (bus, priv->object_path, obj);
+  if (chain_up != NULL)
+    chain_up (obj);
 
   priv->dbus_names = g_hash_table_new_full (g_direct_hash, g_direct_equal,
       NULL, g_free);
 
   g_assert (priv->self_handle != 0);
-  if (priv->handle_type == TP_HANDLE_TYPE_ROOM)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_ROOM)
     {
       /* We have to create a pseudo-IBB bytestream that will be
        * used by this MUC tube to communicate.
@@ -913,8 +749,8 @@
       DEBUG ("local name: %s", priv->dbus_local_name);
 
       bytestream = gabble_bytestream_factory_create_muc (
-          priv->conn->bytestream_factory,
-          priv->handle,
+          conn->bytestream_factory,
+          tp_base_channel_get_target_handle (base),
           priv->stream_id,
           GABBLE_BYTESTREAM_STATE_LOCAL_PENDING);
 
@@ -937,12 +773,12 @@
 
       g_assert (priv->muc == NULL);
 
-      if (priv->requested)
+      if (tp_base_channel_is_requested (base))
         {
           /* We created this outgoing 1-1 D-Bus tube and so will need SOCKS5
            * proxies when we'll offer it. */
           gabble_bytestream_factory_query_socks5_proxies (
-              priv->conn->bytestream_factory);
+              conn->bytestream_factory);
         }
     }
 
@@ -950,8 +786,8 @@
    * the initiator is not enough as we could re-join a muc containing and old
    * tube we created when we were in this room some time ago. In that case, we
    * have to accept it if we want to re-join the tube. */
-  if (priv->initiator == priv->self_handle &&
-      priv->requested)
+  if (tp_base_channel_get_initiator (base) == priv->self_handle &&
+      tp_base_channel_is_requested (base))
     {
       priv->offered = FALSE;
     }
@@ -972,24 +808,45 @@
   g_array_append_val (priv->supported_access_controls, access_control);
   access_control = TP_SOCKET_ACCESS_CONTROL_LOCALHOST;
   g_array_append_val (priv->supported_access_controls, access_control);
+}
+
+static void
+gabble_tube_dbus_fill_immutable_properties (TpBaseChannel *chan,
+    GHashTable *properties)
+{
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_CLASS (
+      gabble_tube_dbus_parent_class);
+
+  cls->fill_immutable_properties (chan, properties);
+
+  tp_dbus_properties_mixin_fill_properties_hash (
+      G_OBJECT (chan), properties,
+      TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "ServiceName",
+      TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "SupportedAccessControls",
+      NULL);
 
-  return obj;
+  if (!tp_base_channel_is_requested (chan))
+    {
+      tp_dbus_properties_mixin_fill_properties_hash (
+          G_OBJECT (chan), properties,
+          TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
+          NULL);
+    }
+}
+
+static gchar *
+gabble_tube_dbus_get_object_path_suffix (TpBaseChannel *base)
+{
+  GabbleTubeDBus *self = GABBLE_TUBE_DBUS (base);
+
+  return g_strdup_printf ("DBusTubeChannel/%u/%u",
+      tp_base_channel_get_target_handle (base),
+      self->priv->id);
 }
 
 static void
 gabble_tube_dbus_class_init (GabbleTubeDBusClass *gabble_tube_dbus_class)
 {
-  static TpDBusPropertiesMixinPropImpl channel_props[] = {
-      { "TargetHandleType", "handle-type", NULL },
-      { "TargetHandle", "handle", NULL },
-      { "ChannelType", "channel-type", NULL },
-      { "TargetID", "target-id", NULL },
-      { "Interfaces", "interfaces", NULL },
-      { "Requested", "requested", NULL },
-      { "InitiatorHandle", "initiator-handle", NULL },
-      { "InitiatorID", "initiator-id", NULL },
-      { NULL }
-  };
   static TpDBusPropertiesMixinPropImpl dbus_tube_props[] = {
       { "ServiceName", "service", NULL },
       { "DBusNames", "dbus-names", NULL },
@@ -1002,11 +859,6 @@
       { NULL }
   };
   static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
-      { TP_IFACE_CHANNEL,
-        tp_dbus_properties_mixin_getter_gobject_properties,
-        NULL,
-        channel_props,
-      },
       { TP_IFACE_CHANNEL_TYPE_DBUS_TUBE,
         tp_dbus_properties_mixin_getter_gobject_properties,
         NULL,
@@ -1020,28 +872,27 @@
       { NULL }
   };
   GObjectClass *object_class = G_OBJECT_CLASS (gabble_tube_dbus_class);
+  TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (gabble_tube_dbus_class);
   GParamSpec *param_spec;
 
   object_class->get_property = gabble_tube_dbus_get_property;
   object_class->set_property = gabble_tube_dbus_set_property;
-  object_class->constructor = gabble_tube_dbus_constructor;
+  object_class->constructed = gabble_tube_dbus_constructed;
+  object_class->dispose = gabble_tube_dbus_dispose;
+  object_class->finalize = gabble_tube_dbus_finalize;
+
+  base_class->channel_type = TP_IFACE_CHANNEL_TYPE_DBUS_TUBE;
+  base_class->interfaces = gabble_tube_dbus_interfaces;
+  base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT;
+  base_class->close = gabble_tube_dbus_close;
+  base_class->fill_immutable_properties =
+    gabble_tube_dbus_fill_immutable_properties;
+  base_class->get_object_path_suffix =
+    gabble_tube_dbus_get_object_path_suffix;
 
   g_type_class_add_private (gabble_tube_dbus_class,
       sizeof (GabbleTubeDBusPrivate));
 
-  object_class->dispose = gabble_tube_dbus_dispose;
-  object_class->finalize = gabble_tube_dbus_finalize;
-
-  g_object_class_override_property (object_class, PROP_OBJECT_PATH,
-      "object-path");
-  g_object_class_override_property (object_class, PROP_CHANNEL_TYPE,
-      "channel-type");
-  g_object_class_override_property (object_class, PROP_CONNECTION,
-    "connection");
-  g_object_class_override_property (object_class, PROP_HANDLE,
-    "handle");
-  g_object_class_override_property (object_class, PROP_HANDLE_TYPE,
-    "handle-type");
   g_object_class_override_property (object_class, PROP_SELF_HANDLE,
     "self-handle");
   g_object_class_override_property (object_class, PROP_ID,
@@ -1055,20 +906,6 @@
   g_object_class_override_property (object_class, PROP_STATE,
     "state");
 
-  g_object_class_override_property (object_class, PROP_CHANNEL_DESTROYED,
-      "channel-destroyed");
-  g_object_class_override_property (object_class, PROP_CHANNEL_PROPERTIES,
-      "channel-properties");
-
-  param_spec = g_param_spec_uint (
-      "initiator-handle",
-      "Initiator handle",
-      "The TpHandle of the initiator of this tube object.",
-      0, G_MAXUINT32, 0,
-      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIATOR_HANDLE,
-      param_spec);
-
   param_spec = g_param_spec_object (
       "bytestream",
       "Object implementing the GabbleBytestreamIface interface",
@@ -1113,31 +950,6 @@
       G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
   g_object_class_install_property (object_class, PROP_DBUS_NAMES, param_spec);
 
-  param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
-      "Additional Channel.Interface.* interfaces",
-      G_TYPE_STRV,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
-
-  param_spec = g_param_spec_string ("target-id", "Target JID",
-      "The string obtained by inspecting the target handle",
-      NULL,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
-
-  param_spec = g_param_spec_string ("initiator-id", "Initiator's bare JID",
-      "The string obtained by inspecting the initiator-handle",
-      NULL,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIATOR_ID,
-      param_spec);
-
-  param_spec = g_param_spec_boolean ("requested", "Requested?",
-      "True if this channel was requested by the local user",
-      FALSE,
-      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_REQUESTED, param_spec);
-
   param_spec = g_param_spec_object ("muc", "GabbleMucChannel object",
       "Gabble text MUC channel corresponding to this Tube channel object, "
       "if the handle type is ROOM.",
@@ -1219,6 +1031,10 @@
                         GError **error)
 {
   GabbleTubeDBusPrivate *priv = tube->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (tube);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
 
   if (priv->offered)
     {
@@ -1227,9 +1043,10 @@
       return FALSE;
     }
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
-      TpHandleRepoIface *contact_repo;
+      TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+          base_conn, TP_HANDLE_TYPE_CONTACT);
       const gchar *jid, *resource;
       gchar *full_jid;
       GabblePresence *presence;
@@ -1237,11 +1054,10 @@
       WockyStanza *msg;
       gboolean result;
 
-      contact_repo = tp_base_connection_get_handles (
-          (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
-      jid = tp_handle_inspect (contact_repo, priv->handle);
-      presence = gabble_presence_cache_get (priv->conn->presence_cache,
-          priv->handle);
+      jid = tp_handle_inspect (contact_repo,
+          tp_base_channel_get_target_handle (base));
+      presence = gabble_presence_cache_get (conn->presence_cache,
+          tp_base_channel_get_target_handle (base));
 
       if (presence == NULL)
         {
@@ -1272,11 +1088,11 @@
       tube_node = wocky_node_add_child_with_content (si_node, "tube", NULL);
       tube_node->ns = g_quark_from_string (NS_TUBES);
       gabble_tube_iface_publish_in_node (GABBLE_TUBE_IFACE (tube),
-          (TpBaseConnection *) priv->conn, tube_node);
+          base_conn, tube_node);
 
       tube->priv->offered = TRUE;
       result = gabble_bytestream_factory_negotiate_stream (
-          priv->conn->bytestream_factory, msg, priv->stream_id,
+          conn->bytestream_factory, msg, priv->stream_id,
           bytestream_negotiate_cb, tube, G_OBJECT (tube), error);
 
       /* We don't create the bytestream of private D-Bus tube yet.
@@ -1315,6 +1131,8 @@
                   size_t len)
 {
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (tube);
+  TpBaseChannel *base = TP_BASE_CHANNEL (tube);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
   DBusMessage *msg;
   DBusError error = {0,};
   const gchar *sender_name;
@@ -1332,7 +1150,7 @@
       return;
     }
 
-  if (priv->handle_type == TP_HANDLE_TYPE_ROOM)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_ROOM)
     {
       destination = dbus_message_get_destination (msg);
       /* If destination is NULL this msg is broadcasted (signals) so we don't
@@ -1415,8 +1233,10 @@
 {
   GabbleTubeDBus *tube = GABBLE_TUBE_DBUS (user_data);
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (tube);
+  TpBaseChannel *base = TP_BASE_CHANNEL (tube);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       GString *buf = priv->reassembly_buffer;
 
@@ -1480,7 +1300,7 @@
             {
               DEBUG ("D-Bus message has unknown endianness byte 0x%x, "
                   "closing tube", (unsigned int) buf->str[0]);
-              gabble_tube_dbus_close ((GabbleTubeIface *) tube, TRUE);
+              gabble_tube_iface_close ((GabbleTubeIface *) tube, TRUE);
               return;
             }
 
@@ -1501,7 +1321,7 @@
               priv->reassembly_bytes_needed > DBUS_MAXIMUM_MESSAGE_LENGTH)
             {
               DEBUG ("D-Bus message is too large to be valid, closing tube");
-              gabble_tube_dbus_close ((GabbleTubeIface *) tube, TRUE);
+              gabble_tube_iface_close ((GabbleTubeIface *) tube, TRUE);
               return;
             }
 
@@ -1534,16 +1354,14 @@
                       gboolean requested)
 {
   GabbleTubeDBus *tube;
-  gchar *object_path;
+  GType gtype = GABBLE_TYPE_TUBE_DBUS;
 
-  object_path = g_strdup_printf ("%s/DBusTubeChannel_%u_%u",
-      conn->parent.object_path, handle, id);
+  if (handle_type == TP_HANDLE_TYPE_ROOM)
+    gtype = GABBLE_TYPE_MUC_TUBE_DBUS;
 
-  tube = g_object_new (GABBLE_TYPE_TUBE_DBUS,
+  tube = g_object_new (gtype,
       "connection", conn,
-      "object-path", object_path,
       "handle", handle,
-      "handle-type", handle_type,
       "self-handle", self_handle,
       "initiator-handle", initiator,
       "service", service,
@@ -1557,7 +1375,6 @@
   if (bytestream != NULL)
     g_object_set (tube, "bytestream", bytestream, NULL);
 
-  g_free (object_path);
   return tube;
 }
 
@@ -1582,6 +1399,8 @@
 {
   GabbleTubeDBus *self = GABBLE_TUBE_DBUS (tube);
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
+  TpBaseChannel *base = TP_BASE_CHANNEL (tube);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
   GabbleBytestreamState state;
 
   g_assert (priv->bytestream != NULL);
@@ -1593,7 +1412,7 @@
   if (state != GABBLE_BYTESTREAM_STATE_LOCAL_PENDING)
     return TRUE;
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       /* Bytestream was created using a SI request so
        * we have to accept it */
@@ -1619,16 +1438,15 @@
 }
 
 /*
- * gabble_tube_dbus_close
+ * gabble_tube_iface_dbus_close
  *
  * Implements gabble_tube_iface_close on GabbleTubeIface
  */
 static void
-gabble_tube_dbus_close (GabbleTubeIface *tube, gboolean closed_remotely)
+gabble_tube_iface_dbus_close (GabbleTubeIface *tube,
+    gboolean closed_remotely)
 {
-  GabbleTubeDBus *self = GABBLE_TUBE_DBUS (tube);
-
-  do_close (self);
+  tp_base_channel_close (TP_BASE_CHANNEL (tube));
 }
 
 /**
@@ -1651,13 +1469,16 @@
                            const gchar *name)
 {
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+      base_conn, TP_HANDLE_TYPE_CONTACT);
   gchar *name_copy;
   GHashTable *added;
   GArray *removed;
 
-  g_assert (priv->handle_type == TP_HANDLE_TYPE_ROOM);
+  g_assert (cls->target_handle_type == TP_HANDLE_TYPE_ROOM);
   g_assert (g_hash_table_size (priv->dbus_names) ==
       g_hash_table_size (priv->dbus_name_to_handle));
 
@@ -1722,13 +1543,16 @@
                               TpHandle handle)
 {
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+      base_conn, TP_HANDLE_TYPE_CONTACT);
   const gchar *name;
   GHashTable *added;
   GArray *removed;
 
-  g_assert (priv->handle_type == TP_HANDLE_TYPE_ROOM);
+  g_assert (cls->target_handle_type == TP_HANDLE_TYPE_ROOM);
 
   name = g_hash_table_lookup (priv->dbus_names, GUINT_TO_POINTER (handle));
   if (name == NULL)
@@ -1760,8 +1584,9 @@
                                   TpHandle handle)
 {
   GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (self);
 
-  g_assert (priv->handle_type == TP_HANDLE_TYPE_ROOM);
+  g_assert (cls->target_handle_type == TP_HANDLE_TYPE_ROOM);
 
   return (g_hash_table_lookup (priv->dbus_names, GUINT_TO_POINTER (handle))
       != NULL);
@@ -1818,75 +1643,10 @@
   return result;
 }
 
-/**
- * gabble_tube_dbus_close_async:
- *
- * Implements D-Bus method Close
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_dbus_close_async (TpSvcChannel *iface,
-                                  DBusGMethodInvocation *context)
-{
-  gabble_tube_dbus_close (GABBLE_TUBE_IFACE (iface), FALSE);
-  tp_svc_channel_return_from_close (context);
-}
-
-/**
- * gabble_tube_dbus_get_channel_type
- *
- * Implements D-Bus method GetChannelType
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_dbus_get_channel_type (TpSvcChannel *iface,
-                                       DBusGMethodInvocation *context)
-{
-  tp_svc_channel_return_from_get_channel_type (context,
-      TP_IFACE_CHANNEL_TYPE_DBUS_TUBE);
-}
-
-/**
- * gabble_tube_dbus_get_handle
- *
- * Implements D-Bus method GetHandle
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_dbus_get_handle (TpSvcChannel *iface,
-                                 DBusGMethodInvocation *context)
-{
-  GabbleTubeDBus *self = GABBLE_TUBE_DBUS (iface);
-  GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
-
-  tp_svc_channel_return_from_get_handle (context, priv->handle_type,
-      priv->handle);
-}
-
-/**
- * gabble_tube_dbus_get_interfaces
- *
- * Implements D-Bus method GetInterfaces
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_dbus_get_interfaces (TpSvcChannel *iface,
-                                   DBusGMethodInvocation *context)
+const gchar * const *
+gabble_tube_dbus_channel_get_allowed_properties (void)
 {
-  GabbleTubeDBus *self = GABBLE_TUBE_DBUS (iface);
-  GabbleTubeDBusPrivate *priv = GABBLE_TUBE_DBUS_GET_PRIVATE (self);
-
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
-    {
-      /* omit the Group interface */
-      tp_svc_channel_return_from_get_interfaces (context,
-          gabble_tube_dbus_interfaces + 1);
-    }
-  else
-    {
-      tp_svc_channel_return_from_get_interfaces (context,
-          gabble_tube_dbus_interfaces);
-    }
+  return gabble_tube_dbus_channel_allowed_properties;
 }
 
 static gboolean
@@ -1984,27 +1744,6 @@
     }
 }
 
-const gchar * const *
-gabble_tube_dbus_channel_get_allowed_properties (void)
-{
-  return gabble_tube_dbus_channel_allowed_properties;
-}
-
-static void
-channel_iface_init (gpointer g_iface,
-                    gpointer iface_data)
-{
-  TpSvcChannelClass *klass = (TpSvcChannelClass *) g_iface;
-
-#define IMPLEMENT(x, suffix) tp_svc_channel_implement_##x (\
-    klass, gabble_tube_dbus_##x##suffix)
-  IMPLEMENT(close,_async);
-  IMPLEMENT(get_channel_type,);
-  IMPLEMENT(get_handle,);
-  IMPLEMENT(get_interfaces,);
-#undef IMPLEMENT
-}
-
 static void
 tube_iface_init (gpointer g_iface,
                  gpointer iface_data)
@@ -2012,7 +1751,7 @@
   GabbleTubeIfaceClass *klass = (GabbleTubeIfaceClass *) g_iface;
 
   klass->accept = gabble_tube_dbus_accept;
-  klass->close = gabble_tube_dbus_close;
+  klass->close = gabble_tube_iface_dbus_close;
   klass->add_bytestream = gabble_tube_dbus_add_bytestream;
 }
 
diff -Nru telepathy-gabble-0.15.4/src/tube-dbus.h telepathy-gabble-0.16.0/src/tube-dbus.h
--- telepathy-gabble-0.15.4/src/tube-dbus.h	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/src/tube-dbus.h	2012-02-29 20:02:02.000000000 +0000
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "connection.h"
 #include "bytestream-iface.h"
@@ -34,18 +35,18 @@
 G_BEGIN_DECLS
 
 typedef struct _GabbleTubeDBus GabbleTubeDBus;
-typedef struct _GabbleTubeDBusPrivate GabbleTubeDBusPrivate;
 typedef struct _GabbleTubeDBusClass GabbleTubeDBusClass;
+typedef struct _GabbleTubeDBusPrivate GabbleTubeDBusPrivate;
 
 struct _GabbleTubeDBusClass {
-  GObjectClass parent_class;
+  TpBaseChannelClass parent_class;
 
   TpDBusPropertiesMixinClass dbus_props_class;
   TpGroupMixinClass group_class;
 };
 
 struct _GabbleTubeDBus {
-  GObject parent;
+  TpBaseChannel parent;
   TpGroupMixin group;
 
   GabbleTubeDBusPrivate *priv;
diff -Nru telepathy-gabble-0.15.4/src/tube-iface.c telepathy-gabble-0.16.0/src/tube-iface.c
--- telepathy-gabble-0.15.4/src/tube-iface.c	2012-01-26 18:59:24.000000000 +0000
+++ telepathy-gabble-0.16.0/src/tube-iface.c	2012-03-20 23:33:34.000000000 +0000
@@ -63,32 +63,6 @@
     {
       GParamSpec *param_spec;
 
-      param_spec = g_param_spec_object (
-          "connection",
-          "GabbleConnection object",
-          "Gabble connection object that owns this tube object.",
-          GABBLE_TYPE_CONNECTION,
-          G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-      g_object_interface_install_property (klass, param_spec);
-
-      param_spec = g_param_spec_uint (
-          "handle",
-          "Handle",
-          "The TpHandle associated with the tubes channel that"
-          "owns this tube object.",
-          0, G_MAXUINT32, 0,
-          G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-      g_object_interface_install_property (klass, param_spec);
-
-      param_spec = g_param_spec_uint (
-          "handle-type",
-          "Handle type",
-          "The TpHandleType of the handle associated with the tubes channel"
-          "that owns this tube object.",
-          0, G_MAXUINT32, 0,
-          G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-      g_object_interface_install_property (klass, param_spec);
-
       param_spec = g_param_spec_uint (
           "self-handle",
           "Self handle",
diff -Nru telepathy-gabble-0.15.4/src/tubes-channel.c telepathy-gabble-0.16.0/src/tubes-channel.c
--- telepathy-gabble-0.15.4/src/tubes-channel.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/tubes-channel.c	2012-04-02 20:49:20.000000000 +0000
@@ -453,8 +453,6 @@
 
   tp_svc_channel_type_tubes_emit_tube_closed (self, tube_id);
 
-  tp_svc_channel_emit_closed (tube);
-
   /* Ideally, this should be done in the factory directly but the private
    * tubes factory and the muc factory are not aware of tube channels.
    * This design is a legacy of the old tube API and we can't really change it
@@ -561,12 +559,14 @@
     case TP_TUBE_TYPE_STREAM:
       tube = GABBLE_TUBE_IFACE (gabble_tube_stream_new (priv->conn,
           priv->handle, priv->handle_type, priv->self_handle, initiator,
-          service, parameters, tube_id, self->muc));
+          service, parameters, tube_id, self->muc, requested));
       break;
     default:
       g_return_val_if_reached (NULL);
     }
 
+  tp_base_channel_register ((TpBaseChannel *) tube);
+
   DEBUG ("create tube %u", tube_id);
   g_hash_table_insert (priv->tubes, GUINT_TO_POINTER (tube_id), tube);
 
diff -Nru telepathy-gabble-0.15.4/src/tube-stream.c telepathy-gabble-0.16.0/src/tube-stream.c
--- telepathy-gabble-0.15.4/src/tube-stream.c	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/tube-stream.c	2012-04-02 20:49:19.000000000 +0000
@@ -31,9 +31,7 @@
 #endif
 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -58,20 +56,20 @@
 #include "disco.h"
 #include "gabble-signals-marshal.h"
 #include "muc-channel.h"
+#include "muc-tube-stream.h"
 #include "namespaces.h"
 #include "presence-cache.h"
 #include "presence.h"
 #include "tube-iface.h"
 #include "util.h"
 
-static void channel_iface_init (gpointer, gpointer);
 static void tube_iface_init (gpointer g_iface, gpointer iface_data);
 static void streamtube_iface_init (gpointer g_iface, gpointer iface_data);
 
-G_DEFINE_TYPE_WITH_CODE (GabbleTubeStream, gabble_tube_stream, G_TYPE_OBJECT,
+G_DEFINE_TYPE_WITH_CODE (GabbleTubeStream, gabble_tube_stream,
+    TP_TYPE_BASE_CHANNEL,
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
       tp_dbus_properties_mixin_iface_init);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
     G_IMPLEMENT_INTERFACE (GABBLE_TYPE_TUBE_IFACE, tube_iface_init);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_STREAM_TUBE,
       streamtube_iface_init);
@@ -79,8 +77,7 @@
       NULL);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
       tp_external_group_mixin_iface_init);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL);
-    G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL));
+);
 
 static const gchar * const gabble_tube_stream_channel_allowed_properties[] = {
     TP_IFACE_CHANNEL ".TargetHandle",
@@ -90,10 +87,6 @@
 };
 
 static const gchar *gabble_tube_stream_interfaces[] = {
-    TP_IFACE_CHANNEL_INTERFACE_GROUP,
-    /* If more interfaces are added, either keep Group as the first, or change
-     * the implementations of gabble_tube_stream_get_interfaces () and
-     * gabble_tube_stream_get_property () too */
     TP_IFACE_CHANNEL_INTERFACE_TUBE,
     NULL
 };
@@ -125,13 +118,7 @@
 /* properties */
 enum
 {
-  PROP_OBJECT_PATH = 1,
-  PROP_CHANNEL_TYPE,
-  PROP_CONNECTION,
-  PROP_INTERFACES,
-  PROP_HANDLE,
-  PROP_HANDLE_TYPE,
-  PROP_SELF_HANDLE,
+  PROP_SELF_HANDLE = 1,
   PROP_ID,
   PROP_TYPE,
   PROP_SERVICE,
@@ -141,12 +128,6 @@
   PROP_ADDRESS,
   PROP_ACCESS_CONTROL,
   PROP_ACCESS_CONTROL_PARAM,
-  PROP_CHANNEL_DESTROYED,
-  PROP_CHANNEL_PROPERTIES,
-  PROP_REQUESTED,
-  PROP_TARGET_ID,
-  PROP_INITIATOR_HANDLE,
-  PROP_INITIATOR_ID,
   PROP_SUPPORTED_SOCKET_TYPES,
   PROP_MUC,
   LAST_PROPERTY
@@ -154,10 +135,6 @@
 
 struct _GabbleTubeStreamPrivate
 {
-  GabbleConnection *conn;
-  char *object_path;
-  TpHandle handle;
-  TpHandleType handle_type;
   TpHandle self_handle;
   guint id;
 
@@ -186,7 +163,6 @@
   GHashTable *transport_to_id;
   guint last_connection_id;
 
-  TpHandle initiator;
   gchar *service;
   GHashTable *parameters;
   TpTubeChannelState state;
@@ -200,13 +176,9 @@
   GibberListener *local_listener;
   GabbleMucChannel *muc;
 
-  gboolean closed;
-
   gboolean dispose_has_run;
 };
 
-#define GABBLE_TUBE_STREAM_GET_PRIVATE(obj) ((obj)->priv)
-
 typedef struct
 {
   GabbleTubeStream *self;
@@ -241,7 +213,7 @@
                    gpointer user_data)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (user_data);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GabbleBytestreamIface *bytestream;
 
   bytestream = g_hash_table_lookup (priv->transport_to_bytestream, transport);
@@ -261,7 +233,7 @@
     const gchar *error,
     const gchar *debug_msg)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   guint connection_id;
 
   connection_id = GPOINTER_TO_UINT (g_hash_table_lookup (priv->transport_to_id,
@@ -284,7 +256,7 @@
 transport_disconnected_cb (GibberTransport *transport,
                            GabbleTubeStream *self)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GabbleBytestreamIface *bytestream;
 
   fire_connection_closed (self, transport, TP_ERROR_STR_CANCELLED,
@@ -304,7 +276,7 @@
                   GabbleBytestreamIface *bytestream,
                   GibberTransport *transport)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
 
   DEBUG ("disconnect and remove transport");
   g_signal_handlers_disconnect_matched (transport, G_SIGNAL_MATCH_DATA,
@@ -329,7 +301,7 @@
 transport_buffer_empty_cb (GibberTransport *transport,
                            GabbleTubeStream *self)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GabbleBytestreamIface *bytestream;
   GabbleBytestreamState state;
 
@@ -369,7 +341,7 @@
                              gboolean blocked,
                              GabbleTubeStream *self)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GibberTransport *transport;
 
   transport = g_hash_table_lookup (priv->bytestream_to_transport,
@@ -385,7 +357,7 @@
                                    gpointer user_data)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (user_data);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
 
   DEBUG ("Called.");
 
@@ -436,7 +408,7 @@
                                gpointer user_data)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (object);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GibberTransport *transport = GIBBER_TRANSPORT (user_data);
 
   if (bytestream == NULL)
@@ -470,7 +442,12 @@
                          GibberTransport *transport,
                          GError **error)
 {
-  GabbleTubeStreamPrivate *priv;
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
+  TpHandle initiator = tp_base_channel_get_initiator (base);
   WockyNode *node, *si_node;
   WockyStanza *msg;
   TpHandleRepoIface *contact_repo;
@@ -478,21 +455,19 @@
   gchar *full_jid, *stream_id, *id_str;
   gboolean result;
 
-  priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
-
   contact_repo = tp_base_connection_get_handles (
-     (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+     base_conn, TP_HANDLE_TYPE_CONTACT);
 
-  jid = tp_handle_inspect (contact_repo, priv->initiator);
+  jid = tp_handle_inspect (contact_repo, initiator);
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       /* Private tube */
       GabblePresence *presence;
       const gchar *resource;
 
-      presence = gabble_presence_cache_get (priv->conn->presence_cache,
-          priv->initiator);
+      presence = gabble_presence_cache_get (conn->presence_cache,
+          initiator);
       if (presence == NULL)
         {
           DEBUG ("can't find initiator's presence");
@@ -530,7 +505,7 @@
 
   id_str = g_strdup_printf ("%u", priv->id);
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       node = wocky_node_add_child_with_content (si_node, "stream", NULL);
     }
@@ -543,7 +518,7 @@
   wocky_node_set_attribute (node, "tube", id_str);
 
   result = gabble_bytestream_factory_negotiate_stream (
-      priv->conn->bytestream_factory, msg, stream_id,
+      conn->bytestream_factory, msg, stream_id,
       extra_bytestream_negotiate_cb, g_object_ref (transport), G_OBJECT (self),
       error);
 
@@ -551,9 +526,7 @@
    * closed before we got the SI reply. */
 
   if (!result)
-    {
-      g_object_unref (transport);
-    }
+    g_object_unref (transport);
 
   g_object_unref (msg);
   g_free (stream_id);
@@ -567,7 +540,7 @@
 generate_connection_id (GabbleTubeStream *self,
                         GibberTransport *transport)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
 
   priv->last_connection_id++;
 
@@ -645,7 +618,7 @@
 check_incoming_connection (GabbleTubeStream *self,
                            GibberTransport *transport)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
 
   if (priv->access_control == TP_SOCKET_ACCESS_CONTROL_LOCALHOST)
     {
@@ -867,7 +840,7 @@
     GibberTransport *transport,
     TpHandle contact)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GValue access_control_param = {0,};
   guint connection_id;
 
@@ -913,7 +886,7 @@
 transport_connected_cb (GibberTransport *transport,
     transport_connected_data *data)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (data->self);
+  GabbleTubeStreamPrivate *priv = data->self->priv;
   GabbleBytestreamIface *bytestream;
 
   fire_new_remote_connection (data->self, transport, data->contact);
@@ -930,12 +903,13 @@
                           GabbleBytestreamIface *bytestream,
                           TpHandle contact)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
   GibberTransport *transport;
 
   DEBUG ("Called.");
 
-  g_assert (priv->initiator == priv->self_handle);
+  g_assert (tp_base_channel_is_requested (base));
 
 #ifdef GIBBER_TYPE_UNIX_TRANSPORT
   if (priv->address_type == TP_SOCKET_ADDRESS_TYPE_UNIX)
@@ -997,11 +971,12 @@
 tube_stream_open (GabbleTubeStream *self,
                   GError **error)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
 
   DEBUG ("called");
 
-  if (priv->initiator == priv->self_handle)
+  if (tp_base_channel_is_requested (base))
     /* Nothing to do if we are the initiator of this tube.
      * We'll connect to the socket each time request a new bytestream. */
     return TRUE;
@@ -1024,7 +999,7 @@
       int ret;
 
       generate_ascii_string (8, suffix);
-      path = g_strdup_printf ("/tmp/stream-salut-%.8s", suffix);
+      path = g_strdup_printf ("/tmp/stream-gabble-%.8s", suffix);
 
       DEBUG ("create socket: %s", path);
 
@@ -1136,7 +1111,6 @@
   priv->address = NULL;
   priv->access_control = TP_SOCKET_ACCESS_CONTROL_LOCALHOST;
   priv->access_control_param = NULL;
-  priv->closed = FALSE;
 
   priv->dispose_has_run = FALSE;
 }
@@ -1147,7 +1121,7 @@
                              gpointer user_data)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (user_data);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GibberTransport *transport = (GibberTransport *) value;
   GabbleBytestreamIface *bytestream = (GabbleBytestreamIface *) key;
 
@@ -1178,16 +1152,15 @@
 gabble_tube_stream_dispose (GObject *object)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (object);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
-  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = (TpBaseChannel *) self;
 
   if (priv->dispose_has_run)
     return;
 
   gabble_tube_iface_close (GABBLE_TUBE_IFACE (self), TRUE);
 
-  if (priv->initiator != priv->self_handle &&
+  if (tp_base_channel_is_requested (base) &&
       priv->address_type == TP_SOCKET_ADDRESS_TYPE_UNIX &&
       priv->address != NULL)
     {
@@ -1210,8 +1183,6 @@
   tp_clear_pointer (&priv->bytestream_to_transport, g_hash_table_unref);
   tp_clear_pointer (&priv->transport_to_id, g_hash_table_unref);
 
-  tp_handle_unref (contact_repo, priv->initiator);
-
   tp_clear_object (&priv->local_listener);
 
   if (priv->muc != NULL)
@@ -1229,9 +1200,8 @@
 gabble_tube_stream_finalize (GObject *object)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (object);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
 
-  g_free (priv->object_path);
   g_free (priv->service);
   g_hash_table_unref (priv->parameters);
 
@@ -1257,39 +1227,10 @@
                                GParamSpec *pspec)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (object);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
-  TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn;
+  GabbleTubeStreamPrivate *priv = self->priv;
 
   switch (property_id)
     {
-      case PROP_OBJECT_PATH:
-        g_value_set_string (value, priv->object_path);
-        break;
-      case PROP_CHANNEL_TYPE:
-        g_value_set_static_string (value,
-            TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
-        break;
-      case PROP_CONNECTION:
-        g_value_set_object (value, priv->conn);
-        break;
-      case PROP_INTERFACES:
-        if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
-          {
-            /* 1-1 tubes - omit the Group interface */
-            g_value_set_boxed (value, gabble_tube_stream_interfaces + 1);
-          }
-        else
-          {
-            /* MUC tubes */
-            g_value_set_boxed (value, gabble_tube_stream_interfaces);
-          }
-        break;
-      case PROP_HANDLE:
-        g_value_set_uint (value, priv->handle);
-        break;
-      case PROP_HANDLE_TYPE:
-        g_value_set_uint (value, priv->handle_type);
-        break;
       case PROP_SELF_HANDLE:
         g_value_set_uint (value, priv->self_handle);
         break;
@@ -1299,9 +1240,6 @@
       case PROP_TYPE:
         g_value_set_uint (value, TP_TUBE_TYPE_STREAM);
         break;
-      case PROP_INITIATOR_HANDLE:
-        g_value_set_uint (value, priv->initiator);
-        break;
       case PROP_SERVICE:
         g_value_set_string (value, priv->service);
         break;
@@ -1323,72 +1261,6 @@
       case PROP_ACCESS_CONTROL_PARAM:
         g_value_set_pointer (value, priv->access_control_param);
         break;
-      case PROP_CHANNEL_DESTROYED:
-        g_value_set_boolean (value, priv->closed);
-        break;
-      case PROP_CHANNEL_PROPERTIES:
-        {
-          GHashTable *properties;
-
-          properties = tp_dbus_properties_mixin_make_properties_hash (object,
-              TP_IFACE_CHANNEL, "TargetHandle",
-              TP_IFACE_CHANNEL, "TargetHandleType",
-              TP_IFACE_CHANNEL, "ChannelType",
-              TP_IFACE_CHANNEL, "TargetID",
-              TP_IFACE_CHANNEL, "InitiatorHandle",
-              TP_IFACE_CHANNEL, "InitiatorID",
-              TP_IFACE_CHANNEL, "Requested",
-              TP_IFACE_CHANNEL, "Interfaces",
-              TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "Service",
-              TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "SupportedSocketTypes",
-              NULL);
-
-          if (priv->initiator != priv->self_handle)
-            {
-              /* channel has not been requested so Parameters is immutable */
-              GValue *prop_value = g_slice_new0 (GValue);
-
-              /* FIXME: use tp_dbus_properties_mixin_add_properties once it's
-               * added in tp-glib */
-              tp_dbus_properties_mixin_get (object,
-                  TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
-                  prop_value, NULL);
-              g_assert (G_IS_VALUE (prop_value));
-
-              g_hash_table_insert (properties,
-                  g_strdup_printf ("%s.%s", TP_IFACE_CHANNEL_INTERFACE_TUBE,
-                    "Parameters"), prop_value);
-            }
-
-          g_value_take_boxed (value, properties);
-        }
-        break;
-      case PROP_REQUESTED:
-        g_value_set_boolean (value,
-            (priv->initiator == priv->self_handle));
-        break;
-      case PROP_INITIATOR_ID:
-          {
-            TpHandleRepoIface *repo = tp_base_connection_get_handles (
-                base_conn, TP_HANDLE_TYPE_CONTACT);
-
-            /* some channel can have o.f.T.Channel.InitiatorHandle == 0 but
-             * tubes always have an initiator */
-            g_assert (priv->initiator != 0);
-
-            g_value_set_string (value,
-                tp_handle_inspect (repo, priv->initiator));
-          }
-        break;
-      case PROP_TARGET_ID:
-          {
-            TpHandleRepoIface *repo = tp_base_connection_get_handles (
-                base_conn, priv->handle_type);
-
-            g_value_set_string (value,
-                tp_handle_inspect (repo, priv->handle));
-          }
-        break;
       case PROP_SUPPORTED_SOCKET_TYPES:
         g_value_take_boxed (value,
             gabble_tube_stream_get_supported_socket_types ());
@@ -1409,36 +1281,16 @@
                                  GParamSpec *pspec)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (object);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
 
   switch (property_id)
     {
-      case PROP_OBJECT_PATH:
-        g_free (priv->object_path);
-        priv->object_path = g_value_dup_string (value);
-        break;
-      case PROP_CHANNEL_TYPE:
-      /* this property is writable in the interface, but not actually
-       * meaningfully changeable on this channel, so we do nothing */
-      break;
-      case PROP_CONNECTION:
-        priv->conn = g_value_get_object (value);
-        break;
-      case PROP_HANDLE:
-        priv->handle = g_value_get_uint (value);
-        break;
-      case PROP_HANDLE_TYPE:
-        priv->handle_type = g_value_get_uint (value);
-        break;
       case PROP_SELF_HANDLE:
         priv->self_handle = g_value_get_uint (value);
         break;
       case PROP_ID:
         priv->id = g_value_get_uint (value);
         break;
-      case PROP_INITIATOR_HANDLE:
-        priv->initiator = g_value_get_uint (value);
-        break;
       case PROP_SERVICE:
         g_free (priv->service);
         priv->service = g_value_dup_string (value);
@@ -1479,30 +1331,23 @@
     }
 }
 
-static GObject *
-gabble_tube_stream_constructor (GType type,
-                                guint n_props,
-                                GObjectConstructParam *props)
-{
-  GObject *obj;
-  GabbleTubeStreamPrivate *priv;
-  TpDBusDaemon *bus;
-  TpHandleRepoIface *contact_repo;
-
-  obj = G_OBJECT_CLASS (gabble_tube_stream_parent_class)->
-           constructor (type, n_props, props);
+static void
+gabble_tube_stream_constructed (GObject *obj)
+{
+  GabbleTubeStream *self = GABBLE_TUBE_STREAM (obj);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
 
-  priv = GABBLE_TUBE_STREAM_GET_PRIVATE (GABBLE_TUBE_STREAM (obj));
+  void (*chain_up) (GObject *) =
+    ((GObjectClass *) gabble_tube_stream_parent_class)->constructed;
 
-  /* Ref the initiator handle */
-  g_assert (priv->conn != NULL);
-  g_assert (priv->initiator != 0);
-  contact_repo = tp_base_connection_get_handles
-      ((TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
-  tp_handle_ref (contact_repo, priv->initiator);
+  if (chain_up != NULL)
+    chain_up (obj);
 
-  /* Set initial state of the tube */
-  if (priv->initiator == priv->self_handle)
+  if (tp_base_channel_is_requested (base))
     {
       /* We initiated this tube */
       priv->state = TP_TUBE_CHANNEL_STATE_NOT_OFFERED;
@@ -1513,10 +1358,10 @@
 
       /* We'll need SOCKS5 proxies if the tube is accepted */
       gabble_bytestream_factory_query_socks5_proxies (
-          priv->conn->bytestream_factory);
+          conn->bytestream_factory);
     }
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       g_assert (priv->muc == NULL);
     }
@@ -1525,29 +1370,51 @@
       g_assert (priv->muc != NULL);
       tp_external_group_mixin_init (obj, (GObject *) priv->muc);
     }
+}
 
-  bus = tp_base_connection_get_dbus_daemon ((TpBaseConnection *) priv->conn);
-  tp_dbus_daemon_register_object (bus, priv->object_path, obj);
+static void
+gabble_tube_stream_fill_immutable_properties (TpBaseChannel *chan,
+    GHashTable *properties)
+{
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_CLASS (
+      gabble_tube_stream_parent_class);
 
-  DEBUG ("Registering at '%s'", priv->object_path);
+  cls->fill_immutable_properties (chan, properties);
 
-  return obj;
+  tp_dbus_properties_mixin_fill_properties_hash (
+      G_OBJECT (chan), properties,
+      TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "Service",
+      TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "SupportedSocketTypes",
+      NULL);
+
+  if (!tp_base_channel_is_requested (chan))
+    {
+      tp_dbus_properties_mixin_fill_properties_hash (
+          G_OBJECT (chan), properties,
+          TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters",
+          NULL);
+    }
+}
+
+static gchar *
+gabble_tube_stream_get_object_path_suffix (TpBaseChannel *base)
+{
+  GabbleTubeStream *self = GABBLE_TUBE_STREAM (base);
+
+  return g_strdup_printf ("StreamTubeChannel/%u/%u",
+      tp_base_channel_get_target_handle (base),
+      self->priv->id);
+}
+
+static void
+gabble_tube_stream_close (TpBaseChannel *base)
+{
+  gabble_tube_iface_close (GABBLE_TUBE_IFACE (base), FALSE);
 }
 
 static void
 gabble_tube_stream_class_init (GabbleTubeStreamClass *gabble_tube_stream_class)
 {
-  static TpDBusPropertiesMixinPropImpl channel_props[] = {
-      { "TargetHandleType", "handle-type", NULL },
-      { "TargetHandle", "handle", NULL },
-      { "ChannelType", "channel-type", NULL },
-      { "TargetID", "target-id", NULL },
-      { "Interfaces", "interfaces", NULL },
-      { "Requested", "requested", NULL },
-      { "InitiatorHandle", "initiator-handle", NULL },
-      { "InitiatorID", "initiator-id", NULL },
-      { NULL }
-  };
   static TpDBusPropertiesMixinPropImpl stream_tube_props[] = {
       { "Service", "service", NULL },
       { "SupportedSocketTypes", "supported-socket-types", NULL },
@@ -1559,11 +1426,6 @@
       { NULL }
   };
   static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
-      { TP_IFACE_CHANNEL,
-        tp_dbus_properties_mixin_getter_gobject_properties,
-        NULL,
-        channel_props,
-      },
       { TP_IFACE_CHANNEL_TYPE_STREAM_TUBE,
         tp_dbus_properties_mixin_getter_gobject_properties,
         NULL,
@@ -1577,28 +1439,27 @@
       { NULL }
   };
   GObjectClass *object_class = G_OBJECT_CLASS (gabble_tube_stream_class);
+  TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (gabble_tube_stream_class);
   GParamSpec *param_spec;
 
   object_class->get_property = gabble_tube_stream_get_property;
   object_class->set_property = gabble_tube_stream_set_property;
-  object_class->constructor = gabble_tube_stream_constructor;
+  object_class->constructed = gabble_tube_stream_constructed;
+  object_class->dispose = gabble_tube_stream_dispose;
+  object_class->finalize = gabble_tube_stream_finalize;
+
+  base_class->channel_type = TP_IFACE_CHANNEL_TYPE_STREAM_TUBE;
+  base_class->interfaces = gabble_tube_stream_interfaces;
+  base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT;
+  base_class->close = gabble_tube_stream_close;
+  base_class->fill_immutable_properties =
+    gabble_tube_stream_fill_immutable_properties;
+  base_class->get_object_path_suffix =
+    gabble_tube_stream_get_object_path_suffix;
 
   g_type_class_add_private (gabble_tube_stream_class,
       sizeof (GabbleTubeStreamPrivate));
 
-  object_class->dispose = gabble_tube_stream_dispose;
-  object_class->finalize = gabble_tube_stream_finalize;
-
-  g_object_class_override_property (object_class, PROP_OBJECT_PATH,
-      "object-path");
-  g_object_class_override_property (object_class, PROP_CHANNEL_TYPE,
-      "channel-type");
-  g_object_class_override_property (object_class, PROP_CONNECTION,
-      "connection");
-  g_object_class_override_property (object_class, PROP_HANDLE,
-      "handle");
-  g_object_class_override_property (object_class, PROP_HANDLE_TYPE,
-      "handle-type");
   g_object_class_override_property (object_class, PROP_SELF_HANDLE,
       "self-handle");
   g_object_class_override_property (object_class, PROP_ID,
@@ -1612,11 +1473,6 @@
   g_object_class_override_property (object_class, PROP_STATE,
       "state");
 
-  g_object_class_override_property (object_class, PROP_CHANNEL_DESTROYED,
-      "channel-destroyed");
-  g_object_class_override_property (object_class, PROP_CHANNEL_PROPERTIES,
-      "channel-properties");
-
   param_spec = g_param_spec_boxed (
       "supported-socket-types",
       "Supported socket types",
@@ -1665,38 +1521,6 @@
   g_object_class_install_property (object_class, PROP_ACCESS_CONTROL_PARAM,
       param_spec);
 
-  param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
-      "Additional Channel.Interface.* interfaces",
-      G_TYPE_STRV,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
-
-  param_spec = g_param_spec_string ("target-id", "Target JID",
-      "The string obtained by inspecting the target handle",
-      NULL,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec);
-
-  param_spec = g_param_spec_uint ("initiator-handle", "Initiator's handle",
-      "The contact who initiated the channel",
-      0, G_MAXUINT32, 0,
-      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIATOR_HANDLE,
-      param_spec);
-
-  param_spec = g_param_spec_string ("initiator-id", "Initiator's bare JID",
-      "The string obtained by inspecting the initiator-handle",
-      NULL,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_INITIATOR_ID,
-      param_spec);
-
-  param_spec = g_param_spec_boolean ("requested", "Requested?",
-      "True if this channel was requested by the local user",
-      FALSE,
-      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_REQUESTED, param_spec);
-
   param_spec = g_param_spec_object (
       "muc",
       "GabbleMucChannel object",
@@ -1756,7 +1580,7 @@
                   gpointer user_data)
 {
   GabbleTubeStream *tube = GABBLE_TUBE_STREAM (user_data);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (tube);
+  GabbleTubeStreamPrivate *priv = tube->priv;
   GibberTransport *transport;
   GError *error = NULL;
 
@@ -1797,28 +1621,27 @@
                         const gchar *service,
                         GHashTable *parameters,
                         guint id,
-                        GabbleMucChannel *muc)
+                        GabbleMucChannel *muc,
+                        gboolean requested)
 {
   GabbleTubeStream *obj;
-  char *object_path;
+  GType gtype = GABBLE_TYPE_TUBE_STREAM;
 
-  object_path = g_strdup_printf ("%s/StreamTubeChannel_%u_%u",
-      conn->parent.object_path, handle, id);
+  if (handle_type == TP_HANDLE_TYPE_ROOM)
+    gtype = GABBLE_TYPE_MUC_TUBE_STREAM;
 
-  obj = g_object_new (GABBLE_TYPE_TUBE_STREAM,
+  obj = g_object_new (gtype,
       "connection", conn,
-      "object-path", object_path,
       "handle", handle,
-      "handle-type", handle_type,
       "self-handle", self_handle,
       "initiator-handle", initiator,
       "service", service,
       "parameters", parameters,
       "id", id,
       "muc", muc,
+      "requested", requested,
       NULL);
 
-  g_free (object_path);
   return obj;
 }
 
@@ -1832,7 +1655,7 @@
                            GError **error)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (tube);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
 
   if (!gabble_tube_stream_check_params (priv->address_type, NULL,
         priv->access_control, priv->access_control_param, error))
@@ -1871,32 +1694,37 @@
 }
 
 /**
- * gabble_tube_stream_close
+ * gabble_tube_iface_stream_close
  *
  * Implements gabble_tube_iface_close on GabbleTubeIface
  */
 static void
-gabble_tube_stream_close (GabbleTubeIface *tube, gboolean closed_remotely)
+gabble_tube_iface_stream_close (GabbleTubeIface *tube,
+    gboolean closed_remotely)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (tube);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
 
-  if (priv->closed)
+  if (tp_base_channel_is_destroyed (base))
     return;
-  priv->closed = TRUE;
 
   g_hash_table_foreach_remove (priv->bytestream_to_transport,
       close_each_extra_bytestream, self);
 
-  if (!closed_remotely && priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (!closed_remotely && cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       WockyStanza *msg;
       const gchar *jid;
       TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-          (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+          base_conn, TP_HANDLE_TYPE_CONTACT);
       gchar *id_str;
 
-      jid = tp_handle_inspect (contact_repo, priv->handle);
+      jid = tp_handle_inspect (contact_repo,
+          tp_base_channel_get_target_handle (base));
       id_str = g_strdup_printf ("%u", priv->id);
 
       /* Send the close message */
@@ -1911,12 +1739,22 @@
           NULL);
       g_free (id_str);
 
-      _gabble_connection_send (priv->conn, msg, NULL);
+      _gabble_connection_send (conn, msg, NULL);
 
       g_object_unref (msg);
     }
 
+  /* Take a ref to ourselves as when we emit tube-closed
+   * GabbleTubesChannel will drop our last ref but we still need to
+   * declare ourselves as destroyed. This is rubbish, but will
+   * disappear when we finally remove the Tubes channel type.. */
+  g_object_ref (self);
+
   g_signal_emit (G_OBJECT (self), signals[CLOSED], 0);
+
+  tp_base_channel_destroyed (base);
+
+  g_object_unref (self);
 }
 
 static void
@@ -1940,11 +1778,12 @@
                                    GabbleBytestreamIface *bytestream)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (tube);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
   TpHandle contact;
   GibberTransport *transport;
 
-  if (priv->initiator != priv->self_handle)
+  if (!tp_base_channel_is_requested (base))
     {
       DEBUG ("I'm not the initiator of this tube, can't accept "
           "an extra bytestream");
@@ -2211,7 +2050,11 @@
 send_tube_offer (GabbleTubeStream *self,
                  GError **error)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseConnection *base_conn = tp_base_channel_get_connection (base);
+  GabbleConnection *conn = GABBLE_CONNECTION (base_conn);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
   WockyNode *tube_node = NULL;
   WockyStanza *msg;
   TpHandleRepoIface *contact_repo;
@@ -2221,15 +2064,16 @@
   const gchar *resource;
   gchar *full_jid;
 
-  g_assert (priv->handle_type == TP_HANDLE_TYPE_CONTACT);
+  g_assert (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT);
 
-  contact_repo = tp_base_connection_get_handles (
-     (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+  contact_repo = tp_base_connection_get_handles (base_conn,
+     TP_HANDLE_TYPE_CONTACT);
 
-  jid = tp_handle_inspect (contact_repo, priv->handle);
+  jid = tp_handle_inspect (contact_repo,
+      tp_base_channel_get_target_handle (base));
 
-  presence = gabble_presence_cache_get (priv->conn->presence_cache,
-      priv->handle);
+  presence = gabble_presence_cache_get (conn->presence_cache,
+      tp_base_channel_get_target_handle (base));
   if (presence == NULL)
     {
       DEBUG ("can't find tube recipient's presence");
@@ -2263,9 +2107,9 @@
   g_assert (tube_node != NULL);
 
   gabble_tube_iface_publish_in_node (GABBLE_TUBE_IFACE (self),
-      (TpBaseConnection *) priv->conn, tube_node);
+      base_conn, tube_node);
 
-  result = _gabble_connection_send (priv->conn, msg, error);
+  result = _gabble_connection_send (conn, msg, error);
   if (result)
     {
       priv->state = TP_TUBE_CHANNEL_STATE_REMOTE_PENDING;
@@ -2280,11 +2124,13 @@
 gabble_tube_stream_offer (GabbleTubeStream *self,
                           GError **error)
 {
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
 
   g_assert (priv->state == TP_TUBE_CHANNEL_STATE_NOT_OFFERED);
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       /* 1-1 tube. Send tube offer message */
       if (!send_tube_offer (self, error))
@@ -2386,8 +2232,10 @@
     DBusGMethodInvocation *context)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (iface);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GError *error = NULL;
+  TpBaseChannel *base = TP_BASE_CHANNEL (self);
+  TpBaseChannelClass *cls = TP_BASE_CHANNEL_GET_CLASS (base);
 
   if (priv->state != TP_TUBE_CHANNEL_STATE_NOT_OFFERED)
     {
@@ -2419,7 +2267,7 @@
 
   if (!gabble_tube_stream_offer (self, &error))
     {
-      gabble_tube_stream_close (GABBLE_TUBE_IFACE (self), TRUE);
+      gabble_tube_iface_stream_close (GABBLE_TUBE_IFACE (self), TRUE);
 
       dbus_g_method_return_error (context, error);
 
@@ -2427,7 +2275,7 @@
       return;
     }
 
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
+  if (cls->target_handle_type == TP_HANDLE_TYPE_CONTACT)
     {
       tp_svc_channel_interface_tube_emit_tube_channel_state_changed (
           self, TP_TUBE_CHANNEL_STATE_REMOTE_PENDING);
@@ -2455,7 +2303,7 @@
     DBusGMethodInvocation *context)
 {
   GabbleTubeStream *self = GABBLE_TUBE_STREAM (iface);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
+  GabbleTubeStreamPrivate *priv = self->priv;
   GError *error = NULL;
 
   /* parameters sanity checks are done in gabble_tube_stream_accept */
@@ -2482,77 +2330,6 @@
       priv->address);
 }
 
-/**
- * gabble_tube_stream_close_async:
- *
- * Implements D-Bus method Close
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_stream_close_async (TpSvcChannel *iface,
-                                  DBusGMethodInvocation *context)
-{
-  gabble_tube_stream_close (GABBLE_TUBE_IFACE (iface), FALSE);
-  tp_svc_channel_return_from_close (context);
-}
-
-/**
- * gabble_tube_stream_get_channel_type
- *
- * Implements D-Bus method GetChannelType
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_stream_get_channel_type (TpSvcChannel *iface,
-                                       DBusGMethodInvocation *context)
-{
-  tp_svc_channel_return_from_get_channel_type (context,
-      TP_IFACE_CHANNEL_TYPE_STREAM_TUBE);
-}
-
-/**
- * gabble_tube_stream_get_handle
- *
- * Implements D-Bus method GetHandle
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_stream_get_handle (TpSvcChannel *iface,
-                                 DBusGMethodInvocation *context)
-{
-  GabbleTubeStream *self = GABBLE_TUBE_STREAM (iface);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
-
-  tp_svc_channel_return_from_get_handle (context, priv->handle_type,
-      priv->handle);
-}
-
-/**
- * gabble_tube_stream_get_interfaces
- *
- * Implements D-Bus method GetInterfaces
- * on interface org.freedesktop.Telepathy.Channel
- */
-static void
-gabble_tube_stream_get_interfaces (TpSvcChannel *iface,
-                                   DBusGMethodInvocation *context)
-{
-  GabbleTubeStream *self = GABBLE_TUBE_STREAM (iface);
-  GabbleTubeStreamPrivate *priv = GABBLE_TUBE_STREAM_GET_PRIVATE (self);
-
-  if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
-    {
-      /* omit the Group interface */
-      tp_svc_channel_return_from_get_interfaces (context,
-          gabble_tube_stream_interfaces + 1);
-    }
-  else
-    {
-      tp_svc_channel_return_from_get_interfaces (context,
-          gabble_tube_stream_interfaces);
-    }
-}
-
 const gchar * const *
 gabble_tube_stream_channel_get_allowed_properties (void)
 {
@@ -2560,28 +2337,13 @@
 }
 
 static void
-channel_iface_init (gpointer g_iface,
-                    gpointer iface_data)
-{
-  TpSvcChannelClass *klass = (TpSvcChannelClass *) g_iface;
-
-#define IMPLEMENT(x, suffix) tp_svc_channel_implement_##x (\
-    klass, gabble_tube_stream_##x##suffix)
-  IMPLEMENT(close,_async);
-  IMPLEMENT(get_channel_type,);
-  IMPLEMENT(get_handle,);
-  IMPLEMENT(get_interfaces,);
-#undef IMPLEMENT
-}
-
-static void
 tube_iface_init (gpointer g_iface,
                  gpointer iface_data)
 {
   GabbleTubeIfaceClass *klass = (GabbleTubeIfaceClass *) g_iface;
 
   klass->accept = gabble_tube_stream_accept;
-  klass->close = gabble_tube_stream_close;
+  klass->close = gabble_tube_iface_stream_close;
   klass->add_bytestream = gabble_tube_stream_add_bytestream;
 }
 
diff -Nru telepathy-gabble-0.15.4/src/tube-stream.h telepathy-gabble-0.16.0/src/tube-stream.h
--- telepathy-gabble-0.15.4/src/tube-stream.h	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/src/tube-stream.h	2012-02-29 20:02:02.000000000 +0000
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 
 #include "connection.h"
 #include "extensions/extensions.h"
@@ -36,13 +37,13 @@
 typedef struct _GabbleTubeStreamClass GabbleTubeStreamClass;
 
 struct _GabbleTubeStreamClass {
-  GObjectClass parent_class;
+  TpBaseChannelClass parent_class;
 
   TpDBusPropertiesMixinClass dbus_props_class;
 };
 
 struct _GabbleTubeStream {
-  GObject parent;
+  TpBaseChannel parent;
 
   GabbleTubeStreamPrivate *priv;
 };
@@ -68,7 +69,7 @@
 GabbleTubeStream *gabble_tube_stream_new (GabbleConnection *conn,
     TpHandle handle, TpHandleType handle_type, TpHandle self_handle,
     TpHandle initiator, const gchar *service, GHashTable *parameters,
-    guint id, GabbleMucChannel *muc);
+    guint id, GabbleMucChannel *muc, gboolean requested);
 
 gboolean gabble_tube_stream_check_params (TpSocketAddressType address_type,
     const GValue *address, TpSocketAccessControl access_control,
diff -Nru telepathy-gabble-0.15.4/src/types.h telepathy-gabble-0.16.0/src/types.h
--- telepathy-gabble-0.15.4/src/types.h	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/src/types.h	2012-03-07 20:26:07.000000000 +0000
@@ -43,20 +43,9 @@
 
 typedef struct _GabbleTubesChannel GabbleTubesChannel;
 
-typedef struct _GabbleJingleFactory GabbleJingleFactory;
-typedef struct _GabbleJingleSession GabbleJingleSession;
-typedef struct _GabbleJingleContent GabbleJingleContent;
-typedef struct _GabbleJingleTransportGoogle GabbleJingleTransportGoogle;
-typedef struct _GabbleJingleTransportRawUdp GabbleJingleTransportRawUdp;
-typedef struct _GabbleJingleTransportIceUdp GabbleJingleTransportIceUdp;
-typedef struct _GabbleJingleMediaRtp GabbleJingleMediaRtp;
-typedef struct _GabbleJingleShare GabbleJingleShare;
-
 typedef struct _GabbleCallMember GabbleCallMember;
 typedef struct _GabbleCallMemberContent GabbleCallMemberContent;
 
-typedef struct _JingleCandidate JingleCandidate;
-
 struct _GabbleDiscoIdentity
 {
     gchar *category;
@@ -65,12 +54,6 @@
     gchar *name;
 };
 
-typedef enum {
-    INITIATOR_INVALID = -1,
-    INITIATOR_LOCAL = 0,
-    INITIATOR_REMOTE,
-} JingleInitiator;
-
 G_END_DECLS
 
 #endif
diff -Nru telepathy-gabble-0.15.4/src/util.c telepathy-gabble-0.16.0/src/util.c
--- telepathy-gabble-0.15.4/src/util.c	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/src/util.c	2012-03-26 18:00:06.000000000 +0000
@@ -762,8 +762,31 @@
   return wocky_contact_factory_ensure_bare_contact (contact_factory, jid);
 }
 
-#define TWICE(x) x, x
+TpHandle
+ensure_handle_from_contact (
+    GabbleConnection *conn,
+    WockyContact *contact)
+{
+  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+      (TpBaseConnection *) conn, TP_HANDLE_TYPE_CONTACT);
+  gchar *jid = wocky_contact_dup_jid (contact);
+  GError *error = NULL;
+  TpHandle handle = tp_handle_ensure (contact_repo, jid, NULL, &error);
+
+  if (handle == 0)
+    {
+      g_critical ("Contact %p has JID '%s' which is not valid: %s",
+          contact, jid, error->message);
+      g_clear_error (&error);
+    }
+
+  g_free (jid);
+  return handle;
+}
+
+#ifdef ENABLE_VOIP
 
+#define TWICE(x) x, x
 static gboolean
 jingle_pick_resource_or_bare_jid (GabblePresence *presence,
     GabbleCapabilitySet *caps, const gchar **resource)
@@ -974,6 +997,22 @@
     }
 }
 
+static TpCallStreamCandidateType
+tp_candidate_type_from_jingle (JingleCandidateType type)
+{
+  switch (type)
+    {
+    default:
+      /* Consider UNKNOWN as LOCAL/HOST */
+    case JINGLE_CANDIDATE_TYPE_LOCAL:
+      return TP_CALL_STREAM_CANDIDATE_TYPE_HOST;
+    case JINGLE_CANDIDATE_TYPE_STUN:
+      return TP_CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE;
+    case JINGLE_CANDIDATE_TYPE_RELAY:
+      return TP_CALL_STREAM_CANDIDATE_TYPE_RELAY;
+    }
+}
+
 /**
  * @candidates: (element-type JingleCandidate): candidates
  *
@@ -996,7 +1035,7 @@
 
         info = tp_asv_new (
           "protocol", G_TYPE_UINT, cand->protocol,
-          "type", G_TYPE_UINT, cand->type,
+          "type", G_TYPE_UINT, tp_candidate_type_from_jingle (cand->type),
           "foundation", G_TYPE_STRING, cand->id,
           "priority", G_TYPE_UINT, cand->preference,
           "username", G_TYPE_STRING, cand->username,
@@ -1016,6 +1055,8 @@
   return arr;
 }
 
+#endif
+
 gchar *
 gabble_peer_to_jid (GabbleConnection *conn,
     TpHandle peer,
diff -Nru telepathy-gabble-0.15.4/src/util.h telepathy-gabble-0.16.0/src/util.h
--- telepathy-gabble-0.15.4/src/util.h	2012-02-09 12:56:57.000000000 +0000
+++ telepathy-gabble-0.16.0/src/util.h	2012-03-26 18:00:06.000000000 +0000
@@ -29,8 +29,10 @@
 #include 
 #include 
 
+#ifdef ENABLE_VOIP
 #include "jingle-factory.h"
 #include "jingle-content.h"
+#endif
 
 #include "types.h"
 
@@ -72,7 +74,11 @@
 
 WockyBareContact * ensure_bare_contact_from_jid (GabbleConnection *conn,
     const gchar *jid);
+TpHandle ensure_handle_from_contact (
+    GabbleConnection *conn,
+    WockyContact *contact);
 
+#ifdef ENABLE_VOIP
 gboolean jingle_pick_best_resource (GabbleConnection *conn,
     TpHandle peer,
     gboolean want_audio,
@@ -87,6 +93,7 @@
     JingleMediaType type);
 
 GPtrArray *gabble_call_candidates_to_array (GList *candidates);
+#endif
 
 gchar * gabble_peer_to_jid (GabbleConnection *conn,
     TpHandle peer,
diff -Nru telepathy-gabble-0.15.4/tests/Makefile.in telepathy-gabble-0.16.0/tests/Makefile.in
--- telepathy-gabble-0.15.4/tests/Makefile.in	2012-02-21 19:23:46.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -346,6 +346,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
diff -Nru telepathy-gabble-0.15.4/tests/suppressions/Makefile.in telepathy-gabble-0.16.0/tests/suppressions/Makefile.in
--- telepathy-gabble-0.15.4/tests/suppressions/Makefile.in	2012-02-21 19:23:46.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/suppressions/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -193,6 +193,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/advertise-contact-caps.py telepathy-gabble-0.16.0/tests/twisted/caps/advertise-contact-caps.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/advertise-contact-caps.py	2012-01-18 12:45:07.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/advertise-contact-caps.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,7 +13,11 @@
 import constants as cs
 import ns
 
-from config import FILE_TRANSFER_ENABLED
+from config import FILE_TRANSFER_ENABLED, VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
 
 def noop_presence_update(q, stream):
     # At the moment Gabble does not optimize away presence updates that
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/advertise-legacy.py telepathy-gabble-0.16.0/tests/twisted/caps/advertise-legacy.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/advertise-legacy.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/advertise-legacy.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,6 +13,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def run_test(q, bus, conn, stream):
     initial_presence = q.expect('stream-presence')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/caps-cache.py telepathy-gabble-0.16.0/tests/twisted/caps/caps-cache.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/caps-cache.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/caps-cache.py	2012-03-26 18:00:06.000000000 +0000
@@ -14,6 +14,12 @@
     compute_caps_hash, fake_client_dataforms, presence_and_disco,
     send_presence, expect_disco, send_disco_reply)
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 client = 'http://telepathy.freedesktop.org/fake-client/caps-cache'
 features = [
     ns.JINGLE_015,
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/caps-persistent-cache.py telepathy-gabble-0.16.0/tests/twisted/caps/caps-persistent-cache.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/caps-persistent-cache.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/caps-persistent-cache.py	2012-03-26 18:00:06.000000000 +0000
@@ -9,6 +9,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 contact_bare_jid = 'macbeth@glamis'
 contact_jid = 'macbeth@glamis/hall'
 client = 'http://telepathy.freedesktop.org/zomg-ponies'
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/compat-bundles.py telepathy-gabble-0.16.0/tests/twisted/caps/compat-bundles.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/compat-bundles.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/compat-bundles.py	2012-03-26 18:00:06.000000000 +0000
@@ -16,6 +16,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def disco_bundle(q, bus, conn, stream, node, features):
     request = \
         elem_iq(stream, 'get', from_='fake_contact@jabber.org/resource')(
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/from-bare-jid.py telepathy-gabble-0.16.0/tests/twisted/caps/from-bare-jid.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/from-bare-jid.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/from-bare-jid.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     client = 'http://example.com/perverse-client'
     contact_bare_jid = 'edgecase@example.com'
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/hashed-caps.py telepathy-gabble-0.16.0/tests/twisted/caps/hashed-caps.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/hashed-caps.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/hashed-caps.py	2012-03-26 18:00:06.000000000 +0000
@@ -34,6 +34,12 @@
     compute_caps_hash, make_caps_disco_reply, send_disco_reply,
     fake_client_dataforms)
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 caps_changed_flag = False
 
 some_identities = [
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/initial-caps.py telepathy-gabble-0.16.0/tests/twisted/caps/initial-caps.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/initial-caps.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/initial-caps.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,8 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
 def run_test(q, bus, conn, stream):
     initial_presence = q.expect('stream-presence')
 
@@ -19,13 +21,18 @@
 
     # For some reason, until we advertise any capabilities, these caps turn
     # up in our presence
-    check_caps(namespaces, [
-        ns.JINGLE,
-        ns.JINGLE_015,
-        ns.JINGLE_TRANSPORT_ICEUDP,
-        ns.JINGLE_TRANSPORT_RAWUDP,
-        ns.GOOGLE_P2P
-        ])
+    if VOIP_ENABLED:
+        caps = [
+            ns.JINGLE,
+            ns.JINGLE_015,
+            ns.JINGLE_TRANSPORT_ICEUDP,
+            ns.JINGLE_TRANSPORT_RAWUDP,
+            ns.GOOGLE_P2P
+            ]
+    else:
+        caps = []
+
+    check_caps(namespaces, caps)
 
 if __name__ == '__main__':
     exec_test(run_test)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/jingle-caps.py telepathy-gabble-0.16.0/tests/twisted/caps/jingle-caps.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/jingle-caps.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/jingle-caps.py	2012-03-26 18:00:06.000000000 +0000
@@ -14,6 +14,12 @@
 from caps_helper import presence_and_disco, compute_caps_hash
 from jingle.jingletest2 import JingleTest2, JingleProtocol031
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 client = 'http://telepathy.freedesktop.org/fake-client'
 caps = { 'node': client, 'ver':  "dummy", 'hash': 'sha-1' }
 all_transports = [
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/receive-jingle.py telepathy-gabble-0.16.0/tests/twisted/caps/receive-jingle.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/receive-jingle.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/receive-jingle.py	2012-03-26 18:00:06.000000000 +0000
@@ -8,6 +8,12 @@
 from gabbletest import exec_test, make_result_iq, make_presence, sync_stream
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 icaps_attr  = cs.CONN_IFACE_CAPS + "/caps"
 basic_caps = [(2, cs.CHANNEL_TYPE_TEXT, 3, 0)]
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps/trust-thyself.py telepathy-gabble-0.16.0/tests/twisted/caps/trust-thyself.py
--- telepathy-gabble-0.15.4/tests/twisted/caps/trust-thyself.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps/trust-thyself.py	2012-03-26 18:00:06.000000000 +0000
@@ -10,6 +10,12 @@
 import ns
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     self_presence = q.expect('stream-presence')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/caps_helper.py telepathy-gabble-0.16.0/tests/twisted/caps_helper.py
--- telepathy-gabble-0.15.4/tests/twisted/caps_helper.py	2012-01-18 12:45:07.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/caps_helper.py	2012-03-26 18:00:06.000000000 +0000
@@ -14,12 +14,18 @@
 import ns
 import constants as cs
 
-# The caps we always have, regardless of any clients' caps
-FIXED_CAPS = [
-    ns.JINGLE,
-    ns.JINGLE_015,
+if config.VOIP_ENABLED:
+    FIXED_JINGLE_CAPS = [
+        ns.JINGLE,
+        ns.JINGLE_015,
+        ns.JINGLE_TRANSPORT_RAWUDP,
+        ]
+else:
+    FIXED_JINGLE_CAPS = []
+
+# The caps we have regardless of any clients' caps
+FIXED_CAPS = FIXED_JINGLE_CAPS + [
     ns.GOOGLE_FEAT_SESSION,
-    ns.JINGLE_TRANSPORT_RAWUDP,
     ns.NICK,
     ns.NICK + '+notify',
     ns.CHAT_STATES,
diff -Nru telepathy-gabble-0.15.4/tests/twisted/connect/test-connection-params.py telepathy-gabble-0.16.0/tests/twisted/connect/test-connection-params.py
--- telepathy-gabble-0.15.4/tests/twisted/connect/test-connection-params.py	1970-01-01 00:00:00.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/connect/test-connection-params.py	2012-04-02 20:49:25.000000000 +0000
@@ -0,0 +1,54 @@
+
+"""
+Test connecting with different ContactList.DownloadAtConnection values
+"""
+
+import dbus
+
+from servicetest import EventPattern
+from gabbletest import exec_test, sync_stream, call_async
+import constants as cs
+import ns
+
+forbidden = [EventPattern('stream-iq', query_ns=ns.ROSTER)]
+
+def test_get_roster(q, bus, conn, stream):
+    # DownloadAtConnection = True, so gabble should get the roster
+    # automatically
+    q.expect('stream-iq', query_ns=ns.ROSTER)
+
+    # but calling ContactList.Download should not try and get the
+    # roster again
+    q.forbid_events(forbidden)
+    conn.ContactList.Download()
+    sync_stream(q, stream)
+    q.unforbid_events(forbidden)
+
+def test_dont_get_roster(q, bus, conn, stream):
+    # DownloadAtConnection = False, so let's make sure the roster
+    # isn't fetched automatically
+    q.forbid_events(forbidden)
+
+    conn.Connect()
+    q.expect_many(EventPattern('dbus-signal', signal='StatusChanged',
+                args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]))
+    sync_stream(q, stream)
+    q.unforbid_events(forbidden)
+
+    # seems fine, now calling Download should try and get the roster
+    # successfully.
+    call_async(q, conn.ContactList, 'Download')
+
+    q.expect_many(EventPattern('stream-iq', query_ns=ns.ROSTER),
+                  EventPattern('dbus-return', method='Download'))
+
+if __name__ == '__main__':
+    # Parameter DownloadAtConnection = True
+    exec_test(test_get_roster,
+              params={cs.CONN_IFACE_CONTACT_LIST + '.DownloadAtConnection': True})
+
+    # Parameter DownloadAtConnection = False
+    exec_test(test_dont_get_roster,
+              params={cs.CONN_IFACE_CONTACT_LIST + '.DownloadAtConnection': False},
+              do_connect=False)
+
diff -Nru telepathy-gabble-0.15.4/tests/twisted/constants.py telepathy-gabble-0.16.0/tests/twisted/constants.py
--- telepathy-gabble-0.15.4/tests/twisted/constants.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/constants.py	2012-03-13 21:07:53.000000000 +0000
@@ -140,6 +140,10 @@
 CALL_STREAM_ENDPOINT_STATE_EXHAUSTED_CANDIDATES = 3
 CALL_STREAM_ENDPOINT_STATE_FAILED = 4
 
+CALL_STREAM_CANDIDATE_TYPE_HOST = 1
+CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE = 2
+CALL_STREAM_CANDIDATE_TYPE_RELAY = 4
+
 CALL_STATE_CHANGE_REASON_UNKNOWN = 0
 CALL_STATE_CHANGE_REASON_PROGRESS_MADE = 1
 CALL_STATE_CHANGE_REASON_USER_REQUESTED = 2
diff -Nru telepathy-gabble-0.15.4/tests/twisted/dataforms.py telepathy-gabble-0.16.0/tests/twisted/dataforms.py
--- telepathy-gabble-0.15.4/tests/twisted/dataforms.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/dataforms.py	2012-03-26 18:00:06.000000000 +0000
@@ -8,6 +8,15 @@
 import constants as cs
 from caps_helper import receive_presence_and_ask_caps
 
+from config import VOIP_ENABLED
+
+# For historical reasons we advertise some bonus caps until the first call
+# to UpdateCapabilities or AdvertiseCapabilities. These caps are all related
+# to VoIP, so disabling VoIP breaks the assumptions this test is based on.
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     q.expect('stream-presence')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/accept-extra-stream.py telepathy-gabble-0.16.0/tests/twisted/jingle/accept-extra-stream.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/accept-extra-stream.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/accept-extra-stream.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 from jingletest2 import JingleProtocol031, JingleTest2
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     worker(q, bus, conn, stream, remote_jid='foo@bar.com/Foo')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-basics.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-basics.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-basics.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-basics.py	2012-03-26 18:00:06.000000000 +0000
@@ -18,6 +18,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 class CallBasicsTest(CallTest):
 
     def test_connect_disconnect_endpoint(self):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-codecoffer.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-codecoffer.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-codecoffer.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-codecoffer.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,12 +13,16 @@
 
 from jingletest2 import JingleTest2, test_dialects, JingleProtocol031
 
-from config import CHANNEL_TYPE_CALL_ENABLED
+from config import CHANNEL_TYPE_CALL_ENABLED, VOIP_ENABLED
 
 if not CHANNEL_TYPE_CALL_ENABLED:
     print "NOTE: built with --disable-channel-type-call"
     raise SystemExit(77)
 
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def check_offer (bus, conn, content):
     [path, md] = content.Get(cs.CALL_CONTENT_IFACE_MEDIA,
                 "MediaDescriptionOffer", dbus_interface=dbus.PROPERTIES_IFACE)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-content-adding-removal.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-content-adding-removal.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-content-adding-removal.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-content-adding-removal.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,6 +13,12 @@
 import constants as cs
 import dbus
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 class CallContentAddingRemovalTest(CallTest):
 
     # A/V
@@ -54,7 +60,7 @@
             dbus_interface=cs.CHANNEL_TYPE_CALL);
         self.q.expect('dbus-signal', signal='ContentAdded')
 
-        self.store_content(content_path, initial=False)
+        self.store_content(content_path, initial=False, incoming=False)
 
         md = self.jt2.get_call_video_md_dbus()
         self.check_and_accept_offer(self.video_content, md)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-dtmf.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-dtmf.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-dtmf.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-dtmf.py	2012-03-26 18:00:06.000000000 +0000
@@ -10,6 +10,12 @@
 from call_helper import CallTest, run_call_test
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 class CallDtmfTest(CallTest):
 
     def test_dtmf(self):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call_helper.py telepathy-gabble-0.16.0/tests/twisted/jingle/call_helper.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call_helper.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call_helper.py	2012-03-26 18:00:06.000000000 +0000
@@ -21,6 +21,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 class CallTest(object):
 
     SELF_JID = 'test@localhost'
@@ -124,7 +130,10 @@
             assertEquals([md], o.args)
 
 
-    def store_content(self, content_path, initial = True):
+    def store_content(self, content_path, initial = True, incoming = None):
+        if incoming is None:
+            incoming = self.incoming
+
         content = wrap_content(self.bus.get_object(self.conn.bus_name,
                     content_path), ['DTMF', 'Media'])
         content_props = content.GetAll(cs.CALL_CONTENT,
@@ -163,20 +172,21 @@
         assertEquals(self.can_change_direction,
                 stream_props["CanRequestReceiving"])
 
-        # We only check direction for initial content Telepathy does not
-        # expose enough information to know which state we should have when
-        # the stream was created locally or remotly.
-        if initial:
-            if self.incoming:
+        if incoming:
+            assertEquals(cs.CALL_SENDING_STATE_PENDING_SEND,
+                         stream_props["LocalSendingState"])
+            assertEquals(cs.CALL_SENDING_STATE_SENDING,
+                         stream_props["RemoteMembers"][self.peer_handle])
+        else:
+            if initial:
                 assertEquals(cs.CALL_SENDING_STATE_PENDING_SEND,
-                        stream_props["LocalSendingState"])
-                assertEquals(cs.CALL_SENDING_STATE_SENDING,
-                        stream_props["RemoteMembers"][self.peer_handle])
+                             stream_props["RemoteMembers"][self.peer_handle])
             else:
-                assertEquals(cs.CALL_SENDING_STATE_PENDING_SEND,
-                        stream_props["RemoteMembers"][self.peer_handle])
                 assertEquals(cs.CALL_SENDING_STATE_SENDING,
-                        stream_props["LocalSendingState"])
+                             stream_props["RemoteMembers"][self.peer_handle])
+
+            assertEquals(cs.CALL_SENDING_STATE_SENDING,
+                         stream_props["LocalSendingState"])
 
         # Packetization should be RTP
         content_media_props = content.GetAll(cs.CALL_CONTENT_IFACE_MEDIA,
@@ -187,10 +197,18 @@
         # Check the directions
         stream_media_props = stream.GetAll(cs.CALL_STREAM_IFACE_MEDIA,
                 dbus_interface=dbus.PROPERTIES_IFACE)
-        assertEquals(cs.CALL_STREAM_FLOW_STATE_STOPPED,
-                stream_media_props["SendingState"])
-        assertEquals(cs.CALL_STREAM_FLOW_STATE_STOPPED,
-                stream_media_props["ReceivingState"])
+        if initial or incoming:
+            assertEquals(cs.CALL_STREAM_FLOW_STATE_STOPPED,
+                         stream_media_props["SendingState"])
+        else:
+            assertEquals(cs.CALL_STREAM_FLOW_STATE_PENDING_START,
+                         stream_media_props["SendingState"])
+        if initial:
+            assertEquals(cs.CALL_STREAM_FLOW_STATE_STOPPED,
+                         stream_media_props["ReceivingState"])
+        else:
+            assertEquals(cs.CALL_STREAM_FLOW_STATE_PENDING_START,
+                         stream_media_props["ReceivingState"])
         assertEquals(False,  stream_media_props["ICERestartPending"])
 
         # Store the content and stream
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-hold-audio.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-hold-audio.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-hold-audio.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-hold-audio.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 from call_helper import CallTest, run_call_test
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 class CallHoldAudioTest(CallTest):
 
     def initiate(self):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-hold-av.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-hold-av.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-hold-av.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-hold-av.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,12 @@
 from call_helper import CallTest, run_call_test
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 class CallHoldAVTest(CallTest):
 
     # Audio and Video test
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-muc-cancel.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-muc-cancel.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-muc-cancel.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-muc-cancel.py	2012-03-26 18:00:06.000000000 +0000
@@ -7,6 +7,12 @@
 
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 muc = "muji@test"
 
 def run_cancel_test(q, bus, conn, stream):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-muc.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-muc.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-muc.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-muc.py	2012-03-26 18:00:06.000000000 +0000
@@ -21,6 +21,12 @@
 
 from callutils import *
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 muc = "muji@test"
 
 def run_incoming_test(q, bus, conn, stream, bob_leaves_room = False):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-muc-re-re-request.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-muc-re-re-request.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-muc-re-re-request.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-muc-re-re-request.py	2012-04-02 20:49:18.000000000 +0000
@@ -8,6 +8,12 @@
 import constants as cs
 from callutils import *
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 muc = "muji@test"
 
 def run_cancel_test(q, bus, conn, stream):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/call-state.py telepathy-gabble-0.16.0/tests/twisted/jingle/call-state.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/call-state.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/call-state.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,6 +13,12 @@
 
 from jingletest2 import JingleTest2, test_all_dialects
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(jp, q, bus, conn, stream):
     remote_jid = 'foo@bar.com/Foo'
     jt = JingleTest2(jp, conn, q, stream, 'test@localhost', remote_jid)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/decloak-peer.py telepathy-gabble-0.16.0/tests/twisted/jingle/decloak-peer.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/decloak-peer.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/decloak-peer.py	2012-03-26 18:00:06.000000000 +0000
@@ -14,6 +14,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     jt = jingletest.JingleTest(stream, 'test@localhost', 'foo@bar.com/Foo')
     jt2 = jingletest.JingleTest(stream, 'test@localhost', 'foo2@bar.com/Foo')
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/dtmf-no-audio.py telepathy-gabble-0.16.0/tests/twisted/jingle/dtmf-no-audio.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/dtmf-no-audio.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/dtmf-no-audio.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 from jingletest2 import JingleTest2, test_all_dialects
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(jp, q, bus, conn, stream):
     if not jp.can_do_video_only():
         return
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/dtmf.py telepathy-gabble-0.16.0/tests/twisted/jingle/dtmf.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/dtmf.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/dtmf.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 from jingletest2 import JingleTest2, test_all_dialects
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(jp, q, bus, conn, stream):
     # this test uses multiple streams
     if not jp.is_modern_jingle():
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/google-relay.py telepathy-gabble-0.16.0/tests/twisted/jingle/google-relay.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/google-relay.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/google-relay.py	2012-03-26 18:00:06.000000000 +0000
@@ -26,6 +26,12 @@
 
 from httptest import listen_http
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 # A real request/response looks like this:
 #
 # GET /create_session HTTP/1.1
@@ -76,6 +82,7 @@
 TOO_SLOW_CLOSE = 1
 TOO_SLOW_REMOVE_SELF = 2
 TOO_SLOW_DISCONNECT = 3
+TOO_SLOW_DISCONNECT_IMMEDIATELY = 4
 
 def test(q, bus, conn, stream, incoming=True, too_slow=None, use_call=False):
     jt = jingletest.JingleTest(stream, 'test@localhost', 'foo@bar.com/Foo')
@@ -104,6 +111,12 @@
     ji_event = q.expect('stream-iq', query_ns='google:jingleinfo',
                 to='test@localhost')
 
+    # Regression test for a bug where Gabble would crash if it disconnected
+    # before receiving a reply to the google:jingleinfo query.
+    if too_slow == TOO_SLOW_DISCONNECT_IMMEDIATELY:
+        disconnect_conn(q, conn, stream, [])
+        return
+
     listen_port = listen_http(q, 0)
 
     jingleinfo = make_result_iq(stream, ji_event.stanza)
@@ -411,6 +424,7 @@
     exec_relay_test(False, TOO_SLOW_REMOVE_SELF)
     exec_relay_test(True,  TOO_SLOW_DISCONNECT)
     exec_relay_test(False, TOO_SLOW_DISCONNECT)
+    exec_relay_test(True,  TOO_SLOW_DISCONNECT_IMMEDIATELY)
 
     if config.CHANNEL_TYPE_CALL_ENABLED:
         exec_relay_test(True,  TOO_SLOW_CLOSE,      use_call=True)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/hold-audio.py telepathy-gabble-0.16.0/tests/twisted/jingle/hold-audio.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/hold-audio.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/hold-audio.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 from jingletest2 import JingleTest2, test_all_dialects
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(jp, q, bus, conn, stream):
     remote_jid = 'foo@bar.com/Foo'
     jt = JingleTest2(jp, conn, q, stream, 'test@localhost', remote_jid)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/hold-av.py telepathy-gabble-0.16.0/tests/twisted/jingle/hold-av.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/hold-av.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/hold-av.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 from jingletest2 import JingleTest2, test_all_dialects
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def mutable_stream_tests(jp, jt, q, bus, conn, stream, chan, handle):
     # ---- Test 13: while the call's on hold, we add a new stream ---
     # We shouldn't go off hold locally as a result, and the new StreamHandler
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/incoming-basics.py telepathy-gabble-0.16.0/tests/twisted/jingle/incoming-basics.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/incoming-basics.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/incoming-basics.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,12 @@
 
 from twisted.words.xish import xpath
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(jp, q, bus, conn, stream, peer='foo@bar.com/Foo'):
     jt = JingleTest2(jp, conn, q, stream, 'test@localhost', peer)
     jt.prepare()
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/incoming-call-stream-error.py telepathy-gabble-0.16.0/tests/twisted/jingle/incoming-call-stream-error.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/incoming-call-stream-error.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/incoming-call-stream-error.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,12 @@
 
 from twisted.words.xish import xpath
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def _session_terminate_predicate(event, reason, msg, jp):
     matches = jp.match_jingle_action(event.query, 'session-terminate')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/incoming-gmail-modern-jingle.py telepathy-gabble-0.16.0/tests/twisted/jingle/incoming-gmail-modern-jingle.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/incoming-gmail-modern-jingle.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/incoming-gmail-modern-jingle.py	2012-03-26 18:00:06.000000000 +0000
@@ -10,6 +10,12 @@
 import constants as cs
 from twisted.words.xish import xpath
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 class GMail(JingleTest2):
     remote_caps = {
         'ext': 'pmuc-v1 sms-v1 camera-v1 video-v1 voice-v1',
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/initial-audio-video.py telepathy-gabble-0.16.0/tests/twisted/jingle/initial-audio-video.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/initial-audio-video.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/initial-audio-video.py	2012-03-26 18:00:06.000000000 +0000
@@ -14,6 +14,12 @@
 
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def outgoing(jp, q, bus, conn, stream):
     remote_jid = 'flames@cold.mountain/beyond'
     jt = JingleTest2(jp, conn, q, stream, 'test@localhost', remote_jid)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/jingletest2.py telepathy-gabble-0.16.0/tests/twisted/jingle/jingletest2.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/jingletest2.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/jingletest2.py	2012-03-13 21:07:53.000000000 +0000
@@ -94,7 +94,7 @@
                 "port": str(port),
                 "protocol": "udp",
                 "preference": str(props["priority"] / 65536.0),
-                "type":  ["local", "stun", "relay"][props["type"]],
+                "type":  ["INVALID NONE", "local", "stun", "INVALID PEER RFLX", "relay"][props["type"]],
                 "network": "0",
                 "generation": "0",# Increment this yourself if you care.
                 "component": str(component), # 1 is rtp, 2 is rtcp
@@ -516,14 +516,14 @@
     # Default candidates for the remote end
     remote_call_candidates = [# Local candidates
                          (1, "192.168.0.1", 666,
-                            {"type": cs.MEDIA_STREAM_TRANSPORT_TYPE_LOCAL,
+                            {"type": cs.CALL_STREAM_CANDIDATE_TYPE_HOST,
                              #"Foundation":,
                              "protocol": cs.MEDIA_STREAM_BASE_PROTO_UDP,
                              "priority": 10000,
                              #"base-ip":
                              }),
                          (2, "192.168.0.1", 667,
-                            {"type": cs.MEDIA_STREAM_TRANSPORT_TYPE_LOCAL,
+                            {"type": cs.CALL_STREAM_CANDIDATE_TYPE_HOST,
                              #"Foundation":,
                              "protocol": cs.MEDIA_STREAM_BASE_PROTO_UDP,
                              "priority": 10000,
@@ -531,7 +531,7 @@
                              }),
                          # STUN candidates have their own ufrag
                          (1, "168.192.0.1", 10666,
-                            {"type": cs.MEDIA_STREAM_TRANSPORT_TYPE_DERIVED,
+                            {"type": cs.CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE,
                              #"Foundation":,
                              "protocol": cs.MEDIA_STREAM_BASE_PROTO_UDP,
                              "priority": 100,
@@ -540,7 +540,7 @@
                              "password": "STUNRTPPwd"
                              }),
                          (2, "168.192.0.1", 10667,
-                            {"type": cs.MEDIA_STREAM_TRANSPORT_TYPE_DERIVED,
+                            {"type": cs.CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE,
                              #"Foundation":,
                              "protocol": cs.MEDIA_STREAM_BASE_PROTO_UDP,
                              "priority": 100,
@@ -550,14 +550,14 @@
                              }),
                          # Candidates found using UPnP or somesuch?
                          (1, "131.111.12.50", 10666,
-                            {"type": cs.MEDIA_STREAM_TRANSPORT_TYPE_LOCAL,
+                            {"type": cs.CALL_STREAM_CANDIDATE_TYPE_HOST,
                              #"Foundation":,
                              "protocol": cs.MEDIA_STREAM_BASE_PROTO_UDP,
                              "priority": 1000,
                              #"base-ip":
                              }),
                          (2, "131.111.12.50", 10667,
-                            {"type": cs.MEDIA_STREAM_TRANSPORT_TYPE_LOCAL,
+                            {"type": cs.CALL_STREAM_CANDIDATE_TYPE_HOST,
                              #"Foundation":,
                              "protocol": cs.MEDIA_STREAM_BASE_PROTO_UDP,
                              "priority": 1000,
@@ -571,7 +571,7 @@
             "RTP", # protocol subtype
             "AVP", # profile
             1.0, # preference
-            0, # transport type = TP_MEDIA_STREAM_TRANSPORT_TYPE_LOCAL,
+            0, # transport type = TP_CALL_STREAM_CANDIDATE_TYPE_HOST,
             "username",
             "password" ) ]
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/misuse.py telepathy-gabble-0.16.0/tests/twisted/jingle/misuse.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/misuse.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/misuse.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     jp = JingleProtocol031()
     remote_jid = 'foo@example.com/misc'
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/outgoing-basics.py telepathy-gabble-0.16.0/tests/twisted/jingle/outgoing-basics.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/outgoing-basics.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/outgoing-basics.py	2012-03-26 18:00:06.000000000 +0000
@@ -15,6 +15,12 @@
 import constants as cs
 from jingletest2 import JingleTest2, test_all_dialects
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 # There are various deprecated APIs for requesting calls, documented at
 # .
 # These are ordered from most recent to most deprecated.
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/outgoing-ensure.py telepathy-gabble-0.16.0/tests/twisted/jingle/outgoing-ensure.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/outgoing-ensure.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/outgoing-ensure.py	2012-03-26 18:00:06.000000000 +0000
@@ -15,6 +15,11 @@
 import constants as cs
 from jingletest2 import JingleProtocol031, JingleTest2
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
 
 def test(q, bus, conn, stream, channel_type):
     jt = JingleTest2(JingleProtocol031(), conn, q, stream, 'test@localhost',
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/outgoing-many-streams.py telepathy-gabble-0.16.0/tests/twisted/jingle/outgoing-many-streams.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/outgoing-many-streams.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/outgoing-many-streams.py	2012-03-26 18:00:06.000000000 +0000
@@ -14,6 +14,12 @@
 
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     worker(q, bus, conn, stream, 'foo@bar.com/Foo')
     worker(q, bus, conn, stream, 'foo@sip.bar.com')
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/payload-types.py telepathy-gabble-0.16.0/tests/twisted/jingle/payload-types.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/payload-types.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/payload-types.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 from twisted.words.xish import domish
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream):
     jt = jingletest.JingleTest(stream, 'test@localhost', 'foo@bar.com/Foo')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/session-id-collision.py telepathy-gabble-0.16.0/tests/twisted/jingle/session-id-collision.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/session-id-collision.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/session-id-collision.py	2012-03-26 18:00:06.000000000 +0000
@@ -7,6 +7,12 @@
 from jingletest2 import JingleTest2, test_all_dialects
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(jp, q, bus, conn, stream):
     jt1 = JingleTest2(jp, conn, q, stream, 'test@localhost',
         'edgar@collabora.co.uk/Monitor')
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/stream-errors-on-content-reject.py telepathy-gabble-0.16.0/tests/twisted/jingle/stream-errors-on-content-reject.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/stream-errors-on-content-reject.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/stream-errors-on-content-reject.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,12 @@
 
 from twisted.words.xish import xpath
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def _content_reject_predicate(event):
     reason = xpath.queryForNodes("/iq"
                                "/jingle[@action='content-reject']"
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/stream-errors-on-terminate.py telepathy-gabble-0.16.0/tests/twisted/jingle/stream-errors-on-terminate.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/stream-errors-on-terminate.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/stream-errors-on-terminate.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,12 @@
 
 from twisted.words.xish import xpath
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def _session_terminate_predicate(event, msg):
     reason = xpath.queryForNodes("/iq"
                                "/jingle[@action='session-terminate']"
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/stream-handler-error.py telepathy-gabble-0.16.0/tests/twisted/jingle/stream-handler-error.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/stream-handler-error.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/stream-handler-error.py	2012-03-26 18:00:06.000000000 +0000
@@ -12,6 +12,12 @@
 
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream, call_error_on):
     jt = jingletest.JingleTest(stream, 'test@localhost', 'foo@bar.com/Foo')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/stun-server.py telepathy-gabble-0.16.0/tests/twisted/jingle/stun-server.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/stun-server.py	2012-02-21 12:02:15.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/stun-server.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,7 +13,11 @@
 import jingletest
 import constants as cs
 
-from config import CHANNEL_TYPE_CALL_ENABLED, GOOGLE_RELAY_ENABLED
+from config import CHANNEL_TYPE_CALL_ENABLED, GOOGLE_RELAY_ENABLED, VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
 
 def test_stun_server(stun_server_prop,
         expected_stun_server=None, expected_stun_port=None):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-content-adding-removal.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-content-adding-removal.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-content-adding-removal.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-content-adding-removal.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,6 +13,12 @@
     )
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def gabble_terminates(jp, q, bus, conn, stream):
     test(jp, q, bus, conn, stream, False)
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-content-complex.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-content-complex.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-content-complex.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-content-complex.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,12 @@
 
 from twisted.words.xish import xpath
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def worker(jp, q, bus, conn, stream):
 
     def make_stream_request(stream_type):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-description-info.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-description-info.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-description-info.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-description-info.py	2012-03-26 18:00:06.000000000 +0000
@@ -11,6 +11,11 @@
 
 from twisted.words.xish import xpath
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
 
 def extract_params(payload_type):
     ret = {}
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-incoming-call-reject.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-incoming-call-reject.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-incoming-call-reject.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-incoming-call-reject.py	2012-03-26 18:00:06.000000000 +0000
@@ -10,6 +10,12 @@
 
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test_busy(jp, q, bus, conn, stream):
     test(jp, q, bus, conn, stream, True)
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-incoming-iceudp.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-incoming-iceudp.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-incoming-iceudp.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-incoming-iceudp.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,6 +13,12 @@
 
 from jingletest2 import *
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def worker(jp, q, bus, conn, stream):
     jp.features.append(ns.JINGLE_TRANSPORT_ICEUDP)
     jt2 = JingleTest2(jp, conn, q, stream, 'test@localhost', 'foo@bar.com/Foo')
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-outgoing-call-rejected.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-outgoing-call-rejected.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-outgoing-call-rejected.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-outgoing-call-rejected.py	2012-03-26 18:00:06.000000000 +0000
@@ -8,6 +8,12 @@
 import constants as cs
 from jingletest2 import JingleTest2, test_all_dialects
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def _test(jp, q, bus, conn, stream,
           jingle_reason, group_change_reason, stream_error):
     remote_jid = 'foo@bar.com/Foo'
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-outgoing-iceudp.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-outgoing-iceudp.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-outgoing-iceudp.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-outgoing-iceudp.py	2012-03-26 18:00:06.000000000 +0000
@@ -15,6 +15,12 @@
 
 from jingletest2 import *
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def worker(jp, q, bus, conn, stream):
     jp.features.remove(ns.GOOGLE_P2P)
     jp.features.append(ns.JINGLE_TRANSPORT_ICEUDP)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-wait-for-caps-incomplete.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-wait-for-caps-incomplete.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-wait-for-caps-incomplete.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-wait-for-caps-incomplete.py	2012-03-26 18:00:06.000000000 +0000
@@ -10,6 +10,12 @@
 
 import constants as cs
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream, channel_type):
     jt = jingletest.JingleTest(stream, 'test@localhost', 'foo@bar.com/Foo')
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/test-wait-for-caps.py telepathy-gabble-0.16.0/tests/twisted/jingle/test-wait-for-caps.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/test-wait-for-caps.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/test-wait-for-caps.py	2012-03-26 18:00:06.000000000 +0000
@@ -13,6 +13,12 @@
 import constants as cs
 import ns
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream, channel_type):
     jt = jingletest.JingleTest(stream, 'test@localhost', 'foo@bar.com/Foo')
     jt2 = jingletest.JingleTest(stream, 'test@localhost', 'foo2@bar.com/Foo')
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle/transport-info-parsing.py telepathy-gabble-0.16.0/tests/twisted/jingle/transport-info-parsing.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle/transport-info-parsing.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle/transport-info-parsing.py	2012-03-26 18:00:06.000000000 +0000
@@ -7,6 +7,12 @@
     assertEquals, assertNotEquals )
 from jingletest2 import *
 
+from config import VOIP_ENABLED
+
+if not VOIP_ENABLED:
+    print "NOTE: built with --disable-voip"
+    raise SystemExit(77)
+
 def test(q, bus, conn, stream, peer='foo@bar.com/Foo'):
     jp = JingleProtocol031()
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-multift.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-multift.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-multift.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-multift.py	2012-03-26 18:00:06.000000000 +0000
@@ -17,10 +17,10 @@
 
 import ns
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 def test(q, bus, conn, stream):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-close-socket-while-receiving.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-close-socket-while-receiving.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-close-socket-while-receiving.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-close-socket-while-receiving.py	2012-03-26 18:00:06.000000000 +0000
@@ -3,10 +3,10 @@
 from file_transfer_helper import  SendFileTest, ReceiveFileTest, \
     exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class ReceiveFileAndCancelWhileReceiving(ReceiveFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-disconnect.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-disconnect.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-disconnect.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-disconnect.py	2012-03-26 18:00:06.000000000 +0000
@@ -2,10 +2,10 @@
 from file_transfer_helper import  SendFileTest, ReceiveFileTest, \
     exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class ReceiveFileAndDisconnectTest(ReceiveFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-pending.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-pending.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-pending.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-pending.py	2012-03-26 18:00:06.000000000 +0000
@@ -4,10 +4,10 @@
 from file_transfer_helper import SendFileTest, ReceiveFileTest, \
     FileTransferTest, exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class ReceiveFileAndSenderDisconnectWhilePendingTest(ReceiveFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-transfering.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-transfering.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-transfering.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-and-sender-disconnect-while-transfering.py	2012-03-26 18:00:06.000000000 +0000
@@ -4,10 +4,10 @@
 from file_transfer_helper import SendFileTest, ReceiveFileTest, \
     FileTransferTest, exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class ReceiveFileAndSenderDisconnectWhileTransfering(ReceiveFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-decline.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-decline.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-receive-file-decline.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-receive-file-decline.py	2012-03-26 18:00:06.000000000 +0000
@@ -5,10 +5,10 @@
 from file_transfer_helper import SendFileTest, ReceiveFileTest, \
     FileTransferTest, exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class ReceiveFileDecline(ReceiveFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file-and-cancel-immediately.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file-and-cancel-immediately.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file-and-cancel-immediately.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file-and-cancel-immediately.py	2012-03-26 18:00:06.000000000 +0000
@@ -5,10 +5,10 @@
 from file_transfer_helper import SendFileTest, ReceiveFileTest, \
     FileTransferTest, exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class ReceiveFileStopped(ReceiveFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file.py	2012-03-26 18:00:06.000000000 +0000
@@ -2,10 +2,10 @@
 from file_transfer_helper import SendFileTest, ReceiveFileTest, \
     exec_file_transfer_test, File
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 if __name__ == '__main__':
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file-send-before-accept.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file-send-before-accept.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file-send-before-accept.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file-send-before-accept.py	2012-03-26 18:00:06.000000000 +0000
@@ -1,10 +1,10 @@
 from file_transfer_helper import SendFileTest, FileTransferTest, \
     ReceiveFileTest, exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class SendFileBeforeAccept(SendFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file-wait-to-provide.py telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file-wait-to-provide.py
--- telepathy-gabble-0.15.4/tests/twisted/jingle-share/test-send-file-wait-to-provide.py	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/jingle-share/test-send-file-wait-to-provide.py	2012-03-26 18:00:06.000000000 +0000
@@ -5,10 +5,10 @@
 from file_transfer_helper import SendFileTest, ReceiveFileTest, \
     FileTransferTest, exec_file_transfer_test
 
-from config import FILE_TRANSFER_ENABLED
+from config import JINGLE_FILE_TRANSFER_ENABLED
 
-if not FILE_TRANSFER_ENABLED:
-    print "NOTE: built with --disable-file-transfer"
+if not JINGLE_FILE_TRANSFER_ENABLED:
+    print "NOTE: built with --disable-file-transfer or --disable-voip"
     raise SystemExit(77)
 
 class SendFileAndWaitToProvide (SendFileTest):
diff -Nru telepathy-gabble-0.15.4/tests/twisted/main-debug.c telepathy-gabble-0.16.0/tests/twisted/main-debug.c
--- telepathy-gabble-0.15.4/tests/twisted/main-debug.c	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/main-debug.c	2012-03-26 18:00:06.000000000 +0000
@@ -22,9 +22,11 @@
 #include "gabble.h"
 #include "connection.h"
 #include "vcard-manager.h"
+#ifdef ENABLE_VOIP
 #include "jingle-factory.h"
 #include "jingle-session.h"
-#ifdef ENABLE_FILE_TRANSFER
+#endif
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
 #include "gtalk-file-collection.h"
 #endif
 
@@ -62,8 +64,11 @@
   test_resolver_add_A (TEST_RESOLVER (kludged),
       "stun.telepathy.im", "6.7.8.9");
 
-  gabble_jingle_factory_set_test_mode ();
-#ifdef ENABLE_FILE_TRANSFER
+#ifdef ENABLE_VOIP
+  gabble_jingle_info_set_test_mode ();
+#endif
+
+#ifdef ENABLE_JINGLE_FILE_TRANSFER
   gtalk_file_collection_set_test_mode ();
 #endif
 
diff -Nru telepathy-gabble-0.15.4/tests/twisted/Makefile.am telepathy-gabble-0.16.0/tests/twisted/Makefile.am
--- telepathy-gabble-0.15.4/tests/twisted/Makefile.am	2012-02-21 21:01:58.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/Makefile.am	2012-04-02 20:49:25.000000000 +0000
@@ -25,6 +25,7 @@
 	connect/disco-no-reply.py \
 	connect/network-error.py \
 	connect/stream-closed.py \
+	connect/test-connection-params.py \
 	connect/test-fail.py \
 	connect/test-nonblocking-tls.py \
 	connect/test-success.py \
@@ -378,6 +379,18 @@
 FILE_TRANSFER_ENABLED_PYBOOL = False
 endif
 
+if ENABLE_VOIP
+VOIP_ENABLED_PYBOOL = True
+else
+VOIP_ENABLED_PYBOOL = False
+endif
+
+if ENABLE_JINGLE_FILE_TRANSFER
+JINGLE_FILE_TRANSFER_ENABLED_PYBOOL = True
+else
+JINGLE_FILE_TRANSFER_ENABLED_PYBOOL = False
+endif
+
 config.py: Makefile
 	$(AM_V_GEN) { \
 		echo "PACKAGE_STRING = \"$(PACKAGE_STRING)\""; \
@@ -387,6 +400,8 @@
 		echo "CHANNEL_TYPE_CALL_ENABLED = $(CHANNEL_TYPE_CALL_ENABLED_PYBOOL)"; \
 		echo "GOOGLE_RELAY_ENABLED = $(GOOGLE_RELAY_ENABLED_PYBOOL)"; \
 		echo "FILE_TRANSFER_ENABLED = $(FILE_TRANSFER_ENABLED_PYBOOL)"; \
+		echo "VOIP_ENABLED = $(VOIP_ENABLED_PYBOOL)"; \
+		echo "JINGLE_FILE_TRANSFER_ENABLED = $(JINGLE_FILE_TRANSFER_ENABLED_PYBOOL)"; \
 	} > $@
 
 BUILT_SOURCES = config.py
diff -Nru telepathy-gabble-0.15.4/tests/twisted/Makefile.in telepathy-gabble-0.16.0/tests/twisted/Makefile.in
--- telepathy-gabble-0.15.4/tests/twisted/Makefile.in	2012-02-21 21:02:17.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -148,12 +148,13 @@
 	connect/disco-error-from-bare-jid.py \
 	connect/disconnect-timeout.py connect/disco-no-reply.py \
 	connect/network-error.py connect/stream-closed.py \
-	connect/test-fail.py connect/test-nonblocking-tls.py \
-	connect/test-success.py connect/test-twice.py console.py \
-	dataforms.py gateways.py last-activity.py mail-notification.py \
-	muc/avatars.py muc/banned.py muc/chat-states.py \
-	muc/conference.py muc/kicked.py muc/name-conflict.py \
-	muc/password.py muc/presence-before-closing.py muc/renamed.py \
+	connect/test-connection-params.py connect/test-fail.py \
+	connect/test-nonblocking-tls.py connect/test-success.py \
+	connect/test-twice.py console.py dataforms.py gateways.py \
+	last-activity.py mail-notification.py muc/avatars.py \
+	muc/banned.py muc/chat-states.py muc/conference.py \
+	muc/kicked.py muc/name-conflict.py muc/password.py \
+	muc/presence-before-closing.py muc/renamed.py \
 	muc/room-config.py muc/roomlist.py muc/room.py \
 	muc/scrollback.py muc/send-error.py muc/subject.py \
 	muc/test-ensure.py muc/test-muc-alias.py \
@@ -420,6 +421,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
@@ -445,12 +448,13 @@
 	connect/disco-error-from-bare-jid.py \
 	connect/disconnect-timeout.py connect/disco-no-reply.py \
 	connect/network-error.py connect/stream-closed.py \
-	connect/test-fail.py connect/test-nonblocking-tls.py \
-	connect/test-success.py connect/test-twice.py console.py \
-	dataforms.py gateways.py last-activity.py mail-notification.py \
-	muc/avatars.py muc/banned.py muc/chat-states.py \
-	muc/conference.py muc/kicked.py muc/name-conflict.py \
-	muc/password.py muc/presence-before-closing.py muc/renamed.py \
+	connect/test-connection-params.py connect/test-fail.py \
+	connect/test-nonblocking-tls.py connect/test-success.py \
+	connect/test-twice.py console.py dataforms.py gateways.py \
+	last-activity.py mail-notification.py muc/avatars.py \
+	muc/banned.py muc/chat-states.py muc/conference.py \
+	muc/kicked.py muc/name-conflict.py muc/password.py \
+	muc/presence-before-closing.py muc/renamed.py \
 	muc/room-config.py muc/roomlist.py muc/room.py \
 	muc/scrollback.py muc/send-error.py muc/subject.py \
 	muc/test-ensure.py muc/test-muc-alias.py \
@@ -688,6 +692,10 @@
 @ENABLE_GOOGLE_RELAY_TRUE@GOOGLE_RELAY_ENABLED_PYBOOL = True
 @ENABLE_FILE_TRANSFER_FALSE@FILE_TRANSFER_ENABLED_PYBOOL = False
 @ENABLE_FILE_TRANSFER_TRUE@FILE_TRANSFER_ENABLED_PYBOOL = True
+@ENABLE_VOIP_FALSE@VOIP_ENABLED_PYBOOL = False
+@ENABLE_VOIP_TRUE@VOIP_ENABLED_PYBOOL = True
+@ENABLE_JINGLE_FILE_TRANSFER_FALSE@JINGLE_FILE_TRANSFER_ENABLED_PYBOOL = False
+@ENABLE_JINGLE_FILE_TRANSFER_TRUE@JINGLE_FILE_TRANSFER_ENABLED_PYBOOL = True
 BUILT_SOURCES = config.py $(service_files) $(installed_conf_files) \
 	$(uninstalled_service_files) $(uninstalled_conf_files) \
 	run-test.sh tools/exec-with-log.sh tools/run-gabble.sh $(NULL)
@@ -1347,6 +1355,8 @@
 		echo "CHANNEL_TYPE_CALL_ENABLED = $(CHANNEL_TYPE_CALL_ENABLED_PYBOOL)"; \
 		echo "GOOGLE_RELAY_ENABLED = $(GOOGLE_RELAY_ENABLED_PYBOOL)"; \
 		echo "FILE_TRANSFER_ENABLED = $(FILE_TRANSFER_ENABLED_PYBOOL)"; \
+		echo "VOIP_ENABLED = $(VOIP_ENABLED_PYBOOL)"; \
+		echo "JINGLE_FILE_TRANSFER_ENABLED = $(JINGLE_FILE_TRANSFER_ENABLED_PYBOOL)"; \
 	} > $@
 check-coding-style:
 	@fail=0; \
diff -Nru telepathy-gabble-0.15.4/tests/twisted/roster/groups.py telepathy-gabble-0.16.0/tests/twisted/roster/groups.py
--- telepathy-gabble-0.15.4/tests/twisted/roster/groups.py	2011-10-18 12:54:27.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/roster/groups.py	2012-02-29 20:01:57.000000000 +0000
@@ -5,13 +5,33 @@
 from gabbletest import exec_test, acknowledge_iq, sync_stream
 from rostertest import expect_contact_list_signals, check_contact_list_signals
 from servicetest import (assertLength, EventPattern, assertEquals, call_async,
-        sync_dbus)
+        sync_dbus, assertContains, assertDoesNotContain)
 import constants as cs
 import ns
 
 from twisted.words.protocols.jabber.client import IQ
 from twisted.words.xish import xpath
 
+def parse_roster_change_request(query, iq):
+    item = query.firstChildElement()
+
+    groups = set()
+
+    for gn in xpath.queryForNodes('/iq/query/item/group', iq):
+        groups.add(str(gn))
+
+    return item['jid'], groups
+
+def send_roster_push(stream, jid, groups):
+    iq = IQ(stream, 'set')
+    query = iq.addElement((ns.ROSTER, 'query'))
+    item = query.addElement('item')
+    item['jid'] = jid
+    item['subscription'] = 'both'
+    for group in groups:
+        item.addElement('group', content=group)
+    stream.send(iq)
+
 def test(q, bus, conn, stream):
     event = q.expect('stream-iq', query_ns=ns.ROSTER)
     event.stanza['type'] = 'result'
@@ -74,28 +94,15 @@
 
     assertEquals(set(('ladies', 'people starting with A')), set(s.args[0]))
 
-    item = iq.query.firstChildElement()
-    assertEquals('amy@foo.com', item['jid'])
-
-    groups = set()
-
-    for gn in xpath.queryForNodes('/iq/query/item/group', iq.stanza):
-        groups.add(str(gn))
-
+    jid, groups = parse_roster_change_request(iq.query, iq.stanza)
+    assertEquals('amy@foo.com', jid)
     assertEquals(set(('ladies', 'people starting with A')), groups)
 
     acknowledge_iq(stream, iq.stanza)
     q.expect('dbus-return', method='SetContactGroups')
 
     # Now the server sends us a roster push.
-    iq = IQ(stream, 'set')
-    query = iq.addElement((ns.ROSTER, 'query'))
-    item = query.addElement('item')
-    item['jid'] = 'amy@foo.com'
-    item['subscription'] = 'both'
-    item.addElement('group', content='people starting with A')
-    item.addElement('group', content='ladies')
-    stream.send(iq)
+    send_roster_push(stream, 'amy@foo.com', ['people starting with A', 'ladies'])
 
     # We get a single signal corresponding to that roster push
     e = q.expect('dbus-signal', signal='GroupsChanged',
@@ -122,14 +129,8 @@
         iq = q.expect('stream-iq', iq_type='set',
                 query_name='query', query_ns=ns.ROSTER)
 
-        item = iq.query.firstChildElement()
-        assertEquals('amy@foo.com', item['jid'])
-
-        groups = set()
-
-        for gn in xpath.queryForNodes('/iq/query/item/group', iq.stanza):
-            groups.add(str(gn))
-
+        jid, groups = parse_roster_change_request(iq.query, iq.stanza)
+        assertEquals('amy@foo.com', jid)
         assertEquals(set(('ladies',)), groups)
 
         acknowledge_iq(stream, iq.stanza)
@@ -146,23 +147,10 @@
         if it_worked:
             # ... although in fact this is what *actually* removes Amy from the
             # group
-            iq = IQ(stream, 'set')
-            query = iq.addElement((ns.ROSTER, 'query'))
-            item = query.addElement('item')
-            item['jid'] = 'amy@foo.com'
-            item['subscription'] = 'both'
-            item.addElement('group', content='ladies')
-            stream.send(iq)
+            send_roster_push(stream, 'amy@foo.com', ['ladies'])
         else:
             # if the change didn't "stick", this message will revert it
-            iq = IQ(stream, 'set')
-            query = iq.addElement((ns.ROSTER, 'query'))
-            item = query.addElement('item')
-            item['jid'] = 'amy@foo.com'
-            item['subscription'] = 'both'
-            item.addElement('group', content='ladies')
-            item.addElement('group', content='people starting with A')
-            stream.send(iq)
+            send_roster_push(stream, 'amy@foo.com', ['ladies', 'people starting with A'])
 
             q.expect('dbus-signal', signal='GroupsCreated',
                     args=[['people starting with A']])
@@ -187,5 +175,36 @@
         conn.Contacts.GetContactAttributes([amy],
             [cs.CONN_IFACE_CONTACT_GROUPS], False)[amy])
 
+    # Rename group 'ladies' to 'girls'
+    call_async(q, conn.ContactGroups, 'RenameGroup', 'ladies', 'girls')
+
+    # Amy is added to 'girls'
+    e = q.expect('stream-iq', iq_type='set', query_name='query', query_ns=ns.ROSTER)
+    jid, groups = parse_roster_change_request(e.query, e.stanza)
+    assertEquals('amy@foo.com', jid)
+    assertEquals(set(['girls', 'ladies']), groups)
+
+    send_roster_push(stream, 'amy@foo.com', ['girls', 'ladies'])
+    acknowledge_iq(stream, e.stanza)
+
+    # Amy is removed from 'ladies'
+    e = q.expect('stream-iq', iq_type='set', query_name='query', query_ns=ns.ROSTER)
+    jid, groups = parse_roster_change_request(e.query, e.stanza)
+    assertEquals('amy@foo.com', jid)
+    assertEquals(set(['girls']), groups)
+
+    send_roster_push(stream, 'amy@foo.com', ['girls'])
+    acknowledge_iq(stream, e.stanza)
+
+    q.expect('dbus-return', method='RenameGroup')
+
+    # check everything has been updated
+    groups = conn.Properties.Get(cs.CONN_IFACE_CONTACT_GROUPS, 'Groups')
+    assertContains('girls', groups)
+    assertDoesNotContain('ladies', groups)
+
+    contacts = conn.ContactList.GetContactListAttributes([cs.CONN_IFACE_CONTACT_GROUPS], False)
+    assertEquals(['girls'], contacts[amy][cs.CONN_IFACE_CONTACT_GROUPS + '/groups'])
+
 if __name__ == '__main__':
     exec_test(test)
diff -Nru telepathy-gabble-0.15.4/tests/twisted/tools/run-gabble.sh.in telepathy-gabble-0.16.0/tests/twisted/tools/run-gabble.sh.in
--- telepathy-gabble-0.15.4/tests/twisted/tools/run-gabble.sh.in	2012-01-18 12:45:08.000000000 +0000
+++ telepathy-gabble-0.16.0/tests/twisted/tools/run-gabble.sh.in	2012-03-26 18:00:06.000000000 +0000
@@ -4,7 +4,7 @@
 export G_DEBUG
 GABBLE_TIMING=1
 export GABBLE_TIMING
-GABBLE_PLUGIN_DIR="@gabbletestsdir@/plugins:@libdir@/telepathy/gabble-0"
+GABBLE_PLUGIN_DIR="@gabbletestsdir@/plugins:@pluginexecdir@"
 export GABBLE_PLUGIN_DIR
 WOCKY_CAPS_CACHE=:memory:
 export WOCKY_CAPS_CACHE
diff -Nru telepathy-gabble-0.15.4/tools/Makefile.in telepathy-gabble-0.16.0/tools/Makefile.in
--- telepathy-gabble-0.15.4/tools/Makefile.in	2012-02-21 19:23:46.000000000 +0000
+++ telepathy-gabble-0.16.0/tools/Makefile.in	2012-04-02 21:29:19.000000000 +0000
@@ -193,6 +193,8 @@
 pdfdir = @pdfdir@
 pkgpyexecdir = @pkgpyexecdir@
 pkgpythondir = @pkgpythondir@
+pluginexecdir = @pluginexecdir@
+pluginexeclibdir = @pluginexeclibdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@