Hello community,
here is the log from the commit of package telepathy-gabble for openSUSE:Factory
checked in at Sat Sep 5 02:20:36 CEST 2009.
--------
--- GNOME/telepathy-gabble/telepathy-gabble.changes 2009-08-25 14:01:03.000000000 +0200
+++ telepathy-gabble/telepathy-gabble.changes 2009-09-04 14:11:29.000000000 +0200
@@ -1,0 +2,17 @@
+Fri Sep 4 14:01:03 CEST 2009 - vuntz@novell.com
+
+- Update to version 0.8.2:
+ + Enhancements:
+ - Improve jid validation, so that obviously-invalid jids are
+ rejected.
+ + Fixes:
+ - Don't crash when a vCard set fails, and there are edits
+ pending. This can happen if you're trying to set your avatar
+ and then disconnect.
+ - fdo#23013: ContactCapabilities.SetSelfCapabilities can crash
+ gabble with wrong parms
+ - Fix parsing of incoming session accept from Google Video
+ Chat. This should make outgoing calls to Google Video Chat
+ users work, as well as incoming calls.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
telepathy-gabble-0.8.1.tar.bz2
New:
----
telepathy-gabble-0.8.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ telepathy-gabble.spec ++++++
--- /var/tmp/diff_new_pack.xIFYTK/_old 2009-09-05 02:20:10.000000000 +0200
+++ /var/tmp/diff_new_pack.xIFYTK/_new 2009-09-05 02:20:10.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package telepathy-gabble (Version 0.8.1)
+# spec file for package telepathy-gabble (Version 0.8.2)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -18,7 +18,7 @@
Name: telepathy-gabble
-Version: 0.8.1
+Version: 0.8.2
Release: 1
License: LGPL v2.1 or later
Summary: XMPP connection manager for Telepathy
++++++ telepathy-gabble-0.8.1.tar.bz2 -> telepathy-gabble-0.8.2.tar.bz2 ++++++
++++ 1632 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/ChangeLog new/telepathy-gabble-0.8.2/ChangeLog
--- old/telepathy-gabble-0.8.1/ChangeLog 2009-08-20 21:44:20.000000000 +0200
+++ new/telepathy-gabble-0.8.2/ChangeLog 2009-09-03 20:03:45.000000000 +0200
@@ -1,3 +1,338 @@
+commit 1ef0491531bd3dc93959cce57541de0450da5ab1
+Author: Will Thompson
+Date: Thu Sep 3 19:03:03 2009 +0100
+
+ NEWS for 0.8.2
+
+ NEWS | 24 ++++++++++++++++++++++++
+ configure.ac | 2 +-
+ 2 files changed, 25 insertions(+), 1 deletions(-)
+
+commit 4148fea49bcc05853364cb6f690a4c8b6dc5866b
+Merge: 9ce93fa 16fb790
+Author: Will Thompson
+Date: Thu Sep 3 18:03:02 2009 +0100
+
+ Merge branch 'fix-google-video' into telepathy-gabble-0.8
+
+ Reviewed-by: Simon McVittie
+ Reviewed-by: Sjoerd Simons
+
+commit 9ce93faa9ca821fc03cbff5dc8e196251a6d1e3a
+Merge: 3f2c10b a78f562
+Author: Dafydd Harries
+Date: Wed Sep 2 22:51:04 2009 +0100
+
+ Merge branch 'jids' into telepathy-gabble-0.8
+
+ Reviewed-by: Will Thompson
+
+commit a78f562fa51bdbc7aeed523fd80e46f789fd2f37
+Author: Dafydd Harries
+Date: Wed Sep 2 22:46:52 2009 +0100
+
+ make gabble_encode_jid() warn and return NULL if domain is NULL
+
+ src/util.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+commit e6c7993df6000a891c3daf5ef8292ab5210a52ab
+Author: Dafydd Harries
+Date: Wed Aug 26 17:48:36 2009 +0100
+
+ add gabble_encode_jid() and replace ad-hoc string concatentation with calls to it
+
+ src/connection.c | 10 ++++------
+ src/util.c | 26 ++++++++++++++++++++++++--
+ src/util.h | 2 ++
+ 3 files changed, 30 insertions(+), 8 deletions(-)
+
+commit 6e540f316c13ceca54bd35cd67966a60d7e8125e
+Author: Dafydd Harries
+Date: Wed Aug 26 17:47:28 2009 +0100
+
+ improve comments and error messages
+
+ src/util.c | 14 +++++++++++---
+ 1 files changed, 11 insertions(+), 3 deletions(-)
+
+commit b0e7f813e796ebc4ce09d440490c5855271bc920
+Author: Dafydd Harries
+Date: Tue Aug 25 20:19:28 2009 +0100
+
+ gabble_jid_decode(): fix the case where there is a / before an @
+
+ src/util.c | 39 +++++++++++++++++++++++----------------
+ tests/test-jid-decode.c | 1 +
+ 2 files changed, 24 insertions(+), 16 deletions(-)
+
+commit e6acd5ccff3185275b1395228d0918131a7a88dd
+Author: Dafydd Harries
+Date: Tue Aug 25 19:30:50 2009 +0100
+
+ gabble_decode_jid(): check for invalid characters in node and domain
+
+ src/util.c | 34 +++++++++++++++++++++++++++++++++-
+ tests/test-jid-decode.c | 3 +++
+ 2 files changed, 36 insertions(+), 1 deletions(-)
+
+commit d7ab2037bf11d54817aab05c104178ab4438c24b
+Author: Dafydd Harries
+Date: Tue Aug 25 19:12:55 2009 +0100
+
+ tube-dbus.c: assert that resource part of our own JID is not NULL
+
+ src/tube-dbus.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+commit ba2703b26ea53440713e738d8430a147afe5be2f
+Author: Dafydd Harries
+Date: Tue Aug 25 19:11:58 2009 +0100
+
+ style tweaks
+
+ src/connection.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+commit d7bba4ccf868471d6cef91d9f31e4e95a0758325
+Author: Dafydd Harries
+Date: Tue Aug 25 19:11:11 2009 +0100
+
+ remove checks made redundant by gabble_decode_jid() changes
+
+ In particular, callers no longer need to check whether returned node and
+ resource strings are empty.
+
+ src/bytestream-factory.c | 4 ++--
+ src/connection.c | 5 ++---
+ src/util.c | 5 ++---
+ 3 files changed, 6 insertions(+), 8 deletions(-)
+
+commit 9f759bb06169a83fee3085b48d1631873b43c673
+Author: Dafydd Harries
+Date: Tue Aug 25 19:10:17 2009 +0100
+
+ gabble_decode_jid(): update documentation
+
+ src/util.c | 14 +++++---------
+ 1 files changed, 5 insertions(+), 9 deletions(-)
+
+commit 39cb819dca09c94d454951690113bb5cfec74fd5
+Author: Dafydd Harries
+Date: Tue Aug 25 18:42:13 2009 +0100
+
+ test-jid-decode: add test for case folding
+
+ tests/test-jid-decode.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+commit 8fb4b3c496e1b0c73d96d3e6aea115630819cb83
+Author: Dafydd Harries
+Date: Tue Aug 25 18:35:37 2009 +0100
+
+ test-jid-decode: factor out common code
+
+ tests/test-jid-decode.c | 92 +++++++++--------------------------------------
+ 1 files changed, 17 insertions(+), 75 deletions(-)
+
+commit a90bd4da5ba0b959eb6feb31cca096218fa93dc5
+Author: Dafydd Harries
+Date: Tue Aug 25 18:34:04 2009 +0100
+
+ test-jid-decode: rename server -> domain for consistency
+
+ tests/test-jid-decode.c | 48 +++++++++++++++++++++++-----------------------
+ 1 files changed, 24 insertions(+), 24 deletions(-)
+
+commit 0c1836c1d1e4a301b9d6992969a6433b3d641093
+Author: Dafydd Harries
+Date: Tue Aug 25 18:05:25 2009 +0100
+
+ gabble_decode_jid(): return FALSE if JID components are wrongly empty
+
+ The domain must always be non-empty. The node must not be empty if there is an
+ '@', and the resource must not be empty if there is a '/'.
+
+ src/util.c | 13 ++++++++++++-
+ tests/test-jid-decode.c | 38 ++++++++++++++++++++++++++++++++++++--
+ 2 files changed, 48 insertions(+), 3 deletions(-)
+
+commit ff79043aea2601f3f23a9440122d01817d0f1ea6
+Author: Dafydd Harries
+Date: Tue Aug 25 17:42:39 2009 +0100
+
+ make gabble_decode_jid() return a boolean
+
+ For now, it always returns TRUE. Also, change all callers to check the result.
+
+ src/bytestream-factory.c | 27 ++++++++++++++++++-
+ src/conn-aliasing.c | 4 +-
+ src/connection.c | 9 +++---
+ src/muc-channel.c | 2 +-
+ src/tube-dbus.c | 7 +++--
+ src/util.c | 8 +++---
+ src/util.h | 4 +-
+ tests/test-jid-decode.c | 8 +++---
+ .../twisted/file-transfer/file_transfer_helper.py | 5 ++-
+ 9 files changed, 49 insertions(+), 25 deletions(-)
+
+commit e694b86ab54fd37404c31c3513b4fe32c53fbb7c
+Author: Dafydd Harries
+Date: Tue Aug 25 16:27:59 2009 +0100
+
+ style tweaks
+
+ src/bytestream-factory.c | 14 +++++++-------
+ src/tube-dbus.c | 3 +--
+ 2 files changed, 8 insertions(+), 9 deletions(-)
+
+commit 783747e3387d2b6f9861673c69f081999965295e
+Author: Dafydd Harries
+Date: Tue Aug 25 16:16:52 2009 +0100
+
+ fix indentation
+
+ src/bytestream-factory.c | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+commit 7f6cbd62452712b7bc89afeab80d035fe5f2b2d3
+Author: Dafydd Harries
+Date: Mon Aug 24 18:39:53 2009 +0100
+
+ remove unused return values from JID decode test
+
+ tests/test-jid-decode.c | 20 ++++++++------------
+ 1 files changed, 8 insertions(+), 12 deletions(-)
+
+commit ea3a1d4bfa39b943f35457695edb041823978b64
+Author: Dafydd Harries
+Date: Mon Aug 24 17:42:12 2009 +0100
+
+ gabble_decode_jid(): set out parameters together
+
+ src/util.c | 22 +++++++++++-----------
+ 1 files changed, 11 insertions(+), 11 deletions(-)
+
+commit 48b33362ec02ab7cb71b9f3e03473814e9a1a793
+Author: Dafydd Harries
+Date: Mon Aug 24 16:06:05 2009 +0100
+
+ gabble_decode_jid(): make variable naming and docs more consistent with RFC
+
+ src/util.c | 71 ++++++++++++++++++++++++++++++-----------------------------
+ 1 files changed, 36 insertions(+), 35 deletions(-)
+
+commit 16fb7904c242f042e7915ed327596fb1db11786e
+Author: Will Thompson
+Date: Wed Sep 2 12:36:00 2009 +0100
+
+ Parse audio *and* video for accepted Google calls
+
+ src/jingle-session.c | 15 ++++++++++++---
+ 1 files changed, 12 insertions(+), 3 deletions(-)
+
+commit 2d4d8adc1f93d4bc3e4f5ec444ac168ae9e0aa41
+Author: Will Thompson
+Date: Wed Sep 2 18:51:27 2009 +0100
+
+ Test for SetRemoteCodecs etc. for all streams
+
+ This catches a bug in our Google Talk interop, where we ignored either
+ the audio or video codecs in their session accept.
+
+ tests/twisted/jingle/initial-audio-video.py | 14 ++++++++++++++
+ 1 files changed, 14 insertions(+), 0 deletions(-)
+
+commit 86685b9e690037b2c47cd2dc4054e3d06b36a2b3
+Author: Will Thompson
+Date: Wed Sep 2 18:12:35 2009 +0100
+
+ Reduce content-naming assumptions in Jingle tests
+
+ Now that we extract the stream names from session-initiate, let's fill them
+ in in incoming_call() too, and then generate_contents() can use those
+ rather than hard-coding stream1 and stream2.
+
+ tests/twisted/jingle/hold-av.py | 2 +-
+ tests/twisted/jingle/jingletest2.py | 53 ++++++++++---------
+ .../twisted/jingle/test-content-adding-removal.py | 2 +-
+ tests/twisted/jingle/test-content-complex.py | 3 +-
+ tests/twisted/jingle/test-description-info.py | 10 +++-
+ 5 files changed, 38 insertions(+), 32 deletions(-)
+
+commit e7aa0f714815ccabef2c67335fbbdf6f6795768d
+Author: Will Thompson
+Date: Wed Sep 2 17:26:03 2009 +0100
+
+ Tests: extract stream name(s) from session-initiate
+
+ This also adds some simple tests about the session-initiate that Gabble
+ sends on old-school and current Jingle (but not on GTalk4).
+
+ tests/twisted/jingle/jingletest2.py | 83 ++++++++++++++++++++++++++++++----
+ 1 files changed, 73 insertions(+), 10 deletions(-)
+
+commit 3f2c10b1430bfebff387ccad80a36649ce9819ae
+Author: Sjoerd Simons
+Date: Fri Aug 28 21:14:10 2009 +0100
+
+ Fix a crash when advertising tube caps without Service{,Name}
+
+ src/private-tubes-factory.c | 22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+commit 519ebcd216d9f42cd8b099c45070912617df55eb
+Merge: 4ebe748 c820241
+Author: Dafydd Harries
+Date: Fri Aug 28 19:44:14 2009 +0100
+
+ Merge branch 'vcard' into telepathy-gabble-0.8
+
+ Reviewed-by: Will Thompson
+
+commit c820241718eda7703520a3761ce21af5832d42ae
+Author: Dafydd Harries
+Date: Fri Aug 28 19:02:04 2009 +0100
+
+ sync_dbus(): ensure that the proxy has a unique name
+
+ Otherwise we might service-launch the CM after it's died, which we don't want.
+
+ tests/twisted/servicetest.py | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+commit c4905aafd56e05ca91235675c8da398932bb6143
+Author: Dafydd Harries
+Date: Fri Aug 28 18:10:54 2009 +0100
+
+ vcard-manager.c: don't crash when a set fails and there are edits pending
+
+ src/vcard-manager.c | 17 ++++++++++++-
+ tests/twisted/Makefile.am | 1 +
+ tests/twisted/vcard/set-set-disconnect.py | 34 +++++++++++++++++++++++++++++
+ 3 files changed, 50 insertions(+), 2 deletions(-)
+
+commit 96e44cc5c8623a0ca113c011af01186911a8007b
+Author: Dafydd Harries
+Date: Fri Aug 28 18:09:12 2009 +0100
+
+ make sync_dbus() call Ping() instead of InspectHandles()
+
+ This means that the CM can be synced with after the connection has been
+ destroyed.
+
+ tests/twisted/servicetest.py | 7 ++++---
+ 1 files changed, 4 insertions(+), 3 deletions(-)
+
+commit 70472f4873cd2223fbee63faa793ae6e03faa0c7
+Author: Dafydd Harries
+Date: Fri Aug 28 18:05:15 2009 +0100
+
+ pass bus, not stream, into sync_dbus() call
+
+ tests/twisted/muc/name-conflict.py | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
commit 4ebe7488a3084d14aa6ad50d709033ab7681f938
Author: Will Thompson
Date: Thu Aug 20 20:43:17 2009 +0100
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/NEWS new/telepathy-gabble-0.8.2/NEWS
--- old/telepathy-gabble-0.8.1/NEWS 2009-08-20 21:43:00.000000000 +0200
+++ new/telepathy-gabble-0.8.2/NEWS 2009-09-03 20:02:49.000000000 +0200
@@ -1,3 +1,27 @@
+telepathy-gabble 0.8.2 (2009-09-03)
+===================================
+
+The “tape two fried eggs over your eyes and walk the streets of Paris for an
+hour” release.
+
+Enhancements:
+
+* Improve jid validation, so that obviously-invalid jids are rejected.
+ (daf)
+
+Fixes:
+
+* Don't crash when a vCard set fails, and there are edits pending. This
+ can happen if you're trying to set your avatar and then disconnect.
+ (daf)
+
+* fd.o#23013: ContactCapabilities.SetSelfCapabilities can crash gabble
+ with wrong parms (sjoerd)
+
+* Fix parsing of incoming session accept from Google Video Chat. This
+ should make outgoing calls to Google Video Chat users work, as well as
+ incoming calls. Hooray! (wjt, with help from sjoerd and Olivier Crête)
+
telepathy-gabble 0.8.1 (2009-08-20)
===================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/configure.ac new/telepathy-gabble-0.8.2/configure.ac
--- old/telepathy-gabble-0.8.1/configure.ac 2009-08-20 21:43:12.000000000 +0200
+++ new/telepathy-gabble-0.8.2/configure.ac 2009-09-03 20:02:57.000000000 +0200
@@ -9,7 +9,7 @@
m4_define([gabble_major_version], [0])
m4_define([gabble_minor_version], [8])
-m4_define([gabble_micro_version], [1])
+m4_define([gabble_micro_version], [2])
m4_define([gabble_nano_version], [0])
# Some magic
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/bytestream-factory.c new/telepathy-gabble-0.8.2/src/bytestream-factory.c
--- old/telepathy-gabble-0.8.1/src/bytestream-factory.c 2009-08-09 11:03:46.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/bytestream-factory.c 2009-09-03 19:38:42.000000000 +0200
@@ -966,14 +966,26 @@
if (room_handle == 0)
{
- /* jid is not a muc jid so we need contact's resource */
- gabble_decode_jid (from, NULL, NULL, &peer_resource);
+ /* jid is not a muc jid so we need contact's resource */
- peer_handle = tp_handle_ensure (contact_repo, from, NULL, NULL);
+ if (!gabble_decode_jid (from, NULL, NULL, &peer_resource))
+ {
+ DEBUG ("Got an SI IQ response from a bad JID. Ignoring.");
+ goto out;
+ }
+
+ if (!peer_resource)
+ {
+ DEBUG ("Got an SI IQ response from a JID without a resource."
+ "Ignoring.");
+ goto out;
+ }
- /* we are not in a muc so our own jid is the one in the 'to' attribute */
- self_jid = g_strdup (lm_message_node_get_attribute (msg->node,
- "to"));
+ peer_handle = tp_handle_ensure (contact_repo, from, NULL, NULL);
+
+ /* we are not in a muc so our own jid is the one in the 'to' attribute */
+ self_jid = g_strdup (lm_message_node_get_attribute (msg->node,
+ "to"));
}
else
{
@@ -988,7 +1000,7 @@
if (muc == NULL)
{
- DEBUG ("Got an IQ from a muc in which we are not. Ignoring");
+ DEBUG ("Got an IQ from a muc in which we are not. Ignoring.");
goto out;
}
@@ -1865,12 +1877,23 @@
if (room_handle == 0)
{
- /* jid is not a muc jid so we need contact's resource */
- gabble_decode_jid (from, NULL, NULL, &peer_resource);
+ /* jid is not a muc jid so we need contact's resource */
+
+ if (!gabble_decode_jid (from, NULL, NULL, &peer_resource))
+ {
+ DEBUG ("Got an SI request with a bad JID");
+ goto END;
+ }
+
+ if (peer_resource == NULL)
+ {
+ DEBUG ("Got an SI request from a JID without a resource; ignoring");
+ goto END;
+ }
- /* we are not in a muc so our own jid is the one in the 'to' attribute */
- self_jid = g_strdup (lm_message_node_get_attribute (reply_msg->node,
- "to"));
+ /* we are not in a muc so our own jid is the one in the 'to' attribute */
+ self_jid = g_strdup (lm_message_node_get_attribute (reply_msg->node,
+ "to"));
}
else
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/conn-aliasing.c new/telepathy-gabble-0.8.2/src/conn-aliasing.c
--- old/telepathy-gabble-0.8.1/src/conn-aliasing.c 2009-08-20 18:54:43.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/conn-aliasing.c 2009-09-03 19:38:42.000000000 +0200
@@ -889,10 +889,10 @@
jid = tp_handle_inspect (contact_handles, handle);
g_assert (NULL != jid);
- gabble_decode_jid (jid, NULL, NULL, &resource);
/* MUC handles have the nickname in the resource */
- if (NULL != resource)
+ if (gabble_decode_jid (jid, NULL, NULL, &resource) &&
+ NULL != resource)
{
set_or_clear (alias, resource);
return GABBLE_CONNECTION_ALIAS_FROM_MUC_RESOURCE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/connection.c new/telepathy-gabble-0.8.2/src/connection.c
--- old/telepathy-gabble-0.8.1/src/connection.c 2009-08-20 21:15:00.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/connection.c 2009-09-03 19:46:02.000000000 +0200
@@ -545,10 +545,8 @@
{
GabbleConnectionPrivate *priv = GABBLE_CONNECTION (self)->priv;
- return g_strdup_printf ("%s@%s/%s",
- priv->username,
- priv->stream_server,
- priv->resource);
+ return gabble_encode_jid (
+ priv->username, priv->stream_server, priv->resource);
}
/* must be in the same order as GabbleListHandle in connection.h */
@@ -969,10 +967,8 @@
username = server = resource = NULL;
result = TRUE;
- gabble_decode_jid (account, &username, &server, &resource);
-
- if (username == NULL || server == NULL ||
- *username == '\0' || *server == '\0')
+ if (!gabble_decode_jid (account, &username, &server, &resource) ||
+ username == NULL)
{
g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"unable to get username and server from account");
@@ -1343,7 +1339,7 @@
g_assert (priv->resource != NULL);
g_assert (lm_connection_is_open (conn->lmconn) == FALSE);
- jid = g_strdup_printf ("%s@%s", priv->username, priv->stream_server);
+ jid = gabble_encode_jid (priv->username, priv->stream_server, NULL);
lm_connection_set_jid (conn->lmconn, jid);
g_free (jid);
@@ -2901,7 +2897,7 @@
if (server == NULL)
return NULL;
- return g_strdup_printf ("%s@%s", name, server);
+ return gabble_encode_jid (name, server, NULL);
}
@@ -3159,16 +3155,14 @@
GError *error = NULL;
room = service = NULL;
- gabble_decode_jid (batch->contexts[i].jid, &room, &service, NULL);
- if (room == NULL || *room == '\0' || service == NULL || *service == '\0')
+ if (!gabble_decode_jid (batch->contexts[i].jid, &room, &service, NULL) ||
+ room == NULL)
{
g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"unable to get room name and service from JID %s",
batch->contexts[i].jid);
-
ret = FALSE;
-
goto out;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/jingle-session.c new/telepathy-gabble-0.8.2/src/jingle-session.c
--- old/telepathy-gabble-0.8.1/src/jingle-session.c 2009-08-20 18:28:52.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/jingle-session.c 2009-09-03 19:46:02.000000000 +0200
@@ -1041,12 +1041,21 @@
DEBUG ("called");
- /* handle single-content special case */
if ((priv->dialect == JINGLE_DIALECT_GTALK3) ||
(priv->dialect == JINGLE_DIALECT_GTALK4))
{
- GabbleJingleContent *c = _get_any_content (sess);
- _each_content_accept (sess, c, node, error);
+ /* Google Talk calls don't have contents per se; they just have
+ * <payload-type>s in different namespaces for audio and video, in the
+ * same <description> stanza. So we need to feed the whole stanza to each
+ * content in turn.
+ */
+ GList *cs = gabble_jingle_session_get_contents (sess);
+ GList *l;
+
+ for (l = cs; l != NULL; l = l->next)
+ _each_content_accept (sess, l->data, node, error);
+
+ g_list_free (cs);
}
else
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/muc-channel.c new/telepathy-gabble-0.8.2/src/muc-channel.c
--- old/telepathy-gabble-0.8.1/src/muc-channel.c 2009-08-18 19:54:52.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/muc-channel.c 2009-09-03 19:38:42.000000000 +0200
@@ -697,7 +697,7 @@
*/
gchar *local_part;
- gabble_decode_jid (alias, &local_part, NULL, NULL);
+ g_assert (gabble_decode_jid (alias, &local_part, NULL, NULL));
g_assert (local_part != NULL);
g_free (alias);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/private-tubes-factory.c new/telepathy-gabble-0.8.2/src/private-tubes-factory.c
--- old/telepathy-gabble-0.8.1/src/private-tubes-factory.c 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/private-tubes-factory.c 2009-09-02 16:28:28.000000000 +0200
@@ -888,20 +888,26 @@
Feature *feat = g_new0 (Feature, 1);
gchar *service = g_strdup (tp_asv_get_string (cap,
TP_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service"));
- feat->feature_type = FEATURE_OPTIONAL;
- feat->ns = g_strdup_printf ("%s/stream#%s", NS_TUBES, service);
- feat->caps = 0;
- g_hash_table_insert (caps->stream_tube_caps, service, feat);
+ if (service != NULL)
+ {
+ feat->feature_type = FEATURE_OPTIONAL;
+ feat->ns = g_strdup_printf ("%s/stream#%s", NS_TUBES, service);
+ feat->caps = 0;
+ g_hash_table_insert (caps->stream_tube_caps, service, feat);
+ }
}
else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
{
Feature *feat = g_new0 (Feature, 1);
gchar *service = g_strdup (tp_asv_get_string (cap,
TP_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName"));
- feat->feature_type = FEATURE_OPTIONAL;
- feat->ns = g_strdup_printf ("%s/dbus#%s", NS_TUBES, service);
- feat->caps = 0;
- g_hash_table_insert (caps->dbus_tube_caps, service, feat);
+ if (service != NULL)
+ {
+ feat->feature_type = FEATURE_OPTIONAL;
+ feat->ns = g_strdup_printf ("%s/dbus#%s", NS_TUBES, service);
+ feat->caps = 0;
+ g_hash_table_insert (caps->dbus_tube_caps, service, feat);
+ }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/tube-dbus.c new/telepathy-gabble-0.8.2/src/tube-dbus.c
--- old/telepathy-gabble-0.8.1/src/tube-dbus.c 2009-08-05 17:28:38.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/tube-dbus.c 2009-09-03 19:38:42.000000000 +0200
@@ -908,8 +908,7 @@
g_assert (priv->self_handle != 0);
if (priv->handle_type == TP_HANDLE_TYPE_ROOM)
{
- /*
- * We have to create a pseudo-IBB bytestream that will be
+ /* We have to create a pseudo-IBB bytestream that will be
* used by this MUC tube to communicate.
*/
GabbleBytestreamMuc *bytestream;
@@ -920,8 +919,10 @@
priv->dbus_name_to_handle = g_hash_table_new_full (g_str_hash,
g_str_equal, NULL, NULL);
- gabble_decode_jid (tp_handle_inspect (contact_repo, priv->self_handle),
- NULL, NULL, &nick);
+ g_assert (gabble_decode_jid (
+ tp_handle_inspect (contact_repo, priv->self_handle),
+ NULL, NULL, &nick));
+ g_assert (nick != NULL);
priv->dbus_local_name = _gabble_generate_dbus_unique_name (nick);
@@ -1680,7 +1681,7 @@
const gchar *jid;
jid = tp_handle_inspect (contact_repo, handle);
- gabble_decode_jid (jid, NULL, NULL, &nick);
+ g_assert (gabble_decode_jid (jid, NULL, NULL, &nick));
supposed_name = _gabble_generate_dbus_unique_name (nick);
g_free (nick);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/util.c new/telepathy-gabble-0.8.2/src/util.c
--- old/telepathy-gabble-0.8.1/src/util.c 2009-08-20 18:59:55.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/util.c 2009-09-03 19:38:42.000000000 +0200
@@ -406,88 +406,144 @@
return msg;
}
+static gboolean
+validate_jid_node (const gchar *node)
+{
+ /* See RFC 3920 §3.3. */
+ const gchar *c;
+
+ for (c = node; *c; c++)
+ if (strchr ("\"&'/:<>@", *c))
+ /* RFC 3920 §A.5 */
+ return FALSE;
+
+ return TRUE;
+}
+
+static gboolean
+validate_jid_domain (const gchar *domain)
+{
+ /* XXX: This doesn't do proper validation, it just checks the character
+ * range. In theory, we check that the domain is a well-formed IDN or
+ * an IPv4/IPv6 address literal.
+ *
+ * See RFC 3920 §3.2.
+ */
+
+ const gchar *c;
+
+ for (c = domain; *c; c++)
+ if (!g_ascii_isalnum (*c) && !strchr (":-.", *c))
+ return FALSE;
+
+ return TRUE;
+}
+
/**
* gabble_decode_jid
*
* Parses a JID which may be one of the following forms:
- * server
- * server/resource
- * username@server
- * username@server/resource
- * room@service/nick
- * and sets the caller's username_room, server_service and resource_nick
- * pointers to the username/room, server/service and resource/nick parts
- * respectively, if available in the provided JID. The caller may set any of
- * the pointers to NULL if they are not interested in a certain component.
- *
- * The returned values may be NULL or zero-length if a component was either
- * not present or zero-length respectively in the given JID. The username/room
- * and server/service are lower-cased because the Jabber protocol treats them
- * case-insensitively.
+ *
+ * domain
+ * domain/resource
+ * node@domain
+ * node@domain/resource
+ *
+ * If the JID is valid, returns TRUE and sets the caller's
+ * node/domain/resource pointers if they are not NULL. The node and resource
+ * pointers will be set to NULL if the respective part is not present in the
+ * JID. The node and domain are lower-cased because the Jabber protocol treats
+ * them case-insensitively.
+ *
+ * XXX: Do nodeprep/resourceprep and length checking.
+ *
+ * See RFC 3920 §3.
*/
-void
+gboolean
gabble_decode_jid (const gchar *jid,
- gchar **username_room,
- gchar **server_service,
- gchar **resource_nick)
+ gchar **node,
+ gchar **domain,
+ gchar **resource)
{
- char *tmp_jid, *tmp_username, *tmp_server, *tmp_resource;
+ char *tmp_jid, *tmp_node, *tmp_domain, *tmp_resource;
g_assert (jid != NULL);
- if (username_room != NULL)
- *username_room = NULL;
+ if (node != NULL)
+ *node = NULL;
- if (server_service != NULL)
- *server_service = NULL;
+ if (domain != NULL)
+ *domain = NULL;
- if (resource_nick != NULL)
- *resource_nick = NULL;
+ if (resource != NULL)
+ *resource = NULL;
- /* take a local copy so we don't modify the caller's string */
+ /* Take a local copy so we don't modify the caller's string. */
tmp_jid = g_strdup (jid);
- /* find an @ in username, truncate username to that length, and point
- * 'server' to the byte afterwards */
- tmp_server = strchr (tmp_jid, '@');
- if (tmp_server)
- {
- tmp_username = tmp_jid;
-
- *tmp_server = '\0';
- tmp_server++;
-
- /* store the username if the user provided a pointer */
- if (username_room != NULL)
- *username_room = g_utf8_strdown (tmp_username, -1);
+ /* If there's a slash in tmp_jid, split it in two and take the second part as
+ * the resource.
+ */
+ tmp_resource = strchr (tmp_jid, '/');
+
+ if (tmp_resource)
+ {
+ *tmp_resource = '\0';
+ tmp_resource++;
}
else
{
- tmp_username = NULL;
- tmp_server = tmp_jid;
+ tmp_resource = NULL;
}
- /* if we have a server, find a / in it, truncate it to that length, and point
- * 'resource' to the byte afterwards. otherwise, do the same to username to
- * find any resource there. */
- tmp_resource = strchr (tmp_server, '/');
- if (tmp_resource)
+ /* If there's an at sign in tmp_jid, split it in two and set tmp_node and
+ * tmp_domain appropriately. Otherwise, tmp_node is NULL and the domain is
+ * the whole string.
+ */
+ tmp_domain = strchr (tmp_jid, '@');
+
+ if (tmp_domain)
{
- *tmp_resource = '\0';
- tmp_resource++;
+ *tmp_domain = '\0';
+ tmp_domain++;
+ tmp_node = tmp_jid;
+ }
+ else
+ {
+ tmp_domain = tmp_jid;
+ tmp_node = NULL;
+ }
- /* store the resource if the user provided a pointer */
- if (resource_nick != NULL)
- *resource_nick = g_strdup (tmp_resource);
+ /* Domain must be non-empty and not contain invalid characters. If the node
+ * or the resource exist, they must be non-empty and the node must not
+ * contain invalid characters.
+ */
+ if (*tmp_domain == '\0' ||
+ !validate_jid_domain (tmp_domain) ||
+ (tmp_node != NULL &&
+ (*tmp_node == '\0' || !validate_jid_node (tmp_node))) ||
+ (tmp_resource != NULL && *tmp_resource == '\0'))
+ {
+ g_free (tmp_jid);
+ return FALSE;
}
- /* the server must be stored after the resource, in case we truncated a
- * resource from it */
- if (server_service != NULL)
- *server_service = g_utf8_strdown (tmp_server, -1);
+ /* the server must be stored after we find the resource, in case we
+ * truncated a resource from it */
+ if (domain != NULL)
+ *domain = g_utf8_strdown (tmp_domain, -1);
+
+ /* store the username if the user provided a pointer */
+ if (tmp_node != NULL && node != NULL)
+ *node = g_utf8_strdown (tmp_node, -1);
+
+ /* store the resource if the user provided a pointer */
+ if (tmp_resource != NULL && resource != NULL)
+ *resource = g_strdup (tmp_resource);
/* free our working copy */
g_free (tmp_jid);
+ return TRUE;
}
/**
@@ -580,6 +636,30 @@
}
gchar *
+gabble_encode_jid (
+ const gchar *node,
+ const gchar *domain,
+ const gchar *resource)
+{
+ gchar *tmp, *ret;
+
+ g_return_val_if_fail (domain != NULL, NULL);
+
+ if (node != NULL && resource != NULL)
+ tmp = g_strdup_printf ("%s@%s/%s", node, domain, resource);
+ else if (node != NULL)
+ tmp = g_strdup_printf ("%s@%s", node, domain);
+ else if (resource != NULL)
+ tmp = g_strdup_printf ("%s/%s", domain, resource);
+ else
+ tmp = g_strdup (domain);
+
+ ret = g_utf8_normalize (tmp, -1, G_NORMALIZE_NFKC);
+ g_free (tmp);
+ return ret;
+}
+
+gchar *
gabble_normalize_contact (TpHandleRepoIface *repo,
const gchar *jid,
gpointer context,
@@ -589,25 +669,23 @@
gchar *username = NULL, *server = NULL, *resource = NULL;
gchar *ret = NULL;
- gabble_decode_jid (jid, &username, &server, &resource);
-
- if (!username || !server || !username[0] || !server[0])
+ if (!gabble_decode_jid (jid, &username, &server, &resource) || !username)
{
INVALID_HANDLE (error,
- "jid %s has invalid username or server", jid);
+ "JID %s is invalid or has no node part", jid);
goto OUT;
}
if (mode == GABBLE_JID_ROOM_MEMBER && resource == NULL)
{
INVALID_HANDLE (error,
- "jid %s can't be a room member - it has no resource", jid);
+ "JID %s can't be a room member - it has no resource", jid);
goto OUT;
}
if (mode != GABBLE_JID_GLOBAL && resource != NULL)
{
- ret = g_strdup_printf ("%s@%s/%s", username, server, resource);
+ ret = gabble_encode_jid (username, server, resource);
if (mode == GABBLE_JID_ROOM_MEMBER
|| (repo != NULL
@@ -628,7 +706,7 @@
* says it is, or because the context isn't sure and we haven't seen it in
* use as a room member
*/
- ret = g_strdup_printf ("%s@%s", username, server);
+ ret = gabble_encode_jid (username, server, NULL);
OUT:
g_free (username);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/util.h new/telepathy-gabble-0.8.2/src/util.h
--- old/telepathy-gabble-0.8.1/src/util.h 2009-08-20 18:59:55.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/util.h 2009-09-03 19:38:42.000000000 +0200
@@ -61,8 +61,10 @@
const gchar *to, LmMessageType type, LmMessageSubType sub_type,
guint spec, ...);
-/* format: a@b/c */
-void gabble_decode_jid (const gchar *jid, gchar **a, gchar **b, gchar **c);
+G_GNUC_WARN_UNUSED_RESULT
+gboolean gabble_decode_jid (const gchar *jid, gchar **a, gchar **b, gchar **c);
+gchar *gabble_encode_jid (const gchar *node, const gchar *domain,
+ const gchar *resource);
gchar *gabble_remove_resource (const gchar *jid);
gchar *gabble_normalize_contact (TpHandleRepoIface *repo, const gchar *jid,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/src/vcard-manager.c new/telepathy-gabble-0.8.2/src/vcard-manager.c
--- old/telepathy-gabble-0.8.1/src/vcard-manager.c 2009-08-20 18:54:43.000000000 +0200
+++ new/telepathy-gabble-0.8.2/src/vcard-manager.c 2009-09-03 19:46:02.000000000 +0200
@@ -890,8 +890,21 @@
}
}
- /* If we've received more edit requests in the meantime, send them off. */
- manager_patch_vcard (self, node);
+ if (error != NULL)
+ {
+ if (priv->edits != NULL)
+ {
+ /* All the requests for these edits have just been cancelled. */
+ g_hash_table_destroy (priv->edits);
+ priv->edits = NULL;
+ }
+ }
+ else
+ {
+ /* If we've received more edit requests in the meantime, send them off.
+ */
+ manager_patch_vcard (self, node);
+ }
}
static void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/test-jid-decode.c new/telepathy-gabble-0.8.2/tests/test-jid-decode.c
--- old/telepathy-gabble-0.8.1/tests/test-jid-decode.c 2009-06-23 19:08:40.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/test-jid-decode.c 2009-09-03 19:38:42.000000000 +0200
@@ -5,76 +5,53 @@
#include "src/util.h"
-static gboolean
-test1 (void)
+static void
+test_pass (
+ const gchar *jid,
+ const gchar *expected_node,
+ const gchar *expected_domain,
+ const gchar *expected_resource)
{
gchar *node = NULL;
- gchar *server = NULL;
+ gchar *domain = NULL;
gchar *resource = NULL;
- gabble_decode_jid ("", &node, &server, &resource);
- g_assert (node == NULL);
- g_assert (0 == strcmp (server, ""));
- g_assert (resource == NULL);
- g_free (server);
- return TRUE;
+ g_assert (gabble_decode_jid (jid, &node, &domain, &resource));
+ g_assert (!tp_strdiff (expected_node, node));
+ g_assert (!tp_strdiff (expected_domain, domain));
+ g_assert (!tp_strdiff (expected_resource, resource));
+ g_free (node);
+ g_free (domain);
+ g_free (resource);
}
-static gboolean
-test2 (void)
+static void
+test_fail (const gchar *jid)
{
gchar *node = NULL;
- gchar *server = NULL;
+ gchar *domain = NULL;
gchar *resource = NULL;
- gabble_decode_jid ("bar", &node, &server, &resource);
+ g_assert (!gabble_decode_jid (jid, &node, &domain, &resource));
g_assert (node == NULL);
- g_assert (0 == strcmp (server, "bar"));
- g_assert (resource == NULL);
- g_free (server);
- return TRUE;
-}
-
-static gboolean
-test3 (void)
-{
- gchar *node = NULL;
- gchar *server = NULL;
- gchar *resource = NULL;
-
- gabble_decode_jid ("foo@bar", &node, &server, &resource);
- g_assert (0 == strcmp (node, "foo"));
- g_assert (0 == strcmp (server, "bar"));
+ g_assert (domain == NULL);
g_assert (resource == NULL);
- g_free (node);
- g_free (server);
- return TRUE;
-}
-
-static gboolean
-test4 (void)
-{
- gchar *node = NULL;
- gchar *server = NULL;
- gchar *resource = NULL;
-
- gabble_decode_jid ("foo@bar/baz", &node, &server, &resource);
- g_assert (0 == strcmp (node, "foo"));
- g_assert (0 == strcmp (server, "bar"));
- g_assert (0 == strcmp (resource, "baz"));
- g_free (node);
- g_free (server);
- g_free (resource);
- return TRUE;
}
int
main (void)
{
- g_assert (test1 ());
- g_assert (test2 ());
- g_assert (test3 ());
- g_assert (test4 ());
+ test_fail ("");
+ test_pass ("bar", NULL, "bar", NULL);
+ test_pass ("foo@bar", "foo", "bar", NULL);
+ test_pass ("foo@bar/baz", "foo", "bar", "baz");
+ test_fail ("@bar");
+ test_fail ("foo@bar/");
+ test_pass ("Foo@Bar/Baz", "foo", "bar", "Baz");
+ test_fail ("foo@@");
+ test_fail ("foo&bar@baz");
+ test_pass ("foo/bar@baz", NULL, "foo", "bar@baz");
+ test_pass ("foo@bar/foo@bar/foo@bar", "foo", "bar", "foo@bar/foo@bar");
return 0;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/Makefile.am new/telepathy-gabble-0.8.2/tests/twisted/Makefile.am
--- old/telepathy-gabble-0.8.1/tests/twisted/Makefile.am 2009-08-20 21:15:00.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/Makefile.am 2009-09-03 19:46:02.000000000 +0200
@@ -72,6 +72,7 @@
tubes/test-get-available-tubes.py \
tubes/test-socks5-muc.py \
vcard/overlapping-sets.py \
+ vcard/set-set-disconnect.py \
vcard/test-alias-empty-vcard.py \
vcard/test-alias-pep.py \
vcard/test-alias.py \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/config.py new/telepathy-gabble-0.8.2/tests/twisted/config.py
--- old/telepathy-gabble-0.8.1/tests/twisted/config.py 2009-08-20 21:43:51.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/config.py 2009-09-03 20:03:32.000000000 +0200
@@ -1,2 +1,2 @@
-PACKAGE_STRING = "Telepathy Gabble 0.8.1"
+PACKAGE_STRING = "Telepathy Gabble 0.8.2"
DEBUGGING = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/file-transfer/file_transfer_helper.py new/telepathy-gabble-0.8.2/tests/twisted/file-transfer/file_transfer_helper.py
--- old/telepathy-gabble-0.8.1/tests/twisted/file-transfer/file_transfer_helper.py 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/file-transfer/file_transfer_helper.py 2009-09-03 19:38:42.000000000 +0200
@@ -43,6 +43,7 @@
class FileTransferTest(object):
CONTACT_NAME = 'test-ft@localhost'
+ CONTACT_FULL_JID = 'test-ft@localhost/Telepathy'
def __init__(self, bytestream_cls, file, address_type, access_control, access_control_param):
self.file = file
@@ -65,7 +66,7 @@
roster = make_result_iq(self.stream, roster_event.stanza)
query = roster.firstChildElement()
item = query.addElement('item')
- item['jid'] = self.CONTACT_NAME
+ item['jid'] = self.CONTACT_FULL_JID
item['subscription'] = 'both'
self.stream.send(roster)
@@ -150,7 +151,7 @@
def send_ft_offer_iq(self):
self.bytestream = self.bytestream_cls(self.stream, self.q, 'alpha',
- self.contact_name, 'test@localhost/Resource', True)
+ self.contact_full_jid, 'test@localhost/Resource', True)
iq, si = self.bytestream.create_si_offer(ns.FILE_TRANSFER)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/jingle/hold-av.py new/telepathy-gabble-0.8.2/tests/twisted/jingle/hold-av.py
--- old/telepathy-gabble-0.8.1/tests/twisted/jingle/hold-av.py 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/jingle/hold-av.py 2009-09-03 19:46:02.000000000 +0200
@@ -165,7 +165,7 @@
stream.send(make_result_iq(stream, e.stanza))
jt.parse_session_initiate(e.query)
- jt.accept(with_video=True)
+ jt.accept()
q.expect('stream-iq', iq_type='result')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/jingle/initial-audio-video.py new/telepathy-gabble-0.8.2/tests/twisted/jingle/initial-audio-video.py
--- old/telepathy-gabble-0.8.1/tests/twisted/jingle/initial-audio-video.py 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/jingle/initial-audio-video.py 2009-09-03 19:46:02.000000000 +0200
@@ -4,9 +4,12 @@
InitialVideo
"""
+import operator
+
from servicetest import (
assertContains, assertEquals, assertLength,
wrap_channel, EventPattern, call_async, make_channel_proxy,
+ tp_path_prefix,
)
from jingletest2 import JingleTest2, test_all_dialects
@@ -131,6 +134,17 @@
predicate=jt.jp.action_predicate('session-initiate'))
jt.parse_session_initiate (e.query)
+ jt.accept()
+
+ events = reduce(operator.concat,
+ [ [ EventPattern('dbus-signal', signal='SetRemoteCodecs',
+ path=p[len(tp_path_prefix):]),
+ EventPattern('dbus-signal', signal='SetStreamPlaying',
+ path=p[len(tp_path_prefix):]),
+ ] for p in stream_handler_paths
+ ], [])
+ q.expect_many(*events)
+
chan.Close()
def incoming(jp, q, bus, conn, stream):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/jingle/jingletest2.py new/telepathy-gabble-0.8.2/tests/twisted/jingle/jingletest2.py
--- old/telepathy-gabble-0.8.1/tests/twisted/jingle/jingletest2.py 2009-08-17 13:30:38.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/jingle/jingletest2.py 2009-09-03 19:46:02.000000000 +0200
@@ -119,11 +119,11 @@
def match_jingle_action(self, q, action):
return q is not None and q.name == 'jingle' and q['action'] == action
- def extract_session_id(self, query):
+ def _extract_session_id(self, query):
return query['sid']
def validate_session_initiate(self, query):
- return True
+ raise NotImplementedError()
def can_do_video(self):
return True
@@ -207,14 +207,15 @@
def TransportGoogleP2P(self):
return None
- def extract_session_id(self, query):
+ def _extract_session_id(self, query):
return query['id']
def can_do_video_only(self):
return False
def validate_session_initiate(self, query):
- assert query['id'] != None
+ sid = self._extract_session_id(query)
+
# No transport in GTalk03
assert xpath.queryForNodes('/session/transport', query) == None
@@ -232,8 +233,9 @@
assert xpath.queryForNodes(
'/session/description/payload-type[@xmlns="%s"]' %
ns.GOOGLE_SESSION_PHONE, query)
-
- return True
+ return (sid, ['fake-audio'], ['fake-video'])
+ else:
+ return (sid, ['fake-audio'], [])
def seperate_contents(self):
return False
@@ -279,9 +281,13 @@
action = self._action_map(action)
return q is not None and q.name == 'session' and q['type'] == action
- def extract_session_id(self, query):
+ def _extract_session_id(self, query):
return query['id']
+ def validate_session_initiate(self, query):
+ # FIXME: validate it!
+ return (self._extract_session_id(query), ['fake-audio'], [])
+
def can_do_video(self):
return False
@@ -312,6 +318,36 @@
namespace = 'unexistent-namespace'
return ('description', namespace, { 'type': type }, children)
+ def validate_session_initiate(self, query):
+ contents = xpath.queryForNodes(
+ '/jingle[@xmlns="%s"]/content' % ns.JINGLE_015,
+ query)
+
+ audio, video = [], []
+
+ for c in contents:
+ a_desc = xpath.queryForNodes(
+ '/content/description[@xmlns="%s"]' % ns.JINGLE_015_AUDIO,
+ c)
+ v_desc = xpath.queryForNodes(
+ '/content/description[@xmlns="%s"]' % ns.JINGLE_015_VIDEO,
+ c)
+
+ if a_desc is not None:
+ assert len(a_desc) == 1, c.toXml()
+ assert v_desc is None
+ audio.append(c['name'])
+ elif v_desc is not None:
+ assert len(v_desc) == 1, c.toXml()
+ assert a_desc is None
+ video.append(c['name'])
+ else:
+ assert False, c.toXml()
+
+ assert len(audio) + len(video) > 0, query.toXml()
+
+ return (self._extract_session_id(query), audio, video)
+
class JingleProtocol031(JingleProtocol):
features = [ ns.JINGLE, ns.JINGLE_RTP, ns.JINGLE_RTP_AUDIO,
ns.JINGLE_RTP_VIDEO, ns.GOOGLE_P2P ]
@@ -346,6 +382,33 @@
return EventPattern('stream-iq', predicate=p)
+ def validate_session_initiate(self, query):
+ contents = xpath.queryForNodes(
+ '/jingle[@xmlns="%s"]/content' % ns.JINGLE,
+ query)
+
+ audio, video = [], []
+
+ for c in contents:
+ descs = xpath.queryForNodes(
+ '/content/description[@xmlns="%s"]' % ns.JINGLE_RTP,
+ c)
+
+ assert len(descs) == 1, c.toXml()
+
+ d = descs[0]
+
+ if d['media'] == 'audio':
+ audio.append(c['name'])
+ elif d['media'] == 'video':
+ video.append(c['name'])
+ else:
+ assert False, c.toXml()
+
+ assert len(audio) + len(video) > 0, query.toXml()
+
+ return (self._extract_session_id(query), audio, video)
+
class JingleTest2:
# Default caps for the remote end
remote_caps = { 'ext': '', 'ver': '0.0.0',
@@ -423,35 +486,19 @@
# Force Gabble to process the caps before doing any more Jingling
sync_stream(self.q, self.stream)
- def generate_contents (self, audio = True, video = False):
- assert audio or video
+ def generate_contents(self):
+ assert len(self.audio_names + self.video_names) > 0
jp = self.jp
- assert not video or jp.can_do_video()
+ assert len(self.video_names) == 0 or jp.can_do_video()
contents = []
- if jp.seperate_contents() or not audio or not video:
- assert audio or video
- if audio:
- contents.append(
- jp.Content('stream1', 'initiator', 'both', [
- jp.Description('audio', [
- jp.PayloadType(name, str(rate), str(id)) for
- (name, id, rate) in self.audio_codecs ]),
- jp.TransportGoogleP2P() ])
- )
- if video:
- contents.append(
- jp.Content('stream2', 'initiator', 'both', [
- jp.Description('video', [
- jp.PayloadType(name, str(rate), str(id)) for
- (name, id, rate) in self.video_codecs ]),
- jp.TransportGoogleP2P() ])
- )
- else:
+ if not jp.seperate_contents() and self.video_names:
assert jp.can_do_video()
+ assert self.audio_names
+
contents.append(
jp.Content('stream0', 'initiator', 'both', [
jp.Description('video', [
@@ -463,12 +510,31 @@
),
jp.TransportGoogleP2P() ])
)
+ else:
+ def mk_content(name, media, codecs):
+ contents.append(
+ jp.Content(name, 'initiator', 'both', [
+ jp.Description(media, [
+ jp.PayloadType(name, str(rate), str(id)) for
+ (name, id, rate) in codecs ]),
+ jp.TransportGoogleP2P() ])
+ )
+
+ for name in self.audio_names:
+ mk_content(name, 'audio', self.audio_codecs)
+
+ for name in self.video_names:
+ mk_content(name, 'video', self.video_codecs)
return contents
def incoming_call(self, audio=True, video=False):
jp = self.jp
- contents = self.generate_contents(audio, video)
+
+ self.audio_names = ['audio1'] if audio else []
+ self.video_names = ['video1'] if video else []
+
+ contents = self.generate_contents()
node = jp.SetIq(self.peer, self.jid, [
jp.Jingle(self.sid, self.peer, 'session-initiate', contents),
@@ -476,14 +542,14 @@
self.stream.send(jp.xml(node))
def parse_session_initiate (self, query):
- # Validate the session initiate and get some useful ifo from it
- self.jp.validate_session_initiate (query)
- self.sid = self.jp.extract_session_id(query)
+ # Validate the session initiate and get some useful info from it
+ self.sid, self.audio_names, self.video_names = \
+ self.jp.validate_session_initiate(query)
- def accept(self, with_video=False):
+ def accept(self):
jp = self.jp
- contents = self.generate_contents(True, with_video)
+ contents = self.generate_contents()
node = jp.SetIq(self.peer, self.jid, [
jp.Jingle(self.sid, self.peer, 'session-accept',
contents) ])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/jingle/test-content-adding-removal.py new/telepathy-gabble-0.8.2/tests/twisted/jingle/test-content-adding-removal.py
--- old/telepathy-gabble-0.8.1/tests/twisted/jingle/test-content-adding-removal.py 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/jingle/test-content-adding-removal.py 2009-09-03 19:46:02.000000000 +0200
@@ -75,7 +75,7 @@
e2 = q.expect('stream-iq', predicate=jp.action_predicate('content-remove'))
# ...but before the peer notices, they accept the call.
- jt.accept(with_video=True)
+ jt.accept()
# Only now the remote end removes the video stream; if gabble mistakenly
# marked it as accepted on session acceptance, it'll crash right about
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/jingle/test-content-complex.py new/telepathy-gabble-0.8.2/tests/twisted/jingle/test-content-complex.py
--- old/telepathy-gabble-0.8.1/tests/twisted/jingle/test-content-complex.py 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/jingle/test-content-complex.py 2009-09-03 19:46:02.000000000 +0200
@@ -123,11 +123,10 @@
else:
q.expect('stream-iq', iq_type='error')
-
# Remote end then tries to create a content with a name it's already used
node = jp.SetIq(jt2.peer, jt2.jid, [
jp.Jingle(jt2.sid, jt2.peer, 'content-add', [
- jp.Content('stream1', 'initiator', 'both', [
+ jp.Content(jt2.audio_names[0], 'initiator', 'both', [
jp.Description('audio', [
jp.PayloadType(name, str(rate), str(id)) for
(name, id, rate) in jt2.audio_codecs ]),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/jingle/test-description-info.py new/telepathy-gabble-0.8.2/tests/twisted/jingle/test-description-info.py
--- old/telepathy-gabble-0.8.1/tests/twisted/jingle/test-description-info.py 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/jingle/test-description-info.py 2009-09-03 19:46:02.000000000 +0200
@@ -143,11 +143,15 @@
('PCMU', 0, 8000, {}) ]
stream_handler.CodecsUpdated(jt2.dbusify_codecs_with_params(new_codecs))
+ audio_content = jt2.audio_names[0]
+
e = q.expect('stream-iq', iq_type='set', predicate=lambda x:
xpath.queryForNodes("/iq/jingle[@action='description-info']",
x.stanza))
payload_types = xpath.queryForNodes(
- "/iq/jingle/content[@name='stream1']/description/payload-type", e.stanza)
+ "/iq/jingle/content[@name='%s']/description/payload-type"
+ % audio_content,
+ e.stanza)
# Gabble SHOULD only include the changed codecs in description-info
assert len(payload_types) == 2, payload_types
@@ -162,7 +166,7 @@
# error back.
node = jp.SetIq(jt2.peer, jt2.jid, [
jp.Jingle(jt2.sid, jt2.peer, 'description-info', [
- jp.Content('stream1', 'initiator', 'both', [
+ jp.Content(audio_content, 'initiator', 'both', [
jp.Description('audio', [
jp.PayloadType('PCMU', '1600', '0') ]) ]) ]) ])
stream.send(jp.xml(node))
@@ -178,7 +182,7 @@
c = new_codecs[2]
node = jp.SetIq(jt2.peer, jt2.jid, [
jp.Jingle(jt2.sid, jt2.peer, 'description-info', [
- jp.Content('stream1', 'initiator', 'both', [
+ jp.Content(audio_content, 'initiator', 'both', [
jp.Description('audio', [
jp.PayloadType(c[0], str(c[2]), str(c[1]), c[3])
]) ]) ]) ])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/muc/name-conflict.py new/telepathy-gabble-0.8.2/tests/twisted/muc/name-conflict.py
--- old/telepathy-gabble-0.8.1/tests/twisted/muc/name-conflict.py 2009-08-09 11:03:47.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/muc/name-conflict.py 2009-09-03 19:46:02.000000000 +0200
@@ -79,7 +79,7 @@
# think that it's got the whole userlist now. If so, syncing here will make
# CreateChannel incorrectly return here.
sync_stream(q, stream)
- sync_dbus(stream, q, conn)
+ sync_dbus(bus, q, conn)
# Send presence for own membership of room.
stream.send(make_muc_presence('none', 'participant', room_jid, 'test_'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/servicetest.py new/telepathy-gabble-0.8.2/tests/twisted/servicetest.py
--- old/telepathy-gabble-0.8.1/tests/twisted/servicetest.py 2009-08-20 21:15:00.000000000 +0200
+++ new/telepathy-gabble-0.8.2/tests/twisted/servicetest.py 2009-09-03 19:46:02.000000000 +0200
@@ -269,9 +269,12 @@
def sync_dbus(bus, q, conn):
# Dummy D-Bus method call
- call_async(q, conn, "InspectHandles", 1, [])
-
- event = q.expect('dbus-return', method='InspectHandles')
+ # This won't do the right thing unless the proxy has a unique name.
+ assert conn.object.bus_name.startswith(':')
+ root_object = bus.get_object(conn.object.bus_name, '/')
+ call_async(
+ q, dbus.Interface(root_object, 'org.freedesktop.DBus.Peer'), 'Ping')
+ q.expect('dbus-return', method='Ping')
class ProxyWrapper:
def __init__(self, object, default, others):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/telepathy-gabble-0.8.1/tests/twisted/vcard/set-set-disconnect.py new/telepathy-gabble-0.8.2/tests/twisted/vcard/set-set-disconnect.py
--- old/telepathy-gabble-0.8.1/tests/twisted/vcard/set-set-disconnect.py 1970-01-01 01:00:00.000000000 +0100
+++ new/telepathy-gabble-0.8.2/tests/twisted/vcard/set-set-disconnect.py 2009-09-03 19:46:02.000000000 +0200
@@ -0,0 +1,34 @@
+
+"""
+Regression test for crash when disconnecting in the middle of a set.
+"""
+
+from servicetest import EventPattern, call_async, sync_dbus
+from gabbletest import exec_test, acknowledge_iq
+import constants as cs
+
+def test(q, bus, conn, stream):
+ conn.Connect()
+ _, iq_event = q.expect_many(
+ EventPattern('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_CONNECTED, cs.CSR_REQUESTED]),
+ EventPattern('stream-iq', to=None, query_ns='vcard-temp',
+ query_name='vCard'))
+
+ acknowledge_iq(stream, iq_event.stanza)
+
+ call_async(
+ q, conn.Avatars, 'SetAvatar', 'Guy.brush', 'image/x-mighty-pirate')
+ iq_event = q.expect(
+ 'stream-iq', iq_type='set', query_ns='vcard-temp', query_name='vCard')
+ call_async(
+ q, conn.Avatars, 'SetAvatar', 'LeChuck.brush', 'image/x-ghost-pirate')
+ conn.Disconnect()
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_REQUESTED]),
+ q.expect('dbus-error', method='SetAvatar', name=cs.NOT_AVAILABLE)
+ q.expect('dbus-error', method='SetAvatar', name=cs.NOT_AVAILABLE)
+ sync_dbus(bus, q, conn)
+
+if __name__ == '__main__':
+ exec_test(test)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org