summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-01-27 16:28:51 -0500
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-01-31 11:56:26 -0500
commitfe4b43dafee4d29e7a11e042e07dbe1269dcb597 (patch)
treebc3d6264c34c577734444deace1d90b0e68c3f90
parentb20cf0f8be4e0c027fbee291cfa01e55297a20d0 (diff)
connection: remove deprecated D-Bus methods/properties/signals
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--examples/client/inspect-connection.c9
-rw-r--r--spec/Connection.xml585
-rw-r--r--telepathy-glib/base-connection.c656
-rw-r--r--tests/dbus/Makefile.am4
-rw-r--r--tests/dbus/connection-getinterfaces-failure.c140
-rw-r--r--tests/dbus/contacts.c4
6 files changed, 97 insertions, 1301 deletions
diff --git a/examples/client/inspect-connection.c b/examples/client/inspect-connection.c
index c4c988532..4b46b6df3 100644
--- a/examples/client/inspect-connection.c
+++ b/examples/client/inspect-connection.c
@@ -16,8 +16,8 @@
static int exit_status = 1;
static void
-got_channels (TpConnection *connection,
- const GPtrArray *channels,
+got_channels (TpProxy *connection,
+ const GValue *value,
const GError *error,
gpointer user_data,
GObject *weak_object)
@@ -26,6 +26,7 @@ got_channels (TpConnection *connection,
if (error == NULL)
{
+ GPtrArray *channels = g_value_get_boxed (value);
guint i;
for (i = 0; i < channels->len; i++)
@@ -66,8 +67,8 @@ connection_ready_cb (TpConnection *connection,
printf ("Connection ready\n");
- tp_cli_connection_call_list_channels (connection, -1,
- /* If ListChannels() needed any arguments, they'd go here */
+ tp_cli_dbus_properties_call_get (connection, -1,
+ TP_IFACE_CONNECTION, "Channels",
got_channels, g_main_loop_ref (mainloop),
(GDestroyNotify) g_main_loop_unref, NULL);
}
diff --git a/spec/Connection.xml b/spec/Connection.xml
index 7fd32be4d..5d2b0194d 100644
--- a/spec/Connection.xml
+++ b/spec/Connection.xml
@@ -21,31 +21,9 @@ License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.</p>
</tp:license>
- <interface name="org.freedesktop.Telepathy.Connection">
- <tp:requires interface="org.freedesktop.Telepathy.Connection.Interface.Requests"/>
- <tp:requires interface="org.freedesktop.Telepathy.Connection.Interface.Contacts"/>
-
- <tp:struct name="Channel_Info" array-name="Channel_Info_List">
- <tp:deprecated version="0.17.23"/>
- <tp:docstring>A struct representing a channel, as returned by
- ListChannels on the Connection interface.</tp:docstring>
- <tp:member type="o" name="Channel">
- <tp:docstring>The object path of the channel, which is on the
- same bus name as the connection</tp:docstring>
- </tp:member>
- <tp:member type="s" tp:type="DBus_Interface" name="Channel_Type">
- <tp:docstring>The channel's type</tp:docstring>
- </tp:member>
- <tp:member type="u" tp:type="Handle_Type" name="Handle_Type">
- <tp:docstring>The type of the handle that the channel communicates
- with, or Handle_Type_None if there is no associated
- handle</tp:docstring>
- </tp:member>
- <tp:member type="u" tp:type="Handle" name="Handle">
- <tp:docstring>The handle that the channel communicates with,
- or 0 if there is no associated handle</tp:docstring>
- </tp:member>
- </tp:struct>
+ <interface name="im.telepathy1.Connection">
+ <tp:requires interface="im.telepathy1.Connection.Interface.Requests"/>
+ <tp:requires interface="im.telepathy1.Connection.Interface.Contacts"/>
<method name="Connect" tp:name-for-bindings="Connect">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
@@ -83,7 +61,7 @@ USA.</p>
<tp:rationale>
<p>In some connection managers, certain capabilities of a connection
are known to be implemented for all connections (e.g. support
- for SimplePresence), and some interfaces (like SimplePresence) can
+ for Presence), and some interfaces (like Presence) can
even be used before connecting. Other capabilities may
or may not exist, depending on server functionality; by the time
the connection goes CONNECTED, the connection manager is expected
@@ -91,48 +69,15 @@ USA.</p>
interfaces for the remainder of the Connection's lifetime.</p>
</tp:rationale>
</tp:docstring>
- <tp:added version="0.19.2">Clients SHOULD fall back
- to calling <tp:member-ref>GetInterfaces</tp:member-ref> if this
- property is not supported.</tp:added>
+ <tp:added version="0.19.2"/>
</property>
- <method name="GetInterfaces" tp:name-for-bindings="Get_Interfaces">
- <arg direction="out" type="as" tp:type="DBus_Interface[]"
- name="Interfaces">
- <tp:docstring>
- The value of the <tp:member-ref>Interfaces</tp:member-ref> property
- </tp:docstring>
- </arg>
-
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Returns the set of optional interfaces supported by this
- connection. See <tp:member-ref>Interfaces</tp:member-ref> for more
- details.</p>
- </tp:docstring>
-
- <tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected">
- <tp:docstring>
- Before version 0.17.8 calling GetInterfaces while
- on a connection that is not yet CONNECTED wasn't allowed. If a
- CM returns this error, its list of interfaces should be regarded
- as empty until it becomes CONNECTED.
- </tp:docstring>
- </tp:error>
- </tp:possible-errors>
- </method>
-
- <method name="GetProtocol" tp:name-for-bindings="Get_Protocol">
- <arg direction="out" type="s" tp:type="Protocol" name="Protocol">
- <tp:docstring>
- A string identifier for the protocol
- </tp:docstring>
- </arg>
-
+ <property name="Protocol" tp:name-for-bindings="Protocol"
+ access="read" type="s" tp:type="Protocol">
<tp:docstring>
- Get the protocol this connection is using.
+ A string identifier for the protocol.
</tp:docstring>
- </method>
+ </property>
<signal name="SelfHandleChanged"
tp:name-for-bindings="Self_Handle_Changed">
@@ -163,33 +108,9 @@ USA.</p>
If the connection is not yet in the CONNECTED state, the value of
this property MAY be zero.
</tp:docstring>
- <tp:added version="0.17.10">For compatibility with older
- versions, clients should fall back to calling the
- <tp:member-ref>GetSelfHandle</tp:member-ref>
- method.</tp:added>
+ <tp:added version="0.17.10"/>
</property>
- <method name="GetSelfHandle" tp:name-for-bindings="Get_Self_Handle">
- <arg direction="out" type="u" tp:type="Contact_Handle"
- name="Self_Handle">
- <tp:docstring>
- The value of the <tp:member-ref>SelfHandle</tp:member-ref> property
- </tp:docstring>
- </arg>
-
- <tp:docstring>
- Returns the value of the SelfHandle property. Change notification
- is via the SelfHandleChanged signal.
- </tp:docstring>
- <tp:deprecated version="0.17.10">Use GetAll to get the
- SelfHandle property (and all other Connection properties)
- instead.</tp:deprecated>
-
- <tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
- </tp:possible-errors>
- </method>
-
<property name="Status" tp:name-for-bindings="Status"
access="read" type="u" tp:type="Connection_Status">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
@@ -202,82 +123,9 @@ USA.</p>
SHOULD be removed from the bus entirely, meaning that retrieval of
this property SHOULD fail.</p>
</tp:docstring>
- <tp:added version="0.19.2">Clients SHOULD fall back
- to calling <tp:member-ref>GetStatus</tp:member-ref> if this
- property is not supported.</tp:added>
+ <tp:added version="0.19.2"/>
</property>
- <method name="GetStatus" tp:name-for-bindings="Get_Status">
- <arg direction="out" type="u" tp:type="Connection_Status"
- name="Status">
- <tp:docstring>
- The value of the <tp:member-ref>Status</tp:member-ref> property
- </tp:docstring>
- </arg>
-
- <tp:docstring>
- Get the current status as defined in the
- <tp:member-ref>StatusChanged</tp:member-ref> signal.
- </tp:docstring>
- </method>
-
- <method name="HoldHandles" tp:name-for-bindings="Hold_Handles">
- <tp:changed version="0.21.6">If
- <tp:member-ref>HasImmortalHandles</tp:member-ref> is true,
- this method no longer does anything.</tp:changed>
- <arg direction="in" name="Handle_Type" type="u" tp:type="Handle_Type">
- <tp:docstring>
- The type of handle to be held
- </tp:docstring>
- </arg>
-
- <arg direction="in" name="Handles" type="au" tp:type="Handle[]">
- <tp:docstring>
- A array of integer handles to hold
- </tp:docstring>
- </arg>
-
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true,
- which SHOULD always be the case in this version of telepathy-spec,
- this method does nothing and returns successfully, unless
- the given handle type or any of the given handles is invalid.</p>
-
- <p>In older connection managers, this method
- notifies the connection manger that your client is holding a copy
- of handles which may not be in use in any existing channel or
- list, and were not obtained by using the
- <tp:member-ref>RequestHandles</tp:member-ref> method. For
- example, a handle observed in an emitted signal, or displayed
- somewhere in the UI that is not associated with a channel. The
- connection manager must not deallocate a handle where any clients
- have used this method to indicate it is in use until the
- <tp:member-ref>ReleaseHandles</tp:member-ref>
- method is called, or the clients disappear from the bus.</p>
-
- <p>Note that HoldHandles is idempotent - calling it multiple times
- is equivalent to calling it once. If a handle is "referenced" by
- several components which share a D-Bus unique name, the client
- should perform reference counting internally, and only call
- ReleaseHandles when none of the cooperating components need the
- handle any longer.</p>
- </tp:docstring>
-
- <tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
- <tp:docstring>
- The handle type is invalid
- </tp:docstring>
- </tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidHandle">
- <tp:docstring>
- One of the given handles is not valid
- </tp:docstring>
- </tp:error>
- </tp:possible-errors>
- </method>
-
<method name="InspectHandles" tp:name-for-bindings="Inspect_Handles">
<arg direction="in" name="Handle_Type" type="u" tp:type="Handle_Type">
<tp:docstring>
@@ -303,13 +151,13 @@ USA.</p>
</tp:docstring>
<tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
+ <tp:error name="im.telepathy1.Error.Disconnected"/>
+ <tp:error name="im.telepathy1.Error.InvalidArgument">
<tp:docstring>
The handle type is invalid
</tp:docstring>
</tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidHandle">
+ <tp:error name="im.telepathy1.Error.InvalidHandle">
<tp:docstring>
One of the given handles is not valid
</tp:docstring>
@@ -317,265 +165,6 @@ USA.</p>
</tp:possible-errors>
</method>
- <method name="ListChannels" tp:name-for-bindings="List_Channels">
- <tp:deprecated version="0.17.23">Use the
- <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Connection.Interface">Requests.Channels</tp:dbus-ref>
- property instead.
- </tp:deprecated>
-
- <arg direction="out" type="a(osuu)" tp:type="Channel_Info[]"
- name="Channel_Info">
- <tp:docstring>
- An array of structs representing channels.
- </tp:docstring>
- </arg>
-
- <tp:docstring>
- List all the channels which currently exist on this connection.
- </tp:docstring>
-
- <tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
- </tp:possible-errors>
- </method>
-
- <signal name="NewChannel" tp:name-for-bindings="New_Channel">
- <tp:deprecated version="0.17.23">Connection managers MUST still
- emit this signal, but clients SHOULD listen for the <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Connection.Interface">Requests.NewChannels</tp:dbus-ref>
- signal instead.
- </tp:deprecated>
-
- <arg name="Object_Path" type="o">
- <tp:docstring>
- A D-Bus object path for the channel object on this service
- </tp:docstring>
- </arg>
-
- <arg name="Channel_Type" type="s" tp:type="DBus_Interface">
- <tp:docstring>
- A D-Bus interface name representing the channel type
- </tp:docstring>
- </arg>
-
- <arg name="Handle_Type" type="u" tp:type="Handle_Type">
- <tp:docstring>
- An integer representing the type of handle this channel
- communicates with, or Handle_Type_None if no handle is specified
- </tp:docstring>
- </arg>
-
- <arg name="Handle" type="u" tp:type="Handle">
- <tp:docstring>
- A handle indicating the specific contact, room or list this
- channel communicates with, or zero if no handle is specified
- </tp:docstring>
- </arg>
-
- <arg name="Suppress_Handler" type="b">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>If true, the channel was requested by a client that intends to
- present it to the user itself (i.e. it passed suppress_handler=TRUE
- to the <tp:member-ref>RequestChannel</tp:member-ref> method), so no
- other handler should be
- launched. Clients MAY assume that channels where this is true
- were created by a user request.</p>
-
- <p>If false, either the channel was created due to incoming
- information from the service, or the channel was requested by
- a local client that does not intend to handle the channel itself
- (this usage is deprecated).</p>
-
- <p>Clients MUST NOT assume that only incoming channels will have
- this flag set to false.</p>
- </tp:docstring>
- </arg>
-
- <tp:docstring>
- Emitted when a new Channel object is created, either through user
- request or incoming information from the service.
- </tp:docstring>
- </signal>
-
- <method name="ReleaseHandles" tp:name-for-bindings="Release_Handles">
- <tp:changed version="0.21.6">If
- <tp:member-ref>HasImmortalHandles</tp:member-ref> is true,
- this method no longer does anything.</tp:changed>
- <arg direction="in" name="Handle_Type" type="u" tp:type="Handle_Type">
- <tp:docstring>
- An integer handle type (as defined in RequestHandle)
- </tp:docstring>
- </arg>
-
- <arg direction="in" name="Handles" type="au" tp:type="Handle[]">
- <tp:docstring>
- An array of integer handles being held by the client
- </tp:docstring>
- </arg>
-
- <tp:docstring>
- <p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true,
- which SHOULD always be the case in this version of telepathy-spec,
- this method does nothing and returns successfully, unless
- the given handle type or any of the given handles is invalid.</p>
-
- <p>In older connection managers, this method
- explicitly notifies the connection manager that your client is no
- longer holding any references to the given handles, and that they
- may be deallocated if they are not held by any other clients or
- referenced by any existing channels. See
- <tp:member-ref>HoldHandles</tp:member-ref> for notes.</p>
- </tp:docstring>
-
- <tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
- <tp:docstring>
- The handle type is invalid
- </tp:docstring>
- </tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidHandle">
- <tp:docstring>
- One of the given handles is not valid
- </tp:docstring>
- </tp:error>
- </tp:possible-errors>
- </method>
-
- <method name="RequestChannel" tp:name-for-bindings="Request_Channel">
- <tp:deprecated version="0.17.23">Use
- <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Connection.Interface">Requests.CreateChannel</tp:dbus-ref>
- or <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Connection.Interface">Requests.EnsureChannel</tp:dbus-ref>
- instead. Connection managers MAY implement RequestChannel by
- raising NotImplemented, or implement fewer types of channel via
- this API.</tp:deprecated>
-
- <arg direction="in" name="Type" type="s" tp:type="DBus_Interface">
- <tp:docstring>
- A D-Bus interface name representing base channel type
- </tp:docstring>
- </arg>
-
- <arg direction="in" name="Handle_Type" type="u" tp:type="Handle_Type">
- <tp:docstring>
- An integer representing the handle type, or Handle_Type_None if
- no handle is specified
- </tp:docstring>
- </arg>
-
- <arg direction="in" name="Handle" type="u" tp:type="Handle">
- <tp:docstring>
- A nonzero integer handle representing a contact, room, list etc.
- according to handle_type, or zero if the handle_type is
- Handle_Type_None
- </tp:docstring>
- </arg>
-
- <arg direction="in" name="Suppress_Handler" type="b">
- <tp:docstring>
- <p>Clients SHOULD always set this to true.</p>
-
- <tp:rationale>
- <p>The historical meaning was that clients that did not
- intend to take responsibility for displaying the channel to
- the user could set this to FALSE, in which case the channel
- dispatcher would launch an appropriate channel handler.</p>
-
- <p>However, clients whose functionality relies on having a
- working channel dispatcher should obtain that functionality by
- calling methods on the channel dispatcher, so that they will
- get an appropriate error if the channel dispatcher is missing
- or not working.</p>
-
- <p>The channel dispatcher itself should set this to true too,
- so that it will ignore the
- <tp:member-ref>NewChannel</tp:member-ref> signal that results
- from the creation of the channel. It can then dispatch the
- channel returned from this method to an
- appropriate handler.</p>
-
- <p>So, there is no sensible use-case for setting this to false,
- and setting it to false can result in unhandled channels (in
- the case where clients assume that a channel dispatcher is
- present, but it isn't).</p>
- </tp:rationale>
- </tp:docstring>
- </arg>
-
- <arg direction="out" type="o" name="Object_Path">
- <tp:docstring>
- The D-Bus object path for the channel created or retrieved
- </tp:docstring>
- </arg>
-
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Request a channel satisfying the specified type and communicating
- with the contact, room, list etc. indicated by the given
- handle_type and handle. The handle_type and handle may both be
- zero to request the creation of a new, empty channel, which may
- or may not be possible, depending on the protocol and channel
- type.</p>
-
- <p>On success, the returned channel will always be of the requested
- type (i.e. implement the requested channel-type interface).</p>
-
- <p>If a new, empty channel is requested, on success the returned
- channel will always be an "anonymous" channel for which the type
- and handle are both zero.</p>
-
- <p>If a channel to a contact, room etc. is requested, on success, the
- returned channel may either be a new or existing channel to
- the requested entity (i.e. its
- <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Channel">TargetHandleType</tp:dbus-ref>
- and <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref>
- properties are the
- requested handle type and handle), or a newly created "anonymous"
- channel associated with the requested handle in some
- implementation-specific way.</p>
-
- <p>For example, for a contact handle, the returned channel
- might be "anonymous", but implement the groups interface and have
- the requested contact already present among the members.</p>
-
- <p>If the request cannot be satisfied, an error is raised and no
- channel is created.</p>
- </tp:docstring>
-
- <tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
- <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/>
- <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
- <tp:docstring>
- Unknown channel type
- </tp:docstring>
- </tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidHandle">
- <tp:docstring>
- The given handle does not exist or cannot be created
- </tp:docstring>
- </tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable">
- <tp:docstring>
- The requested channel type cannot be created with the given handle
- </tp:docstring>
- </tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.NotCapable">
- <tp:docstring>
- The requested channel cannot be created because contact doesn't
- have the required capabilities.
- </tp:docstring>
- </tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.Channel.Banned"/>
- <tp:error name="org.freedesktop.Telepathy.Error.Channel.Full"/>
- <tp:error name="org.freedesktop.Telepathy.Error.Channel.InviteOnly"/>
- </tp:possible-errors>
- </method>
-
<tp:enum name="Handle_Type" type="u">
<tp:enumvalue suffix="None" value="0">
<tp:docstring>
@@ -613,28 +202,7 @@ USA.</p>
Handle_Type_Room</tp:docstring>
</tp:simple-type>
- <tp:simple-type name="List_Handle" type="u"
- array-name="List_Handle_List">
- <tp:deprecated version="0.25.0">Replaced by <tp:dbus-ref
- namespace="org.freedesktop.Telepathy">Connection.Interface.ContactList</tp:dbus-ref>
- </tp:deprecated>
- <tp:docstring>An unsigned 32-bit integer representing a handle of type
- Handle_Type_List</tp:docstring>
- </tp:simple-type>
-
- <tp:simple-type name="Group_Handle" type="u"
- array-name="Group_Handle_List">
- <tp:deprecated version="0.25.0">Replaced by <tp:dbus-ref
- namespace="org.freedesktop.Telepathy">Connection.Interface.ContactList</tp:dbus-ref>
- </tp:deprecated>
- <tp:docstring>An unsigned 32-bit integer representing a handle of type
- Handle_Type_Group</tp:docstring>
- </tp:simple-type>
-
<method name="RequestHandles" tp:name-for-bindings="Request_Handles">
- <tp:changed version="0.21.6">If
- <tp:member-ref>HasImmortalHandles</tp:member-ref> is true,
- this method no longer has its reference-counting effect.</tp:changed>
<arg direction="in" name="Handle_Type" type="u" tp:type="Handle_Type">
<tp:docstring>
The type of handle required
@@ -657,25 +225,11 @@ USA.</p>
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
<p>Request several handles from the connection manager which represent a
number of contacts, rooms or server-stored lists on the service.</p>
-
- <p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true,
- which SHOULD always be the case in this version of telepathy-spec,
- the handles remain valid until the connection disconnects.</p>
-
- <p>The implementation of this method in older connection managers
- must record that these handles are in use by the
- client who invokes this method, and must not deallocate the handles
- until the client disconnects from the bus or calls the
- <tp:member-ref>ReleaseHandles</tp:member-ref>
- method. Where the identifier refers to an entity that already has a
- handle in this connection manager, this handle should be returned
- instead. The handle number 0 must not be returned by the connection
- manager.</p>
</tp:docstring>
<tp:possible-errors>
- <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
- <tp:error name="org.freedesktop.Telepathy.Error.InvalidHandle">
+ <tp:error name="im.telepathy1.Error.Disconnected"/>
+ <tp:error name="im.telepathy1.Error.InvalidHandle">
<tp:docstring>
The given identifier does not identify a valid entity of the given
type.
@@ -687,7 +241,7 @@ USA.</p>
</tp:rationale>
</tp:docstring>
</tp:error>
- <tp:error name="org.freedesktop.Telepathy.Error.NotImplemented">
+ <tp:error name="im.telepathy1.Error.NotImplemented">
<tp:docstring>
The given handle type is not valid, or is not implemented on this
connection.
@@ -717,13 +271,13 @@ USA.</p>
</tp:enumvalue>
<tp:enumvalue suffix="Disconnected" value="2">
<tp:docstring>
- If this is retrieved from <tp:member-ref>GetStatus</tp:member-ref> or
- <tp:member-ref>Status</tp:member-ref>, it indicates that connection
- has not yet been attempted. If seen in a
- <tp:member-ref>StatusChanged</tp:member-ref> signal, it indicates
- that the connection has failed; the Connection object SHOULD be
- removed from D-Bus immediately, and all subsequent method calls
- SHOULD fail.
+ If this is retrieved from
+ <tp:member-ref>Status</tp:member-ref>, it indicates that
+ connection has not yet been attempted. If seen in a
+ <tp:member-ref>StatusChanged</tp:member-ref> signal, it
+ indicates that the connection has failed; the Connection
+ object SHOULD be removed from D-Bus immediately, and all
+ subsequent method calls SHOULD fail.
</tp:docstring>
</tp:enumvalue>
</tp:enum>
@@ -741,7 +295,7 @@ USA.</p>
reasons SHOULD be treated like this reason.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.<tp:error-ref>Disconnected</tp:error-ref></code>.</p>
+ <code>im.telepathy1.Error.<tp:error-ref>Disconnected</tp:error-ref></code>.</p>
</tp:docstring>
</tp:enumvalue>
@@ -753,7 +307,7 @@ USA.</p>
if and only if the disconnection was requested by the user.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cancelled</code>.</p>
+ <code>im.telepathy1.Error.Cancelled</code>.</p>
</tp:docstring>
</tp:enumvalue>
@@ -763,15 +317,15 @@ USA.</p>
<p>When the status changes from Connecting to Disconnected for this
reason, the equivalent D-Bus error is either
- <code>org.freedesktop.Telepathy.Error.NetworkError</code>,
- <code>org.freedesktop.Telepathy.Error.ConnectionRefused</code>,
- <code>org.freedesktop.Telepathy.Error.ConnectionFailed</code>
+ <code>im.telepathy1.Error.NetworkError</code>,
+ <code>im.telepathy1.Error.ConnectionRefused</code>,
+ <code>im.telepathy1.Error.ConnectionFailed</code>
or some more specific error.</p>
<p>When the status changes from Connected to Disconnected for this
reason, the equivalent D-Bus error is either
- <code>org.freedesktop.Telepathy.Error.NetworkError</code>,
- <code>org.freedesktop.Telepathy.Error.ConnectionLost</code>
+ <code>im.telepathy1.Error.NetworkError</code>,
+ <code>im.telepathy1.Error.ConnectionLost</code>
or some more specific error.</p>
</tp:docstring>
</tp:enumvalue>
@@ -781,7 +335,7 @@ USA.</p>
<p>The username or password was invalid.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.AuthenticationFailed</code>.
+ <code>im.telepathy1.Error.AuthenticationFailed</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -793,9 +347,9 @@ USA.</p>
connection was created.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.EncryptionNotAvailable</code>
+ <code>im.telepathy1.Error.EncryptionNotAvailable</code>
if encryption was not available at all, or
- <code>org.freedesktop.Telepathy.Error.EncryptionError</code>
+ <code>im.telepathy1.Error.EncryptionError</code>
if encryption failed.</p>
</tp:docstring>
</tp:enumvalue>
@@ -812,7 +366,7 @@ USA.</p>
and true, the requested account could not be created on the
server because it already exists.
The equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.RegistrationExists</code>.
+ <code>im.telepathy1.Error.RegistrationExists</code>.
</li>
<li>If the status change is from Connecting to Disconnected
@@ -820,7 +374,7 @@ USA.</p>
manager could not connect to the specified account because
a connection to that account already exists.
The equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.AlreadyConnected</code>.
+ <code>im.telepathy1.Error.AlreadyConnected</code>.
<tp:rationale>
In some protocols, like XMPP (when connecting with the same
@@ -834,7 +388,7 @@ USA.</p>
a new connection to the same account (perhaps from a different
client or location) was established.
The equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.ConnectionReplaced</code>.
+ <code>im.telepathy1.Error.ConnectionReplaced</code>.
<tp:rationale>
In some protocols, like MSNP (when connecting twice with the
@@ -851,7 +405,7 @@ USA.</p>
<p>The server did not provide a SSL certificate.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.NotProvided</code>.
+ <code>im.telepathy1.Error.Cert.NotProvided</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -864,7 +418,7 @@ USA.</p>
that.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.Untrusted</code>.
+ <code>im.telepathy1.Error.Cert.Untrusted</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -874,7 +428,7 @@ USA.</p>
<p>The server's SSL certificate has expired.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.Expired</code>.
+ <code>im.telepathy1.Error.Cert.Expired</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -884,7 +438,7 @@ USA.</p>
<p>The server's SSL certificate is not yet valid.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.NotActivated</code>.
+ <code>im.telepathy1.Error.Cert.NotActivated</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -894,7 +448,7 @@ USA.</p>
<p>The server's SSL certificate did not match its hostname.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.HostnameMismatch</code>.
+ <code>im.telepathy1.Error.Cert.HostnameMismatch</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -905,7 +459,7 @@ USA.</p>
fingerprint.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch</code>.
+ <code>im.telepathy1.Error.Cert.FingerprintMismatch</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -915,7 +469,7 @@ USA.</p>
<p>The server's SSL certificate is self-signed.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.SelfSigned</code>.
+ <code>im.telepathy1.Error.Cert.SelfSigned</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -926,7 +480,7 @@ USA.</p>
certificate.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.Invalid</code>.
+ <code>im.telepathy1.Error.Cert.Invalid</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -936,7 +490,7 @@ USA.</p>
<p>The server's SSL certificate has been revoked.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.Revoked</code>.
+ <code>im.telepathy1.Error.Cert.Revoked</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -947,7 +501,7 @@ USA.</p>
or is cryptographically weak.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.Insecure</code>.
+ <code>im.telepathy1.Error.Cert.Insecure</code>.
</p>
</tp:docstring>
</tp:enumvalue>
@@ -959,7 +513,7 @@ USA.</p>
library.</p>
<p>When disconnected for this reason, the equivalent D-Bus error is
- <code>org.freedesktop.Telepathy.Error.Cert.LimitExceeded</code>
+ <code>im.telepathy1.Error.Cert.LimitExceeded</code>
</p>
</tp:docstring>
</tp:enumvalue>
@@ -1004,7 +558,7 @@ USA.</p>
<tp:type>Connection_Status_Reason</tp:type>, or may be a more
specific Telepathy error
(such as
- <code>org.freedesktop.Telepathy.Error.ConnectionRefused</code>
+ <code>im.telepathy1.Error.ConnectionRefused</code>
for Connection_Status_Reason_Network_Error)
or a protocol-specific or connection-manager-specific error in a
suitable namespace.
@@ -1070,7 +624,7 @@ USA.</p>
<p>The same string that would be returned by
<tp:member-ref>InspectHandles</tp:member-ref>. As a special case,
this is always present in the result of <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Connection.Interface.Contacts">GetContactAttributes</tp:dbus-ref>,
+ namespace="im.telepathy1.Connection.Interface.Contacts">GetContactAttributes</tp:dbus-ref>,
whether it was explicitly requested or not.</p>
</tp:docstring>
</tp:contact-attribute>
@@ -1115,8 +669,8 @@ USA.</p>
there is no active subscription.</p>
<p>One situation where this is useful is <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Connection.Interface"
- >Location</tp:dbus-ref>: on XMPP, location updates are received
+ namespace="im.telepathy1.Connection.Interface"
+ >Location1</tp:dbus-ref>: on XMPP, location updates are received
over PEP. If the Connection advertises the
<code>geoloc+notify</code> capability, it will be sent location
updates for all contacts. To avoid consuming resources for this,
@@ -1126,8 +680,8 @@ USA.</p>
<p>Another example of a protocol that benefits from this method is
the Google XMPP Mail Notification extension, which can be used
to implement <tp:dbus-ref
- namespace="org.freedesktop.Telepathy.Connection.Interface"
- >MailNotification</tp:dbus-ref>. In this protocol, the CM
+ namespace="im.telepathy1.Connection.Interface"
+ >MailNotification1</tp:dbus-ref>. In this protocol, the CM
receives a notification that something has changed, but to get
more information, the CM must request this information. Knowing
that nobody is currently interested in this information, the CM
@@ -1202,9 +756,9 @@ USA.</p>
<p>In order to allow Connection objects to be discovered by new clients,
the object path and well-known bus name MUST be of the form
- <code>/org/freedesktop/Telepathy/Connection/cmname/proto/account</code>
+ <code>/im/telepathy/Connection/cmname/proto/account</code>
and
- <code>org.freedesktop.Telepathy.Connection.cmname.proto.account</code>
+ <code>im.telepathy1.Connection.cmname.proto.account</code>
where:</p>
<ul>
@@ -1212,7 +766,7 @@ USA.</p>
<tp:type>Connection_Manager_Name</tp:type> that appears
in the connection manager's object path and well-known bus name</li>
<li><em>proto</em> is the <tp:type>Protocol</tp:type> name as seen in
- <tp:dbus-ref namespace="org.freedesktop.Telepathy.ConnectionManager">ListProtocols</tp:dbus-ref>,
+ <tp:dbus-ref namespace="imt1.ConnectionManager">Protocols</tp:dbus-ref>,
but with "-" replaced with "_" to get a valid
object path/bus name</li>
<li><em>account</em> is some non-empty sequence of ASCII letters,
@@ -1235,12 +789,12 @@ USA.</p>
<p>As well as the methods and signatures below, arbitrary interfaces may be
provided by the Connection object to represent extra connection-wide
- functionality, such as the Connection.Interface.SimplePresence for
+ functionality, such as the Connection.Interface.Presence for
receiving and
reporting presence information, and Connection.Interface.Aliasing for
connections where contacts may set and change an alias for themselves.
These interfaces can be discovered using the
- <tp:member-ref>GetInterfaces</tp:member-ref> method.</p>
+ <tp:member-ref>Interfaces</tp:member-ref> property.</p>
<p>Contacts, rooms, and server-stored lists (such as subscribed contacts,
block lists, or allow lists) on a service are all represented by
@@ -1252,19 +806,10 @@ USA.</p>
<p>Zero as a handle value is sometimes used as a "null" value to mean
the absence of a contact, room, etc.</p>
- <p>Handles have per-type uniqueness, meaning that
- every (handle type, handle number) tuple is guaranteed to be unique within
- a connection and that a handle alone (without its type) is meaningless or
- ambiguous. Connection manager implementations should reference count these
- handles to determine if they are in use either by any active clients or any
- open channels, and may deallocate them when this ceases to be true. Clients
- may request handles of a given type and identifier with the
- <tp:member-ref>RequestHandles</tp:member-ref> method, inspect the entity
- identifier with the <tp:member-ref>InspectHandles</tp:member-ref>
- method, keep handles from being released with
- <tp:member-ref>HoldHandles</tp:member-ref>, and notify that they are no
- longer storing handles with
- <tp:member-ref>ReleaseHandles</tp:member-ref>.</p>
+ <p>Handles have per-type uniqueness, meaning that every (handle
+ type, handle number) tuple is guaranteed to be unique within a
+ connection for the lifetime of the connection and that a handle
+ alone (without its type) is meaningless or ambiguous.</p>
</tp:docstring>
<tp:changed version="0.17.10">Previously, the account part of
@@ -1278,6 +823,10 @@ USA.</p>
are now mandatory. Their functionality will be merged into the main
Connection interface at some point in future.</tp:changed>
+ <tp:changed version="UNRELEASED">All deprecated types, methods,
+ and signals have been removed from this interface including
+ anything to do with handle reference counting.</tp:changed>
+
</interface>
</node>
<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index ea58e2006..f16626356 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -291,7 +291,6 @@ static guint signals[N_SIGNALS] = {0};
typedef struct _ChannelRequest ChannelRequest;
typedef enum {
- METHOD_REQUEST_CHANNEL,
METHOD_CREATE_CHANNEL,
METHOD_ENSURE_CHANNEL,
NUM_METHODS
@@ -305,8 +304,6 @@ struct _ChannelRequest
gchar *channel_type;
guint handle_type;
guint handle;
- /* always TRUE for CREATE; always FALSE for ENSURE */
- unsigned suppress_handler : 1;
/* only meaningful for METHOD_ENSURE_CHANNEL; only true if this is the first
* request to be satisfied with a particular channel, and no other request
@@ -320,8 +317,7 @@ channel_request_new (DBusGMethodInvocation *context,
ChannelRequestMethod method,
const char *channel_type,
guint handle_type,
- guint handle,
- gboolean suppress_handler)
+ guint handle)
{
ChannelRequest *ret;
@@ -335,11 +331,10 @@ channel_request_new (DBusGMethodInvocation *context,
ret->channel_type = g_strdup (channel_type);
ret->handle_type = handle_type;
ret->handle = handle;
- ret->suppress_handler = suppress_handler;
ret->yours = FALSE;
- DEBUG("New channel request at %p: ctype=%s htype=%d handle=%d suppress=%d",
- ret, channel_type, handle_type, handle, suppress_handler);
+ DEBUG("New channel request at %p: ctype=%s htype=%d handle=%d",
+ ret, channel_type, handle_type, handle);
return ret;
}
@@ -348,9 +343,9 @@ static void
channel_request_free (ChannelRequest *request)
{
g_assert (NULL == request->context);
- DEBUG("Freeing channel request at %p: ctype=%s htype=%d handle=%d "
- "suppress=%d", request, request->channel_type, request->handle_type,
- request->handle, request->suppress_handler);
+ DEBUG("Freeing channel request at %p: ctype=%s htype=%d handle=%d",
+ request, request->channel_type, request->handle_type,
+ request->handle);
g_free (request->channel_type);
g_slice_free (ChannelRequest, request);
}
@@ -641,82 +636,6 @@ tp_base_connection_finalize (GObject *object)
G_OBJECT_CLASS (tp_base_connection_parent_class)->finalize (object);
}
-
-/**
- * exportable_channel_get_old_info:
- * @channel: a channel
- * @object_path_out: address at which to store the channel's object path,
- * which the caller should g_free()
- * @channel_type_out: address at which to store the channel's type, which the
- * caller should g_free()
- * @handle_type_out: address at which to store the channel's associated handle
- * type
- * @handle_out: address at which to store the channel's associated
- * handle, if any. This is a borrowed reference; the caller
- * does not need to tp_handle_unref() it.
- *
- * Given a new-style exportable channel, as used by the Requests interface's
- * API, fetches the information needed for the old-style ListChannels method
- * on Connections.
- */
-static void
-exportable_channel_get_old_info (TpExportableChannel *channel,
- gchar **object_path_out,
- gchar **channel_type_out,
- guint *handle_type_out,
- guint *handle_out)
-{
- gchar *object_path;
- GHashTable *channel_properties;
- gboolean valid;
-
- g_object_get (channel,
- "object-path", &object_path,
- "channel-properties", &channel_properties,
- NULL);
-
- g_assert (object_path != NULL);
- g_assert (tp_dbus_check_valid_object_path (object_path, NULL));
-
- if (object_path_out != NULL)
- *object_path_out = object_path;
- else
- g_free (object_path);
-
- if (channel_type_out != NULL)
- {
- *channel_type_out = g_strdup (tp_asv_get_string (channel_properties,
- TP_PROP_CHANNEL_CHANNEL_TYPE));
- g_assert (*channel_type_out != NULL);
- g_assert (tp_dbus_check_valid_interface_name (*channel_type_out, NULL));
- }
-
- if (handle_type_out != NULL)
- {
- *handle_type_out = tp_asv_get_uint32 (channel_properties,
- TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid);
- g_assert (valid);
- }
-
- if (handle_out != NULL)
- {
- *handle_out = tp_asv_get_uint32 (channel_properties,
- TP_PROP_CHANNEL_TARGET_HANDLE, &valid);
- g_assert (valid);
-
- if (handle_type_out != NULL)
- {
- if (*handle_type_out == TP_HANDLE_TYPE_NONE)
- g_assert (*handle_out == 0);
- else
- g_assert (*handle_out != 0);
- }
- }
-
- g_hash_table_unref (channel_properties);
-}
-
-
/*
* get_channel_details:
* @obj: a channel, which must implement one of #TpExportableChannel and
@@ -783,8 +702,7 @@ find_matching_channel_requests (TpBaseConnection *conn,
const gchar *channel_type,
guint handle_type,
guint handle,
- ChannelRequest *channel_request,
- gboolean *suppress_handler)
+ ChannelRequest *channel_request)
{
TpBaseConnectionPrivate *priv = conn->priv;
GPtrArray *requests;
@@ -803,12 +721,7 @@ find_matching_channel_requests (TpBaseConnection *conn,
tp_g_ptr_array_contains (priv->channel_requests, channel_request));
if (channel_request)
- {
- g_ptr_array_add (requests, channel_request);
-
- if (suppress_handler && channel_request->suppress_handler)
- *suppress_handler = TRUE;
- }
+ g_ptr_array_add (requests, channel_request);
/* whether we've put any matches in requests or not */
return requests;
@@ -830,9 +743,6 @@ find_matching_channel_requests (TpBaseConnection *conn,
if (handle != request->handle)
continue;
- if (request->suppress_handler && suppress_handler)
- *suppress_handler = TRUE;
-
g_ptr_array_add (requests, request);
}
@@ -856,16 +766,11 @@ satisfy_request (TpBaseConnection *conn,
DEBUG ("completing queued request %p with success, "
"channel_type=%s, handle_type=%u, "
- "handle=%u, suppress_handler=%u", request, request->channel_type,
- request->handle_type, request->handle, request->suppress_handler);
+ "handle=%u", request, request->channel_type,
+ request->handle_type, request->handle);
switch (request->method)
{
- case METHOD_REQUEST_CHANNEL:
- tp_svc_connection_return_from_request_channel (request->context,
- object_path);
- break;
-
case METHOD_CREATE_CHANNEL:
{
GHashTable *properties;
@@ -914,7 +819,6 @@ factory_satisfy_requests (TpBaseConnection *conn,
{
gchar *object_path = NULL, *channel_type = NULL;
guint handle_type = 0, handle = 0;
- gboolean suppress_handler = FALSE;
GPtrArray *tmp;
guint i;
@@ -928,8 +832,7 @@ factory_satisfy_requests (TpBaseConnection *conn,
DEBUG ("called for %s", object_path);
tmp = find_matching_channel_requests (conn, channel_type, handle_type,
- handle, channel_request,
- &suppress_handler);
+ handle, channel_request);
for (i = 0; i < tmp->len; i++)
satisfy_request (conn, g_ptr_array_index (tmp, i), G_OBJECT (chan),
@@ -943,9 +846,6 @@ factory_satisfy_requests (TpBaseConnection *conn,
tp_svc_connection_interface_requests_emit_new_channels (conn, array);
g_value_array_free (g_ptr_array_index (array, 0));
g_ptr_array_unref (array);
-
- tp_svc_connection_emit_new_channel (conn, object_path, channel_type,
- handle_type, handle, suppress_handler);
}
g_ptr_array_unref (tmp);
@@ -963,9 +863,9 @@ fail_channel_request (TpBaseConnection *conn,
TpBaseConnectionPrivate *priv = conn->priv;
DEBUG ("completing queued request %p with error, channel_type=%s, "
- "handle_type=%u, handle=%u, suppress_handler=%u",
+ "handle_type=%u, handle=%u",
request, request->channel_type,
- request->handle_type, request->handle, request->suppress_handler);
+ request->handle_type, request->handle);
dbus_g_method_return_error (request->context, error);
request->context = NULL;
@@ -1032,7 +932,7 @@ factory_channel_error_cb (TpChannelFactoryIface *factory,
NULL);
tmp = find_matching_channel_requests (conn, channel_type, handle_type,
- handle, channel_request, NULL);
+ handle, channel_request);
for (i = 0; i < tmp->len; i++)
fail_channel_request (conn, g_ptr_array_index (tmp, i), error);
@@ -1044,13 +944,6 @@ factory_channel_error_cb (TpChannelFactoryIface *factory,
/* Channel manager signal handlers */
-typedef struct {
- TpBaseConnection *self;
- /* borrowed TpExportableChannel => itself if suppress_handler,
- * omitted otherwise */
- GHashTable *suppress_handler;
-} ManagerNewChannelContext;
-
static void
manager_new_channel (gpointer key,
gpointer value,
@@ -1058,46 +951,22 @@ manager_new_channel (gpointer key,
{
TpExportableChannel *channel = TP_EXPORTABLE_CHANNEL (key);
GSList *request_tokens = value;
- ManagerNewChannelContext *context = data;
- TpBaseConnection *self = TP_BASE_CONNECTION (context->self);
+ TpBaseConnection *self = TP_BASE_CONNECTION (data);
gchar *object_path;
GSList *iter;
- gboolean suppress_handler = FALSE;
gboolean satisfies_create_channel = FALSE;
- gboolean satisfies_request_channel = FALSE;
ChannelRequest *first_ensure = NULL;
g_object_get (channel,
"object-path", &object_path,
NULL);
- /* suppress_handler on Connection.NewChannel should be TRUE if:
- * - any satisfied requests were calls to CreateChannel; or
- * - at least one satisfied RequestChannel call had suppress_handler=TRUE;
- * or
- * - any EnsureChannel call will receive Yours=TRUE (that is, if the
- * channel satisfies no CreateChannel or RequestChannel calls).
- *
- * So, it should be FALSE if:
- * - all the requests were RequestChannel(..., suppress_handler=FALSE) or
- * EnsureChannel and there was at least one RequestChannel; or
- * - no requests were satisfied by the channel.
- */
for (iter = request_tokens; iter != NULL; iter = iter->next)
{
ChannelRequest *request = iter->data;
switch (request->method)
{
- case METHOD_REQUEST_CHANNEL:
- satisfies_request_channel = TRUE;
- if (request->suppress_handler)
- {
- suppress_handler = TRUE;
- goto break_loop_early;
- }
- break;
-
case METHOD_CREATE_CHANNEL:
satisfies_create_channel = TRUE;
goto break_loop_early;
@@ -1113,29 +982,17 @@ manager_new_channel (gpointer key,
}
}
-break_loop_early:
-
- /* put the channel in the suppress_handler hash table if it needs
- * suppress_handler set when signalling NewChannel */
- if (request_tokens != NULL &&
- (satisfies_create_channel || !satisfies_request_channel))
- suppress_handler = TRUE;
-
- if (suppress_handler)
- g_hash_table_insert (context->suppress_handler, channel, channel);
+break_loop_early:
/* If the only type of request satisfied by this new channel is
* EnsureChannel, give exactly one request Yours=True.
* If other kinds of requests are involved, don't give anyone Yours=True.
*/
- if (!satisfies_request_channel
- && !satisfies_create_channel
- && first_ensure != NULL)
+ if (!satisfies_create_channel && first_ensure != NULL)
{
first_ensure->yours = TRUE;
}
-
for (iter = request_tokens; iter != NULL; iter = iter->next)
{
satisfy_request (self, iter->data, G_OBJECT (channel),
@@ -1152,17 +1009,14 @@ manager_new_channels_cb (TpChannelManager *manager,
TpBaseConnection *self)
{
GPtrArray *array;
- ManagerNewChannelContext context = { self, g_hash_table_new (NULL, NULL) };
GHashTableIter iter;
gpointer key, value;
g_assert (TP_IS_CHANNEL_MANAGER (manager));
g_assert (TP_IS_BASE_CONNECTION (self));
- /* satisfy the RequestChannel/CreateChannel/EnsureChannel calls; as
- * a side-effect, fill in context.suppress_handler with those channels
- * that will have to be signalled with suppress_handler = TRUE */
- g_hash_table_foreach (channels, manager_new_channel, &context);
+ /* satisfy the RequestChannel/CreateChannel/EnsureChannel calls */
+ g_hash_table_foreach (channels, manager_new_channel, self);
/* Emit NewChannels */
array = g_ptr_array_sized_new (g_hash_table_size (channels));
@@ -1178,28 +1032,6 @@ manager_new_channels_cb (TpChannelManager *manager,
g_ptr_array_foreach (array, (GFunc) g_value_array_free, NULL);
g_ptr_array_unref (array);
-
- /* Emit NewChannel */
- g_hash_table_iter_init (&iter, channels);
-
- while (g_hash_table_iter_next (&iter, &key, &value))
- {
- gboolean suppress_handler = (
- g_hash_table_lookup (context.suppress_handler, key) != NULL);
- gchar *object_path, *channel_type;
- guint handle_type, handle;
-
- exportable_channel_get_old_info (TP_EXPORTABLE_CHANNEL (key),
- &object_path, &channel_type, &handle_type, &handle);
-
- tp_svc_connection_emit_new_channel (self, object_path, channel_type,
- handle_type, handle, suppress_handler);
-
- g_free (object_path);
- g_free (channel_type);
- }
-
- g_hash_table_unref (context.suppress_handler);
}
@@ -1635,7 +1467,7 @@ tp_base_connection_class_init (TpBaseConnectionClass *klass)
* The "signal detail" is a GQuark representing @token. Modules implementing
* an interface (Location, say) should typically connect to a detailed signal
* like
- * "clients-interested::org.freedesktop.Telepathy.Connection.Interface.Location"
+ * "clients-interested::im.telepathy1.Connection.Interface.Location"
* rather than receiving all emissions of this signal.
*/
signals[CLIENTS_INTERESTED] =
@@ -1660,7 +1492,7 @@ tp_base_connection_class_init (TpBaseConnectionClass *klass)
* As with #TpBaseConnection::clients-interested, the "signal detail" is a
* GQuark representing @token. Modules implementing an interface (Location,
* say) should typically connect to a detailed signal like
- * "clients-uninterested::org.freedesktop.Telepathy.Connection.Interface.Location"
+ * "clients-uninterested::im.telepathy1.Connection.Interface.Location"
* rather than receiving all emissions of this signal.
*/
signals[CLIENTS_UNINTERESTED] =
@@ -2005,45 +1837,6 @@ tp_base_connection_get_interfaces (TpBaseConnection *self)
}
}
-static void
-tp_base_connection_dbus_get_interfaces (TpSvcConnection *iface,
- DBusGMethodInvocation *context)
-{
- tp_svc_connection_return_from_get_interfaces (context,
- (const gchar **) tp_base_connection_get_interfaces (
- (TpBaseConnection *) iface));
-}
-
-static void
-tp_base_connection_get_protocol (TpSvcConnection *iface,
- DBusGMethodInvocation *context)
-{
- TpBaseConnection *self = TP_BASE_CONNECTION (iface);
- TpBaseConnectionPrivate *priv;
-
- g_assert (TP_IS_BASE_CONNECTION (self));
-
- TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context);
-
- priv = self->priv;
-
- tp_svc_connection_return_from_get_protocol (context, priv->protocol);
-}
-
-static void
-tp_base_connection_dbus_get_self_handle (TpSvcConnection *iface,
- DBusGMethodInvocation *context)
-{
- TpBaseConnection *self = TP_BASE_CONNECTION (iface);
-
- g_assert (TP_IS_BASE_CONNECTION (self));
-
- TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context);
-
- tp_svc_connection_return_from_get_self_handle (
- context, self->self_handle);
-}
-
static guint
tp_base_connection_get_dbus_status (TpBaseConnection *self)
{
@@ -2061,42 +1854,6 @@ tp_base_connection_get_dbus_status (TpBaseConnection *self)
}
static void
-tp_base_connection_dbus_get_status (TpSvcConnection *iface,
- DBusGMethodInvocation *context)
-{
- tp_svc_connection_return_from_get_status (
- context, tp_base_connection_get_dbus_status (
- (TpBaseConnection *) iface));
-}
-
-static void
-tp_base_connection_hold_handles (TpSvcConnection *iface,
- guint handle_type,
- const GArray *handles,
- DBusGMethodInvocation *context)
-{
- TpBaseConnection *self = TP_BASE_CONNECTION (iface);
- TpBaseConnectionPrivate *priv;
- GError *error = NULL;
-
- g_assert (TP_IS_BASE_CONNECTION (self));
-
- priv = self->priv;
-
- TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context);
-
- if (!tp_handles_supported_and_valid (priv->handles,
- handle_type, handles, FALSE, &error))
- {
- dbus_g_method_return_error (context, error);
- g_error_free (error);
- return;
- }
-
- tp_svc_connection_return_from_hold_handles (context);
-}
-
-static void
tp_base_connection_inspect_handles (TpSvcConnection *iface,
guint handle_type,
const GArray *handles,
@@ -2143,362 +1900,6 @@ tp_base_connection_inspect_handles (TpSvcConnection *iface,
g_free (ret);
}
-/*
- * list_channel_factory_foreach_one:
- * @chan: a channel
- * @data: a GPtrArray in which channel information should be stored
- *
- * Called by the exported ListChannels function for each channel in a channel
- * factory, this should add to the GPtrArray (in the data pointer) a
- * GValueArray containing the following:
- * a D-Bus object path for the channel object on this service
- * a D-Bus interface name representing the channel type
- * an integer representing the handle type this channel communicates with,
- * or zero
- * an integer handle representing the contact, room or list this channel
- * communicates with, or zero
- */
-static void
-list_channel_factory_foreach_one (TpChannelIface *chan,
- gpointer data)
-{
- GObject *channel = G_OBJECT (chan);
- GPtrArray *values = (GPtrArray *) data;
- gchar *path, *type;
- guint handle_type, handle;
- GValue *entry = tp_dbus_specialized_value_slice_new
- (TP_STRUCT_TYPE_CHANNEL_INFO);
-
- g_object_get (channel,
- "object-path", &path,
- "channel-type", &type,
- "handle-type", &handle_type,
- "handle", &handle,
- NULL);
-
- dbus_g_type_struct_set (entry,
- 0, path,
- 1, type,
- 2, handle_type,
- 3, handle,
- G_MAXUINT);
-
- g_ptr_array_add (values, entry);
-
- g_free (path);
- g_free (type);
-}
-
-
-/*
- * list_channel_manager_foreach_one:
- * @chan: a channel
- * @data: a GPtrArray in which channel information should be stored
- *
- * Called by the exported ListChannels function for each channel in a channel
- * manager, this should add to the GPtrArray (in the data pointer) a
- * GValueArray containing the following:
- * a D-Bus object path for the channel object on this service
- * a D-Bus interface name representing the channel type
- * an integer representing the handle type this channel communicates with,
- * or zero
- * an integer handle representing the contact, room or list this channel
- * communicates with, or zero
- */
-static void
-list_channel_manager_foreach_one (TpExportableChannel *channel,
- gpointer data)
-{
- GPtrArray *values = (GPtrArray *) data;
- gchar *path, *type;
- guint handle_type, handle;
- GValue *entry = tp_dbus_specialized_value_slice_new
- (TP_STRUCT_TYPE_CHANNEL_INFO);
-
- g_assert (TP_IS_EXPORTABLE_CHANNEL (channel));
-
- exportable_channel_get_old_info (channel, &path, &type, &handle_type,
- &handle);
-
- dbus_g_type_struct_set (entry,
- 0, path,
- 1, type,
- 2, handle_type,
- 3, handle,
- G_MAXUINT);
-
- g_ptr_array_add (values, entry);
-
- g_free (path);
- g_free (type);
-}
-
-
-static void
-tp_base_connection_list_channels (TpSvcConnection *iface,
- DBusGMethodInvocation *context)
-{
- TpBaseConnection *self = TP_BASE_CONNECTION (iface);
- TpBaseConnectionPrivate *priv;
- GPtrArray *channels, *values;
- guint i;
-
- g_assert (TP_IS_BASE_CONNECTION (self));
-
- priv = self->priv;
-
- TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context);
-
- /* I think on average, each factory will have 2 channels :D */
- values = g_ptr_array_sized_new (priv->channel_factories->len * 2
- + priv->channel_managers->len * 2);
-
- for (i = 0; i < priv->channel_factories->len; i++)
- {
- TpChannelFactoryIface *factory = g_ptr_array_index
- (priv->channel_factories, i);
-
- tp_channel_factory_iface_foreach (factory,
- list_channel_factory_foreach_one, values);
- }
-
- for (i = 0; i < priv->channel_managers->len; i++)
- {
- TpChannelManager *manager = g_ptr_array_index
- (priv->channel_managers, i);
-
- tp_channel_manager_foreach_channel (manager,
- list_channel_manager_foreach_one, values);
- }
-
- channels = g_ptr_array_sized_new (values->len);
-
- for (i = 0; i < values->len; i++)
- {
- g_ptr_array_add (channels, g_value_get_boxed (g_ptr_array_index
- (values, i)));
- }
-
- tp_svc_connection_return_from_list_channels (context, channels);
-
- g_ptr_array_unref (channels);
- for (i = 0; i < values->len; i++)
- {
- tp_g_value_slice_free (g_ptr_array_index (values, i));
- }
- g_ptr_array_unref (values);
-}
-
-static void
-tp_base_connection_request_channel (TpSvcConnection *iface,
- const gchar *type,
- guint handle_type,
- guint handle,
- gboolean suppress_handler,
- DBusGMethodInvocation *context)
-{
- TpBaseConnection *self = TP_BASE_CONNECTION (iface);
- TpBaseConnectionPrivate *priv;
- TpChannelFactoryRequestStatus status =
- TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED;
- GError *error = NULL;
- guint i;
- ChannelRequest *request;
- GHashTable *request_properties;
- gboolean claimed_by_channel_manager = FALSE;
- TpHandleRepoIface *handle_repo = NULL;
-
- g_assert (TP_IS_BASE_CONNECTION (self));
-
- priv = self->priv;
-
- TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context);
-
- if (handle_type == TP_HANDLE_TYPE_NONE)
- {
- if (handle != 0)
- {
- GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
- "When handle type is NONE, handle must be 0" };
-
- dbus_g_method_return_error (context, &e);
- return;
- }
- }
- else
- {
- handle_repo = tp_base_connection_get_handles (self,
- handle_type);
-
- if (handle_repo == NULL)
- {
- GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
- "Handle type not supported by this connection manager" };
-
- dbus_g_method_return_error (context, &e);
- return;
- }
-
- if (!tp_handle_is_valid (handle_repo, handle, &error))
- {
- dbus_g_method_return_error (context, error);
- g_error_free (error);
- return;
- }
- }
-
- request = channel_request_new (context, METHOD_REQUEST_CHANNEL,
- type, handle_type, handle, suppress_handler);
- g_ptr_array_add (priv->channel_requests, request);
-
- /* First try the channel managers */
-
- request_properties = tp_asv_new (
- TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, type,
- TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type,
- NULL);
-
- if (handle != 0)
- {
- tp_asv_set_uint32 (request_properties,
- TP_PROP_CHANNEL_TARGET_HANDLE, handle);
- g_assert (handle_repo != NULL);
- tp_asv_set_string (request_properties,
- TP_PROP_CHANNEL_TARGET_ID,
- tp_handle_inspect (handle_repo, handle));
- }
-
- for (i = 0; i < priv->channel_managers->len; i++)
- {
- TpChannelManager *manager = TP_CHANNEL_MANAGER (
- g_ptr_array_index (priv->channel_managers, i));
-
- if (tp_channel_manager_request_channel (manager, request,
- request_properties))
- {
- claimed_by_channel_manager = TRUE;
- break;
- }
- }
-
- g_hash_table_unref (request_properties);
-
- if (claimed_by_channel_manager)
- return;
-
- /* OK, none of them wanted it. Now try the channel factories */
-
- for (i = 0; i < priv->channel_factories->len; i++)
- {
- TpChannelFactoryIface *factory = g_ptr_array_index
- (priv->channel_factories, i);
- TpChannelFactoryRequestStatus cur_status;
- TpChannelIface *chan = NULL;
-
- cur_status = tp_channel_factory_iface_request (factory, type,
- (TpHandleType) handle_type, handle, request, &chan, &error);
-
- switch (cur_status)
- {
- case TP_CHANNEL_FACTORY_REQUEST_STATUS_EXISTING:
- {
- g_assert (NULL != chan);
- factory_satisfy_requests (self, factory, chan, request, FALSE);
- /* factory_satisfy_requests should remove the request */
- g_assert (!tp_g_ptr_array_contains (priv->channel_requests,
- request));
- return;
- }
- case TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED:
- g_assert (NULL != chan);
- /* the signal handler should have completed the queued request
- * and freed the ChannelRequest already */
- g_assert (!tp_g_ptr_array_contains (priv->channel_requests,
- request));
- return;
- case TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED:
- DEBUG ("queued request, channel_type=%s, handle_type=%u, "
- "handle=%u, suppress_handler=%u", type, handle_type,
- handle, suppress_handler);
- return;
- case TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR:
- /* pass through error */
- goto ERROR;
- default:
- /* always return the most specific error */
- if (cur_status > status)
- status = cur_status;
- }
- }
-
- switch (status)
- {
- case TP_CHANNEL_FACTORY_REQUEST_STATUS_INVALID_HANDLE:
- DEBUG ("invalid handle %u", handle);
-
- error = g_error_new (TP_ERRORS, TP_ERROR_INVALID_HANDLE,
- "invalid handle %u", handle);
-
- break;
-
- case TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_AVAILABLE:
- DEBUG ("requested channel is unavailable with "
- "handle type %u", handle_type);
-
- error = g_error_new (TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
- "requested channel is not available with "
- "handle type %u", handle_type);
-
- break;
-
- case TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED:
- DEBUG ("unsupported channel type %s", type);
-
- error = g_error_new (TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
- "unsupported channel type %s", type);
-
- break;
-
- default:
- g_assert_not_reached ();
- }
-
-ERROR:
- g_assert (error != NULL);
- dbus_g_method_return_error (request->context, error);
- request->context = NULL;
- g_error_free (error);
-
- g_ptr_array_remove (priv->channel_requests, request);
- channel_request_free (request);
-}
-
-static void
-tp_base_connection_release_handles (TpSvcConnection *iface,
- guint handle_type,
- const GArray * handles,
- DBusGMethodInvocation *context)
-{
- TpBaseConnection *self = TP_BASE_CONNECTION (iface);
- TpBaseConnectionPrivate *priv = self->priv;
- GError *error = NULL;
-
- g_assert (TP_IS_BASE_CONNECTION (self));
-
- TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context);
-
- if (!tp_handles_supported_and_valid (priv->handles,
- handle_type, handles, FALSE, &error))
- {
- dbus_g_method_return_error (context, error);
- g_error_free (error);
- return;
- }
-
- tp_svc_connection_return_from_release_handles (context);
-}
-
-
/**
* tp_base_connection_dbus_request_handles: (skip)
* @iface: A pointer to #TpBaseConnection, cast to a pointer to
@@ -2508,7 +1909,7 @@ tp_base_connection_release_handles (TpSvcConnection *iface,
* @context: The dbus-glib method invocation context
*
* Implements D-Bus method RequestHandles on interface
- * org.freedesktop.Telepathy.Connection. Exported so subclasses can
+ * im.telepathy1.Connection. Exported so subclasses can
* use it as a basis for their own implementations (for instance,
* at the time of writing Gabble's GabbleConnection does its own processing
* for room handles, in order to validate them asynchronously, but delegates
@@ -3299,15 +2700,7 @@ conn_iface_init (gpointer g_iface, gpointer iface_data)
tp_base_connection_##prefix##x)
IMPLEMENT(,connect);
IMPLEMENT(,disconnect);
- IMPLEMENT(dbus_,get_interfaces);
- IMPLEMENT(,get_protocol);
- IMPLEMENT(dbus_,get_self_handle);
- IMPLEMENT(dbus_,get_status);
- IMPLEMENT(,hold_handles);
IMPLEMENT(,inspect_handles);
- IMPLEMENT(,list_channels);
- IMPLEMENT(,request_channel);
- IMPLEMENT(,release_handles);
IMPLEMENT(dbus_,request_handles);
IMPLEMENT(dbus_,add_client_interest);
IMPLEMENT(dbus_,remove_client_interest);
@@ -3584,19 +2977,16 @@ conn_requests_offer_request (TpBaseConnection *self,
TpBaseConnectionPrivate *priv = self->priv;
TpChannelManagerRequestFunc func;
ChannelRequest *request;
- gboolean suppress_handler;
guint i;
switch (method)
{
case METHOD_CREATE_CHANNEL:
func = tp_channel_manager_create_channel;
- suppress_handler = TRUE;
break;
case METHOD_ENSURE_CHANNEL:
func = tp_channel_manager_ensure_channel;
- suppress_handler = FALSE;
break;
default:
@@ -3604,7 +2994,7 @@ conn_requests_offer_request (TpBaseConnection *self,
}
request = channel_request_new (context, method,
- type, target_handle_type, target_handle, suppress_handler);
+ type, target_handle_type, target_handle);
g_ptr_array_add (priv->channel_requests, request);
for (i = 0; i < priv->channel_managers->len; i++)
diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am
index b268aece5..d361dfefc 100644
--- a/tests/dbus/Makefile.am
+++ b/tests/dbus/Makefile.am
@@ -23,7 +23,6 @@ tests_list = \
test-connection-error \
test-connection-handles \
test-connection-interests \
- test-connection-getinterfaces-failure \
test-contact-lists \
test-contact-list-client \
test-contacts \
@@ -149,9 +148,6 @@ test_connection_error_SOURCES = connection-error.c
test_connection_interests_SOURCES = connection-interests.c
-test_connection_getinterfaces_failure_SOURCES = \
- connection-getinterfaces-failure.c
-
test_contacts_SOURCES = contacts.c
test_contacts_bug_19101_SOURCES = contacts-bug-19101.c
diff --git a/tests/dbus/connection-getinterfaces-failure.c b/tests/dbus/connection-getinterfaces-failure.c
deleted file mode 100644
index a4d39bc1e..000000000
--- a/tests/dbus/connection-getinterfaces-failure.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=15306
- *
- * Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
- * Copyright (C) 2007-2008 Nokia Corporation
- *
- * Copying and distribution of this file, with or without modification,
- * are permitted in any medium without royalty provided the copyright
- * notice and this notice are preserved.
- */
-
-#include <telepathy-glib/connection.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/debug.h>
-#include <telepathy-glib/interfaces.h>
-
-#include "tests/lib/myassert.h"
-#include "tests/lib/contacts-conn.h"
-#include "tests/lib/util.h"
-
-static GType bug15306_connection_get_type (void);
-
-typedef TpTestsContactsConnection Bug15306Connection;
-typedef TpTestsContactsConnectionClass Bug15306ConnectionClass;
-
-static void bug15306_conn_iface_init (gpointer, gpointer);
-
-G_DEFINE_TYPE_WITH_CODE (Bug15306Connection,
- bug15306_connection,
- TP_TESTS_TYPE_CONTACTS_CONNECTION,
- G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, bug15306_conn_iface_init))
-
-static void
-bug15306_connection_init (Bug15306Connection *self)
-{
-}
-
-static void
-bug15306_connection_class_init (Bug15306ConnectionClass *klass)
-{
-}
-
-static void
-bug15306_get_interfaces (TpSvcConnection *iface,
- DBusGMethodInvocation *context)
-{
- GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "testing fd.o #15306" };
-
- dbus_g_method_return_error (context, &e);
-}
-
-static void
-bug15306_conn_iface_init (gpointer g_iface,
- gpointer iface_data)
-{
- TpSvcConnectionClass *klass = g_iface;
-
-#define IMPLEMENT(x) tp_svc_connection_implement_##x (klass, \
- bug15306_##x)
- IMPLEMENT (get_interfaces);
-#undef IMPLEMENT
-}
-
-static GMainLoop *mainloop;
-
-static void
-on_status_changed (TpConnection *connection,
- guint status,
- guint reason,
- gpointer user_data,
- GObject *weak_object)
-{
- MYASSERT (status == TP_CONNECTION_STATUS_DISCONNECTED, "%u", status);
-}
-
-static void
-on_shutdown_finished (TpBaseConnection *base_conn,
- gpointer user_data)
-{
- g_main_loop_quit (mainloop);
-}
-
-int
-main (int argc,
- char **argv)
-{
- TpTestsSimpleConnection *service_conn;
- TpBaseConnection *service_conn_as_base;
- TpDBusDaemon *dbus;
- TpConnection *conn;
- GError *error = NULL;
- gchar *name;
- gchar *conn_path;
-
- tp_tests_abort_after (10);
- g_type_init ();
- tp_debug_set_flags ("all");
- mainloop = g_main_loop_new (NULL, FALSE);
- dbus = tp_tests_dbus_daemon_dup_or_die ();
-
- service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class (
- bug15306_connection_get_type (),
- "account", "me@example.com",
- "protocol", "simple",
- NULL));
- service_conn_as_base = TP_BASE_CONNECTION (service_conn);
- MYASSERT (service_conn != NULL, "");
- MYASSERT (service_conn_as_base != NULL, "");
-
- g_signal_connect (service_conn, "shutdown-finished",
- G_CALLBACK (on_shutdown_finished), NULL);
-
- MYASSERT (tp_base_connection_register (service_conn_as_base, "simple",
- &name, &conn_path, &error), "");
- g_assert_no_error (error);
-
- conn = tp_connection_new (dbus, name, conn_path, &error);
- MYASSERT (conn != NULL, "");
- g_assert_no_error (error);
-
- MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL),
- "");
- g_assert_no_error (error);
-
- /* disconnect the service_conn */
- MYASSERT (tp_cli_connection_connect_to_status_changed (conn,
- on_status_changed, NULL, NULL, NULL, NULL), "");
- tp_tests_simple_connection_inject_disconnect (service_conn);
- g_main_loop_run (mainloop);
-
- g_object_unref (conn);
-
- service_conn_as_base = NULL;
- g_object_unref (service_conn);
- g_object_unref (dbus);
- g_main_loop_unref (mainloop);
- g_free (name);
- g_free (conn_path);
-
- return 0;
-}
diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c
index 695b85dd5..6dabcdd90 100644
--- a/tests/dbus/contacts.c
+++ b/tests/dbus/contacts.c
@@ -832,7 +832,7 @@ make_the_connection_disappear (Fixture *f)
tp_base_connection_get_dbus_daemon (f->base_connection),
f->base_connection);
/* check that that worked */
- ok = tp_cli_connection_run_get_self_handle (f->client_conn, -1, NULL,
+ ok = tp_cli_connection_run_connect (f->client_conn, -1,
&error, NULL);
g_assert_error (error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD);
g_assert (!ok);
@@ -852,7 +852,7 @@ put_the_connection_back (Fixture *f)
tp_base_connection_get_dbus_daemon (f->base_connection),
f->base_connection->object_path, f->base_connection);
/* check that *that* worked */
- ok = tp_cli_connection_run_get_self_handle (f->client_conn, -1, NULL,
+ ok = tp_cli_connection_run_connect (f->client_conn, -1,
&error, NULL);
g_assert_no_error (error);
g_assert (ok);