summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-09-28 15:07:02 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-09-28 16:24:29 +0100
commitf670d0082e850835b93405eac32da24d94496975 (patch)
treee9239101ee70140748f980886f088e43f946df34
parent55b092e583fd16ac18440c989bfc603176dbd610 (diff)
Revert "connection: deal with not being able to hash self presence"
-rw-r--r--src/conn-presence.c13
-rw-r--r--src/connection.c31
-rw-r--r--src/connection.h2
3 files changed, 10 insertions, 36 deletions
diff --git a/src/conn-presence.c b/src/conn-presence.c
index 255ef4fa..95552c01 100644
--- a/src/conn-presence.c
+++ b/src/conn-presence.c
@@ -1605,16 +1605,9 @@ conn_presence_signal_own_presence (GabbleConnection *self,
* <show>away</show>? */
}
- if (!gabble_connection_fill_in_caps (self, message))
- {
- g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
- "Unable to fill in caps on presence stanza");
- ret = FALSE;
- }
- else
- {
- ret = _gabble_connection_send (self, message, error);
- }
+ gabble_connection_fill_in_caps (self, message);
+
+ ret = _gabble_connection_send (self, message, error);
lm_message_unref (message);
diff --git a/src/connection.c b/src/connection.c
index 7b638030..43b4efc5 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -2300,7 +2300,7 @@ connection_shut_down (TpBaseConnection *base)
tp_base_connection_finish_shutdown (base);
}
-gboolean
+void
gabble_connection_fill_in_caps (GabbleConnection *self,
LmMessage *presence_message)
{
@@ -2308,13 +2308,10 @@ gabble_connection_fill_in_caps (GabbleConnection *self,
LmMessageNode *node = lm_message_get_node (presence_message);
gchar *caps_hash;
gboolean share_v1, voice_v1, video_v1;
- GString *ext;
+ GString *ext = g_string_new ("");
/* XEP-0115 version 1.5 uses a verification string in the 'ver' attribute */
caps_hash = caps_hash_compute_from_self_presence (self);
- if (caps_hash == NULL)
- return FALSE;
-
node = lm_message_node_add_child (node, "c", NULL);
lm_message_node_set_attributes (
node,
@@ -2332,7 +2329,6 @@ gabble_connection_fill_in_caps (GabbleConnection *self,
/* XEP-0115 deprecates 'ext' feature bundles. But we still need
* BUNDLE_VOICE_V1 it for backward-compatibility with Gabble 0.2 */
- ext = g_string_new ("");
g_string_append (ext, BUNDLE_PMUC_V1);
share_v1 = gabble_presence_has_cap (presence, NS_GOOGLE_FEAT_SHARE);
@@ -2351,8 +2347,6 @@ gabble_connection_fill_in_caps (GabbleConnection *self,
lm_message_node_set_attribute (node, "ext", ext->str);
g_string_free (ext, TRUE);
g_free (caps_hash);
-
- return TRUE;
}
gboolean
@@ -2380,16 +2374,9 @@ gabble_connection_send_capabilities (GabbleConnection *self,
message = lm_message_new_with_sub_type (recipient, LM_MESSAGE_TYPE_PRESENCE,
LM_MESSAGE_SUB_TYPE_AVAILABLE);
- if (!gabble_connection_fill_in_caps (self, message))
- {
- g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
- "Unable to fill in caps on presence stanza");
- ret = FALSE;
- }
- else
- {
- ret = _gabble_connection_send (self, message, error);
- }
+ gabble_connection_fill_in_caps (self, message);
+
+ ret = _gabble_connection_send (self, message, error);
lm_message_unref (message);
@@ -2407,13 +2394,7 @@ gabble_connection_request_decloak (GabbleConnection *self,
LmMessageNode *decloak;
gboolean ret;
- if (!gabble_connection_fill_in_caps (self, message))
- {
- g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
- "Unable to fill in caps on presence stanza");
- lm_message_unref (message);
- return FALSE;
- }
+ gabble_connection_fill_in_caps (self, message);
decloak = lm_message_node_add_child (lm_message_get_node (message),
"temppres", NULL);
diff --git a/src/connection.h b/src/connection.h
index f05be2d6..875d71e4 100644
--- a/src/connection.h
+++ b/src/connection.h
@@ -235,7 +235,7 @@ gboolean gabble_connection_send_capabilities (GabbleConnection *self,
gboolean gabble_connection_request_decloak (GabbleConnection *self,
const gchar *to, const gchar *reason, GError **error);
-gboolean gabble_connection_fill_in_caps (GabbleConnection *self,
+void gabble_connection_fill_in_caps (GabbleConnection *self,
LmMessage *presence_message);
gboolean _gabble_connection_invisible_privacy_list_set_active (