[telepathy-gabble/master] GabbleJingleFactory: allow bare JIDs to call us
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Jan 5 11:03:24 PST 2010
Represent them by resource = ""; adjust a debug message to be less
confusing in the presence of potentially-empty resources.
---
src/jingle-factory.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/jingle-factory.c b/src/jingle-factory.c
index b6507d1..6ed6f4a 100644
--- a/src/jingle-factory.c
+++ b/src/jingle-factory.c
@@ -737,12 +737,13 @@ ensure_session (GabbleJingleFactory *self,
if (resource == NULL || *resource == '\0')
{
- g_set_error (error, GABBLE_XMPP_ERROR,
- XMPP_ERROR_BAD_REQUEST, "IQ sender '%s' has no resource", from);
- return NULL;
+ /* if we're called by a SIP gateway, it might be using a bare JID */
+ resource = "";
+ }
+ else
+ {
+ resource++;
}
-
- resource++;
peer = tp_handle_ensure (contact_repo, from, NULL, error);
@@ -881,7 +882,7 @@ create_session (GabbleJingleFactory *fac,
/* Takes ownership of key */
g_hash_table_insert (priv->sessions, key, sess);
- DEBUG ("new session (%u, %s, %s) @ %p", peer, peer_resource, sid_, sess);
+ DEBUG ("new session (%u, '%s', %s) @ %p", peer, peer_resource, sid_, sess);
g_free (sid_);
--
1.5.6.5
More information about the telepathy-commits
mailing list