summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-04-27 10:33:56 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-04-27 11:28:31 +0100
commit9fdee928e7ddc60991f659db321f1e2b258752e0 (patch)
tree159f110bdeddd50148bdd24bec39750eceffcad3
parentea6eaf850fc3c77b7e944f3556300bec9eadf9c3 (diff)
caps-manager, status: don't bother checking for caps prefixes
This was really confusing and wrong tbh. Just leave the namespace in everywhere. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--salut/caps-manager.c2
-rw-r--r--salut/status.c10
-rw-r--r--salut/utils.h1
-rw-r--r--tests/twisted/salut/status.py6
-rw-r--r--tests/twisted/yconstants.py2
5 files changed, 6 insertions, 15 deletions
diff --git a/salut/caps-manager.c b/salut/caps-manager.c
index c2ece5a..09b32a8 100644
--- a/salut/caps-manager.c
+++ b/salut/caps-manager.c
@@ -193,7 +193,7 @@ ytst_caps_manager_represent_client (GabbleCapsChannelManager *manager,
if (g_str_has_prefix (*t, INTERESTED))
{
cap = *t + strlen (INTERESTED);
- feature = g_strdup_printf ("%s%s+notify", CAPS_FEATURE_PREFIX, cap);
+ feature = g_strdup_printf ("%s+notify", cap);
gabble_capability_set_add (cap_set, feature);
g_free (feature);
}
diff --git a/salut/status.c b/salut/status.c
index ace7635..ceca3f3 100644
--- a/salut/status.c
+++ b/salut/status.c
@@ -264,9 +264,6 @@ pep_event_cb (WockyPorter *porter,
if (items == NULL || tp_strdiff (items->name, "items"))
return TRUE;
- if (!g_str_has_prefix (wocky_node_get_ns (items), CAPS_FEATURE_PREFIX))
- return FALSE;
-
item = wocky_node_get_first_child (items);
if (item == NULL || tp_strdiff (item->name, "item"))
return FALSE;
@@ -278,7 +275,7 @@ pep_event_cb (WockyPorter *porter,
/* looks good */
from = wocky_stanza_get_from (stanza);
- capability = wocky_node_get_ns (items) + strlen (CAPS_FEATURE_PREFIX);
+ capability = wocky_node_get_ns (items);
service_name = wocky_node_get_attribute (status, "from-service");
if (wocky_node_get_attribute (status, "activity") != NULL)
@@ -670,7 +667,6 @@ ytst_status_advertise_status (TpYtsSvcStatus *svc,
WockyNodeTree *status_tree = NULL;
GError *error = NULL;
WockyStanza *stanza;
- gchar *node;
WockyNode *item, *status_node;
if (tp_str_empty (capability))
@@ -705,10 +701,8 @@ ytst_status_advertise_status (TpYtsSvcStatus *svc,
wocky_node_set_attribute (status_node, "capability",
capability);
- node = g_strdup_printf (CAPS_FEATURE_PREFIX "%s", capability);
- stanza = wocky_pubsub_make_event_stanza (node,
+ stanza = wocky_pubsub_make_event_stanza (capability,
salut_connection_get_name (priv->connection), &item);
- g_free (node);
wocky_node_add_node_tree (item, status_tree);
g_object_unref (status_tree);
diff --git a/salut/utils.h b/salut/utils.h
index 52e0648..e73ca8e 100644
--- a/salut/utils.h
+++ b/salut/utils.h
@@ -44,7 +44,6 @@ typedef enum {
YTST_MESSAGE_ERROR_ITEM_NOT_FOUND,
} YtstMessageError;
-#define CAPS_FEATURE_PREFIX YTST_CAPABILITIES_NS ":"
#define SERVICE_PREFIX YTST_CAPABILITIES_NS "#"
gint ytst_message_error_type_to_wocky (guint ytstenut_type);
diff --git a/tests/twisted/salut/status.py b/tests/twisted/salut/status.py
index 521a55b..895d76a 100644
--- a/tests/twisted/salut/status.py
+++ b/tests/twisted/salut/status.py
@@ -34,7 +34,7 @@ from avahitest import AvahiAnnouncer, AvahiListener
from avahitest import get_host_name
from xmppstream import setup_stream_listener, connect_to_stream
-CAP_NAME = 'h264-over-ants'
+CAP_NAME = 'urn:ytstenut:capabilities:h264-over-ants'
CLIENT_NAME = 'fake-client'
def test(q, bus, conn):
@@ -68,7 +68,7 @@ def test(q, bus, conn):
# immediately.
# announce a contact with the right caps
- ver = compute_caps_hash([], [ycs.CAPABILITIES_PREFIX + CAP_NAME + '+notify'], {})
+ ver = compute_caps_hash([], [CAP_NAME + '+notify'], {})
txt_record = { "txtvers": "1", "status": "avail",
"node": CLIENT_NAME, "ver": ver, "hash": "sha-1"}
contact_name = "test-status@" + get_host_name()
@@ -96,7 +96,7 @@ def test(q, bus, conn):
query['node'] = CLIENT_NAME + '#' + ver
feature = query.addElement('feature')
- feature['var'] = ycs.CAPABILITIES_PREFIX + CAP_NAME + '+notify'
+ feature['var'] = CAP_NAME + '+notify'
incoming.send(result)
# this will be fired as text channel caps will be fired
diff --git a/tests/twisted/yconstants.py b/tests/twisted/yconstants.py
index b21b7a7..9184d86 100644
--- a/tests/twisted/yconstants.py
+++ b/tests/twisted/yconstants.py
@@ -23,5 +23,3 @@ ERROR_TYPE_WAIT = 5
MESSAGE_NS = 'urn:ytstenut:message'
STATUS_NS = 'urn:ytstenut:status'
-
-CAPABILITIES_PREFIX = 'urn:ytstenut:capabilities:'