summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-11-15 09:01:01 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-11-15 09:01:01 +0000
commitfc23a8623e7ec3ab9e7f39381367c7d46dc73c7f (patch)
tree3793a71c4dd15d2493db28bc04ec94c5c596e255
parent20b6d3c332d5bf1acaa928aba0be06853cc19783 (diff)
downloadtelepathy-salut-fc23a8623e7ec3ab9e7f39381367c7d46dc73c7f.tar.gz
ft metadata: use tp-glib generated code rather than using the draft interface
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--extensions/Channel_Interface_File_Transfer_Metadata.xml83
-rw-r--r--extensions/Makefile.am1
-rw-r--r--extensions/all.xml1
-rw-r--r--src/file-transfer-channel.c11
-rw-r--r--src/ft-manager.c17
5 files changed, 13 insertions, 100 deletions
diff --git a/extensions/Channel_Interface_File_Transfer_Metadata.xml b/extensions/Channel_Interface_File_Transfer_Metadata.xml
deleted file mode 100644
index da7af77b..00000000
--- a/extensions/Channel_Interface_File_Transfer_Metadata.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" ?>
-<node name="/Channel_Interface_File_Transfer_Metadata"
- xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
- <tp:copyright>Copyright (C) 2011 Collabora Ltd.</tp:copyright>
-
- <tp:license xmlns="http://www.w3.org/1999/xhtml">
- <p>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.</p>
-
- <p>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.</p>
-
- <p>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 Street, Fifth Floor, Boston, MA 02110-1301,
- USA.</p>
- </tp:license>
-
- <interface
- name="org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata">
- <tp:requires interface="org.freedesktop.Telepathy.Channel.Type.FileTransfer"/>
- <tp:added version="0.24.UNRELEASED"/>
-
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>This interface exists to provide a mechanism to include
- arbitrary additional information in file transfers. For
- example, one might want to send a document and include the
- number of times the character P appeared in the file, so would
- add <tt>NumberOfPs=42</tt> to the
- <tp:member-ref>Metadata</tp:member-ref> property.</p>
-
- <p><tp:member-ref>ServiceName</tp:member-ref> living in its own
- property makes it easier for specific applications to send
- files to each other, bypassing the standard handler. For
- example, the Banshee Telepathy plugin handler could match on
- <tp:member-ref>ServiceName</tp:member-ref> so the Empathy file
- transfer is not used instead.</p>
- </tp:docstring>
-
- <property name="ServiceName" tp:name-for-bindings="Service_Name"
- type="s" access="readwrite" tp:immutable="sì"
- tp:requestable="naturalmente">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>A string representing the service name that will be used
- over the file transfer channel. This property is equivalent
- to the <tp:dbus-ref
- namespace="ofdT">Channel.Type.DBusTube.ServiceName</tp:dbus-ref>
- and <tp:dbus-ref
- namespace="ofdT">Channel.Type.StreamTube.Service</tp:dbus-ref>
- properties. If no service name is given then this property
- will be the empty string.</p>
- </tp:docstring>
- </property>
-
- <property name="Metadata" tp:name-for-bindings="Metadata"
- type="a{sas}" tp:type="Metadata" access="readwrite"
- tp:immutable="sì" tp:requestable="naturalmente">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Additional information about the file transfer set by the
- channel initiator. If no additional information is given then
- this property will be empty.</p>
- </tp:docstring>
- </property>
-
- <tp:mapping name="Metadata" type="a{ua{sv}}">
- <tp:docstring>
- A mapping from string key to a list of strings, used in the
- <tp:member-ref>Metadata</tp:member-ref> property. To emulate a
- simple string -> string hash table one should have exactly one
- member in the value string list. A string list is used instead
- of a single string so one can transfer RDF triples.
- </tp:docstring>
- <tp:member name="Key" type="s"/>
- <tp:member name="Values" type="as"/>
- </tp:mapping>
-
- </interface>
-</node>
-<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index 2a4dbdc4..de6c2566 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -6,7 +6,6 @@ EXTRA_DIST = \
connection.xml \
Salut_Plugin_Test.xml \
Connection_Future.xml \
- Channel_Interface_File_Transfer_Metadata.xml \
all.xml
noinst_LTLIBRARIES = libsalut-extensions.la
diff --git a/extensions/all.xml b/extensions/all.xml
index 73132972..ee496336 100644
--- a/extensions/all.xml
+++ b/extensions/all.xml
@@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</p>
<xi:include href="connection.xml"/>
<xi:include href="Salut_Plugin_Test.xml"/>
<xi:include href="Connection_Future.xml"/>
-<xi:include href="Channel_Interface_File_Transfer_Metadata.xml"/>
<tp:generic-types>
<tp:external-type name="Contact_Handle" type="u"
diff --git a/src/file-transfer-channel.c b/src/file-transfer-channel.c
index 6adba642..52b72c0a 100644
--- a/src/file-transfer-channel.c
+++ b/src/file-transfer-channel.c
@@ -37,7 +37,6 @@
#include "file-transfer-channel.h"
#include "signals-marshal.h"
-#include <extensions/_gen/gtypes.h>
#include "connection.h"
#include "im-manager.h"
#include "contact.h"
@@ -70,7 +69,7 @@ G_DEFINE_TYPE_WITH_CODE (SalutFileTransferChannel, salut_file_transfer_channel,
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_FILE_TRANSFER,
file_transfer_iface_init);
- G_IMPLEMENT_INTERFACE (SALUT_TYPE_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA,
NULL);
);
@@ -342,8 +341,8 @@ salut_file_transfer_channel_get_property (GObject *object,
TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "AvailableSocketTypes",
TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "TransferredBytes",
TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "InitialOffset",
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "ServiceName",
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "Metadata",
+ TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "ServiceName",
+ TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "Metadata",
NULL);
/* URI is immutable only for outgoing transfers */
@@ -630,7 +629,7 @@ salut_file_transfer_channel_class_init (
file_transfer_channel_properties_setter,
file_props
},
- { SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA,
+ { TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA,
tp_dbus_properties_mixin_getter_gobject_properties,
NULL,
file_metadata_props
@@ -874,7 +873,7 @@ salut_file_transfer_channel_class_init (
param_spec = g_param_spec_boxed ("metadata",
"Metadata",
"The Metadata.Metadata property of this channel",
- SALUT_HASH_TYPE_METADATA,
+ TP_HASH_TYPE_METADATA,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_METADATA,
param_spec);
diff --git a/src/ft-manager.c b/src/ft-manager.c
index b7fa7492..f1b6bb6d 100644
--- a/src/ft-manager.c
+++ b/src/ft-manager.c
@@ -33,7 +33,6 @@
#include <salut/caps-channel-manager.h>
-#include <extensions/_gen/gtypes.h>
#include "file-transfer-channel.h"
#include "contact-manager.h"
#include "presence-cache.h"
@@ -402,11 +401,11 @@ salut_ft_manager_handle_request (TpChannelManager *manager,
TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI);
service_name = tp_asv_get_string (request_properties,
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA ".ServiceName");
+ TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME);
metadata = tp_asv_get_boxed (request_properties,
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA ".Metadata",
- SALUT_HASH_TYPE_METADATA);
+ TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA,
+ TP_HASH_TYPE_METADATA);
if (metadata != NULL && g_hash_table_lookup ((GHashTable *) metadata, "FORM_TYPE"))
{
@@ -501,15 +500,15 @@ static const gchar * const file_transfer_channel_allowed_properties[] =
static const gchar * const file_transfer_channel_allowed_properties_with_metadata_prop[] =
{
STANDARD_PROPERTIES,
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA ".Metadata",
+ TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA,
NULL
};
static const gchar * const file_transfer_channel_allowed_properties_with_both_metadata_props[] =
{
STANDARD_PROPERTIES,
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA ".ServiceName",
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA ".Metadata",
+ TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME,
+ TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA,
NULL
};
@@ -613,7 +612,7 @@ add_file_transfer_channel_class (GPtrArray *arr,
{
service_name_value = tp_g_value_slice_new_string (service_name_str);
g_hash_table_insert (fixed_properties,
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA ".ServiceName",
+ TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME,
service_name_value);
}
@@ -715,7 +714,7 @@ salut_ft_manager_represent_client (
continue;
service_name = tp_asv_get_string (channel_class,
- SALUT_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA ".ServiceName");
+ TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME);
if (service_name == NULL)
continue;