[meego-commits] 11020: Changes to Trunk/telepathy-butterfly
Ulf Hofemeier
no_reply at build.meego.com
Fri Dec 17 19:29:47 UTC 2010
Hi,
I have made the following changes to telepathy-butterfly in project Trunk. Please review and accept ASAP.
Thank You,
Ulf Hofemeier
[This message was auto-generated]
---
Request #11020:
submit: Trunk:Testing/telepathy-butterfly(r6)(update) -> Trunk/telepathy-butterfly
Message:
Promotion from Trunk:Testing to Trunk
State: new 2010-12-17T11:29:46 ulf
Comment: None
changes files:
--------------
--- telepathy-butterfly.changes
+++ telepathy-butterfly.changes
@@ -0,0 +1,8 @@
+* Tue Dec 7 2010 Mikhail Zabaluev <mikhail.zabaluev at nokia.com> - 0.5.15
+- Update to 0.5.15
+- Changed group to Communications/Telephony and IM.
+- Use the telepathy libexec.
+- Switched to the spec as the packaging source.
+- Pruned the build dependencies.
+- Added python-crypto to runtime dependencies (BMC#10020).
+
old:
----
telepathy-butterfly-0.5.12.tar.gz
telepathy-butterfly.yaml
new:
----
telepathy-butterfly-0.5.15.tar.gz
spec files:
-----------
--- telepathy-butterfly.spec
+++ telepathy-butterfly.spec
@@ -1,76 +1,41 @@
-#
-# Do not Edit! Generated by:
-# spectacle version 0.18
-#
-# >> macros
-# << macros
-
Name: telepathy-butterfly
Summary: MSN connection manager for Telepathy
-Version: 0.5.12
+Version: 0.5.15
Release: 1
Group: Applications/Communications
License: GPLv2+
BuildArch: noarch
URL: http://telepathy.freedesktop.org/wiki/
Source0: http://telepathy.freedesktop.org/releases/%{name}/%{name}-%{version}.tar.gz
-Source100: telepathy-butterfly.yaml
Requires: python-telepathy >= 0.15.17
+Requires: python-crypto
Requires: papyon >= 0.4.2
Requires: dbus
Requires: telepathy-filesystem
-BuildRequires: pkgconfig(dbus-1)
BuildRequires: python-devel
-BuildRequires: pkgconfig
-
%description
-An MSN connection manager that handles presence, personal messages,
-and conversations
-
-
-
+An MSN connection manager for Telepathy that handles presence,
+personal messages, and conversations.
%prep
%setup -q -n %{name}-%{version}
-# >> setup
-# << setup
-
%build
-# >> build pre
-./configure --prefix=%{_prefix}
-# << build pre
-
+# We install noarch executables only, so our libexecdir is under /usr/share
+./configure --prefix=%{_prefix} --libexecdir=%{_datadir}/telepathy
make %{?jobs:-j%jobs}
-# >> build post
-# << build post
%install
rm -rf %{buildroot}
-# >> install pre
-# << install pre
%make_install
-# >> install post
-
-
-# << install post
-
-
-
-
-
-
%files
%defattr(-,root,root,-)
-# >> files
%doc COPYING AUTHORS NEWS
-%{_libexecdir}/%{name}
+%{_datadir}/telepathy/telepathy-butterfly
%{_datadir}/dbus-1/services/*.service
%{_datadir}/telepathy/managers/*.manager
%{python_sitelib}/*
-# << files
-
other changes:
--------------
++++++ telepathy-butterfly-0.5.12.tar.gz -> telepathy-butterfly-0.5.15.tar.gz
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,432 @@
+commit a6c7b3230e0a6ad54e5e4d3e77f025d6cb32dd67
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-12-03 15:37:00 -0500
+
+ Version 0.5.15
+
+commit 09e130714de2b3ca75517ae615c2daadc1563e9b
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-12-03 14:42:05 -0500
+
+ media: add constructed streams when initializing media session
+
+commit 59fc36b800ebcd9c1b1ace3cb2876a38c9b64614
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-12-03 14:37:04 -0500
+
+ bugfix: don't delete Group if it isn't empty
+
+commit 7bb061f6408b43fd29a75d6b2536a0ec92045094
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-12-03 14:36:26 -0500
+
+ ft: set state as Stopped when session is disposed before completion
+
+commit c9090ba21630ffe52ffe324c6e953c34696e3c8d
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-30 17:26:41 -0500
+
+ bugfix: correctly add and remove contact capabilities
+
+ The capabilities were only correctly updated on initialization and it wasn't possible to downgrade caps.
+
+commit e804d7e68c46d301ac7797e57ffe71210f880dda
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-30 17:16:39 -0500
+
+ bugfix: don't try to add/remove ourself from a contact list
+
+commit f5140e786f2faa2191479fd3599de30f71ab38df
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-29 13:49:12 -0500
+
+ bugfix: don't call timeout_add with a float
+
+ That was causing a warning
+
+commit fc33649dca51327e47f38781c21bc7e49df94943
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:17:31 -0500
+
+ spec: add implementation for new Protocol object
+
+commit 8a09e9d5de751db7ae24326af79aa69cbfa88b35
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:03:37 -0500
+
+ spec: mail notification interface has been undrafted
+
+commit 8a381d874b5133f660723b717b2c23bdf1be1577
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:02:48 -0500
+
+ spec: conference interface has been undrafted
+
+ The properties are implemented in tp-python
+
+commit 170338d2aa8861e97a1a0ef3db8869c0baedad42
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:09:49 -0500
+
+ caps: don't remove A/V capabilities
+
+commit 9ce7735afcf78dff89764c65232e0074ff7ea020
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:08:23 -0500
+
+ caps: utility function to diff capabilities has been moved to tp-python
+
+commit 461b8dbd5f528a4827d14b2876256d715ce19ce5
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:07:50 -0500
+
+ caps: use new ContactCapabilities basic implementation from tp-python
+
+commit 2dafb54fa8a6c2373e66345235671f0628d1de1c
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:05:05 -0500
+
+ text: unreference papyon conversation when channel is closed
+
+commit f36f56dc32e7399208e32e5fef46fd504b579b03
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 15:47:04 -0500
+
+ ft: dispose session when channel is closed
+
+ Don't keep a reference on the p2p session. Python GC will clean up.
+
+commit 2dddc3e7b22b743411412ac8e2aaa85c76e771be
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 15:46:11 -0500
+
+ ft: close channel after cleaning up
+
+commit a7a32a3d01c73f7952de0fceb9ea923aec6fad3b
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-30 17:31:49 -0500
+
+ media: relayed candidates need base-address and base-port
+
+commit 349d3163f14558c5e6a0e1574b153759f4a1af54
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-10-21 17:19:02 -0400
+
+ media: only set remote candidates once the client is Ready
+
+ If the local user was accepting the call too quickly, it was possible the client wasn't ready yet. That means it wasn't listening to SetRemoteCandidateList signal and was just silently dropping candidates.
+
+commit a2914aa8294c93cc404e323f56cb02e623e4787c
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-10-21 17:11:37 -0400
+
+ media: make sure the call is disposed and ended only once
+
+commit 68e6aa2dd7f1adcb2f0741db2b5d9b9d71f070aa
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 15:45:24 -0500
+
+ channel: tp-python will remove channel from connection when closed
+
+commit b57867b794a7e7a8ae6671bac5e1d76303b82ba8
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 14:34:38 -0500
+
+ bugfix: correctly normalize and ensure handles
+
+ We use new methods of tp-python to ensure a handle exists (it's created if needed). That means only the connection keeps a set of all the handles and there is no more dict persistent between connections.
+
+ We make sure the handle name is normalized. This is particularly critical for contact handles because the account name might not always be in the same case.
+
+commit d5f8ed4a22ab5e25ab408e59d770b4872ab9e9c4
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:24:10 -0500
+
+ bugfix: correctly clean up everything on disconnection
+
+commit 3b08436fdc8b1aff22591cbaa371fc76d9e9a306
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-10-21 17:13:20 -0400
+
+ bugfix: use timeout_add_seconds instead of timeout_add
+
+ (Might) avoid some useless wake-up
+
+commit c546279e401390a6586e18fc3e9780c17fa0a2e3
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-10-21 15:30:09 -0400
+
+ bugfix: add proper flags to publish list (CAN_ADD and CAN_REMOVE)
+
+ Telepathy backend of Folks looks at these flags when adding a new contact. It was working before because Empathy wasn't.
+
+commit 1497126cdd8b7a8f76adec26e2573bea16ba3ea0
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-30 17:23:18 -0500
+
+ style: _add_immutables has changed for _add_immutable_properties
+
+commit 13ed7e8dd2186bfe1c3c1301ba608f7e79592649
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:08:54 -0500
+
+ style: prepend protected method with underscore
+
+commit 9da6330d0fda5e5dbe5e9ece390aa5e6e80fc5cc
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-10-21 17:15:13 -0400
+
+ style: remove useless import
+
+commit dbcf7674c703eda6090e7c1b1bcffb33cdf27a89
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-11-09 16:49:22 -0500
+
+ Depends on telepathy-python 0.15.19 and papyon 0.5.3
+
+commit 0ec13e18ee71696523ec5d1e386080bc3de8f359
+Author: Nicolas Dufresne <nicolas.dufresne at collabora.co.uk>
+Date: 2010-10-05 16:17:56 -0400
+
+ Remove mail-notificaiton fixme related to interfaces
+
+ Removing element from the connection interfaces list is not really a hack
+ since it has no known issue. Also, no race condition exist since this is
+ run in the main thread. (bugs.fd.o #26044)
+
+commit 05affbb91ef0ca244d45cc32fbb8e10ca72453f9
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:47:31 -0400
+
+ Change version in configure.ac
+
+commit 53b3385e62a7aecfffb8e3674d3758148cfdc102
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:44:39 -0400
+
+ Version 0.5.14
+
+commit 679dd0d0e8b3d1708f50057b2cdc3995367a6747
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:43:53 -0400
+
+ Papyon 0.5.1 is not absolutly needed, butterfly still works with 0.5.0
+
+commit a7d2c6866eef23fffa482f56c29eb638092641b3
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:27:42 -0400
+
+ Fix capabilities detection
+
+commit eb2f00acba9c4be5ff57061b69df9a9551462659
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:27:18 -0400
+
+ Give the correct handle when our own avatar is changed remotly
+
+commit 335dd06a93c4cc8b549a5cbc7f652a06dbbcd9ee
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:18:51 -0400
+
+ Add log message for an error
+
+commit 4cc71f2ab8df1a80a8fb7fdcfd650afd4ab6f0d6
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:17:00 -0400
+
+ Clear the conversation when it's closed
+
+commit 7d523265a0d5d066356ff7285f69f14f6cbc2698
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:14:58 -0400
+
+ Initialize right interface (ContactEventInterface instead of Conversation...)
+
+commit 26def946940090176dadb4bba09e0a13553a4d2a
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:13:46 -0400
+
+ Only set remote candidates once the user accepted the call
+
+commit 65a00f77f4fed2535ff9b593d5f35ba413ef78a7
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:12:30 -0400
+
+ Send an error when a text message isn't delivered
+
+commit 0b69104b7f04a62cf3273c2b896fadb971c7b758
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-09-10 18:08:21 -0400
+
+ Some more debug messages and typo fixes
+
+commit 870e011fc33c89f90c0b60313db3842449fb3f2f
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-25 13:14:42 -0400
+
+ Log butterfly and papyon version at initialization (fdo #29080)
+
+commit 3c3963add58978cadff73c13f333065d41991006
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-23 15:00:11 -0400
+
+ Remove unused function
+
+commit 397f50a7018af53cd5fff17fcd4110ce05e5d7f8
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-23 15:00:54 -0400
+
+ Decode utf-8 encoded sender's nick to an unicode string
+
+commit 959805f14d7f2f0b8f2604672b0b4b96c14d65d2
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-13 00:28:58 -0400
+
+ Version 0.5.13
+
+commit 1e4957b4cc85613f0b2c720f20227022015912bb
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-12 23:33:25 -0400
+
+ proxy: get proxies for direct connection and don't filter proxies anymore
+
+ Papyon should support every type of proxy
+
+commit 235715427df9643c10ac744ae6b407bbd4884c48
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-07-29 16:14:10 +0200
+
+ proxy: get SOCKS proxy if any (used for direct connection)
+
+commit c0dd691b823478b4ba9e65283ade97e2d576bbf2
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-12 15:01:22 -0400
+
+ msnp18: switch protocol to version 18
+
+commit 76ece6f229ed87e997c6fc1248171702cdead5a8
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-12 15:00:47 -0400
+
+ mpop: get the proper handle (contact or self) for the text channel
+
+commit 756764f7b9ea619982a4feda23c56ca7006ed93a
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-12 14:58:07 -0400
+
+ mpop: don't assume we already have our own display picture
+
+commit 0c6a03f29bfb09f8221a39f659c27d4c031ddcc0
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-12 14:46:56 -0400
+
+ mpop: monitor display name changes triggered by another end point
+
+commit 54c1b6beab58795e7044791a4846a023002159f0
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-07-26 12:41:41 +0200
+
+ media: fixes for new papyon SIP stack
+
+ Remote codecs and candidates can be already received when initializing the stream handler.
+
+commit db1ae2589e3fa1418d45f6b20f798cbbc3531e36
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-12 14:27:07 -0400
+
+ media: re-enable streamed media channels and capabilities
+
+commit 6add32222bd7e2534c524e3711710e91afd3295c
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-11 13:41:21 -0400
+
+ ft: some cleanup
+
+commit 86dd719a2f3a78770a64a04b23cc4363787abf7b
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-11 13:40:11 -0400
+
+ ft: cancel file transfer when the listening socket gets an error
+
+commit bfdc83907bc27b12a94494d6fb8c5976f0462e5c
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-11 12:49:09 -0400
+
+ ft: change state and send Closed signal before cleaning up everything
+
+commit c56ccfd7f11bb4586c4bfb368decbbfa41abdea5
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-11 12:40:46 -0400
+
+ ft: remove IOChannel sources once the socket is connected/disconnected
+
+commit ab562dbb861c2afdf1ba6031bd510449fb0b4ed1
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-11 12:39:19 -0400
+
+ ft: disconnect ft session signals when cleaning up
+
+commit 40e31aa3309e2a0b318ea3c5f85089b1e1889c3b
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-07-27 11:58:27 +0200
+
+ ft: change state accordingly when session is rejected or declined by peer
+
+commit a7ec904ff2d67811f77c29907f632a24334a94e0
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-08-12 16:43:14 -0400
+
+ Now depend on papyon 0.5.0
+
+commit ed045e36169c4d256a5c9c74cd83861132a2c464
+Author: Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne at collabora.co.uk>
+Date: 2010-07-02 02:02:59 -0400
+
+ fixed error for missing contact list
+
+ raise a valid Telepathy exception for unhandled contact lists
+
+commit 092e6b471dd58aa252ac43db960e2a8720b7af1c
+Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
+Date: 2010-07-13 14:26:46 +0100
+
+ connection manager: 'set' object is unsubscriptable
+
+ Fixes: fd.o#29042
+
+ Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
+
+commit 961c0aee0dd5aada7046e730f4518f1be6aa530c
+Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
+Date: 2010-07-12 15:34:16 +0100
+
+ NEWS: updated
+
+ Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
+
+commit 947d4946b215921d0ba2bacd46ca29f94550fe69
+Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
+Date: 2010-07-11 01:05:04 +0100
+
+ im channel: InitialInviteeIDs is an as, not s
+
+ Previously we were passing the ID of the contact to invite on the new
+ channel appearing as a string in the InitialInviteeIDs property, but
+ actually this should be a list of strings. This then caused problems
+ later when we try to iterate this list.
+
+ Fixes: fd.o#29004
+
+ Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
+
+commit cfe70ad2d702a4cb7bf7349f214e80df960faa09
+Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
+Date: 2010-07-09 21:47:17 +0100
+
+ configure: start 0.5.13 development
+
+ Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
+
commit b571ea726eb5d01180312d871cf71e62e9333796
Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date: 2010-07-09 21:33:50 +0100
--- NEWS
+++ NEWS
@@ -1,3 +1,49 @@
+telepathy-butterfly-0.5.15 (2010-12-03)
+=======================================
+
+Dependencies:
+ * telepathy-python 0.15.19
+ * papyon 0.5.3
+
+Enhancements:
+
+ * Implement Protocol interface
+ * Remove undrafted interfaces (moved to tp-python)
+
+Fixes:
+
+ * Normalize and ensure handles per connection
+ * Fix detection of A/V capabilities (downgrade)
+ * Add proper flags to contact publish list
+ * Misc fixes to media and file transfer channels
+
+telepathy-butterfly-0.5.14 (2010-09-10)
+=======================================
+
+Fixes:
+
+ * fd.o#24338: only set remote candidates after acception the invitation
+ * Fix handling of conversations when contact goes offline (needs papyon 0.5.1)
+ * Fix detection of capabilities
+
+telepathy-butterfly-0.5.13 (2010-08-12)
+=======================================
+
+Enhancements:
+
+ * Video-conference support has been re-enabled
+ * Multiple Points of Presence support
+
+Fixes:
+
+ * fd.o#29004: im channel: InitialInviteeIDs is an as, not s.
+ * fd.o#29015: failed to cancel incoming FT
+ * fd.o#28462: failed to connect through proxy
+
+Dependencies:
+
+ * papyon 0.5.0 is now required.
+
telepathy-butterfly-0.5.12 (2010-07-09)
=======================================
--- aclocal.m4
+++ aclocal.m4
@@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
-[m4_warning([this file was generated for autoconf 2.65.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
+[m4_warning([this file was generated for autoconf 2.67.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
--- butterfly/Channel_Interface_Conference.py
+++ butterfly/Channel_Interface_Conference.py
-# -*- coding: utf-8 -*-
-# Generated from the Telepathy spec
-"""Copyright © 2009 Collabora Limited
-Copyright © 2009 Nokia Corporation
-
- 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.
-
- 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.
-
- 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.
-
-"""
-
-import dbus.service
-
-CHANNEL_INTERFACE_CONFERENCE = 'org.freedesktop.Telepathy.Channel.Interface.Conference.DRAFT'
-
-class ChannelInterfaceConference(dbus.service.Interface):
- """\
- An interface for multi-user conference channels that can "continue
- from" one or more individual channels.
-
-
- This interface addresses freedesktop.org bug
- #24906 (GSM-compatible conference calls) and bug
- #24939 (upgrading calls and chats to multi-user).
- See those bugs for rationale and use cases.
-
- Examples of usage:
-
- Active and held GSM calls C1, C2 can be merged into a single
- channel Cn with the Conference interface, by calling
- CreateChannel({...ChannelType: ...Call,
- ...InitialChannels: [C1, C2]})
- which returns Cn.
-
- An XMPP 1-1 conversation C1 can be continued in a newly created
- multi-user chatroom Cn by calling
- CreateChannel({...ChannelType: ...Text,
- ...InitialChannels: [C1]})
- which returns Cn.
-
- An XMPP 1-1 conversation C1 can be continued in a specified
- multi-user chatroom by calling
- CreateChannel({...ChannelType: ...Text, ...HandleType: ROOM,
- ...TargetID: 'telepathy at conf.example.com',
- ...InitialChannels: [C1]})
- which returns a Conference channel.
-
- Either of the XMPP cases could work for Call channels, to
- upgrade from 1-1 Jingle to multi-user Jingle. Any of the XMPP cases
- could in principle work for link-local XMPP (XEP-0174).
-
- The underlying switchboard representing an MSN 1-1 conversation C1
- with a contact X can be moved to a representation as a nameless
- chatroom, Cn, to which more contacts can be invited, by calling
- CreateChannel({...ChannelType: ...Text,
- ...InitialChannels: [C1]})
- which returns Cn. C1 SHOULD remain open, with no underlying
- switchboard attached. If X establishes a new switchboard with the
- local user, C1 SHOULD pick up that switchboard rather than letting
- it create a new channel.
- [FIXME: should it?]
- Similarly, if the local user sends a message in C1, then
- a new switchboard to X should be created and associated with C1.
-
- XMPP and MSN do not natively have a concept of merging two or more
- channels C1, C2... into one channel, Cn. However, the GSM-style
- merging API can be supported on XMPP and MSN, as an API short-cut
- for upgrading C1 into a conference Cn (which invites the
- TargetHandle of C1 into Cn), then immediately inviting the
- TargetHandle of C2, the TargetHandle of C3, etc. into Cn as well.
-
- With a suitable change of terminology, Skype has behaviour similar
- to MSN.
-
-
- The Group MAY have channel-specific handles for participants;
- clients SHOULD support both Conferences that have channel-specific handles,
- and those that do not.
-
-
- In the GSM case, the Conference's Group interface MAY have
- channel-specific handles, to reflect the fact that the identities of
- the participants might not be known - it can be possible to know that
- there is another participant in the Conference, but not know who
- they are.
- [FIXME: fact check from GSM gurus needed]
-
-
- In the XMPP case, the Conference's Group interface SHOULD have
- channel-specific handles, to reflect the fact that the participants
- have MUC-specific identities, and the user might also be able to see
- their global identities, or not.
-
- In most other cases, including MSN and link-local XMPP, the
- Conference's Group interface SHOULD NOT have channel-specific
- handles, since users' identities are always visible.
-
-
- Connection managers implementing channels with this interface
- MUST NOT allow the object paths of channels that could be merged
- into a Conference to be re-used, unless the channel re-using the
- object path is equivalent to the channel that previously used it.
-
-
- If you upgrade some channels into a conference, and then close
- the original channels, InitialChannels
- (which is immutable) will contain paths to channels which no longer
- exist. This implies that you should not re-use channel object paths,
- unless future incarnations of the path are equivalent.
-
- For instance, on protocols where you can only have
- zero or one 1-1 text channels with Emily at one time, it would
- be OK to re-use the same object path for every 1-1 text channel
- with Emily; but on protocols where this is not true, it would
- be misleading.
-
-
- """
-
- def __init__(self):
- self._interfaces.add('org.freedesktop.Telepathy.Channel.Interface.Conference.DRAFT')
-
- @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Conference.DRAFT', signature='o')
- def ChannelMerged(self, Channel):
- """
- Emitted when a new channel is added to the value of
- Channels.
-
- """
- pass
-
- @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Conference.DRAFT', signature='o')
- def ChannelRemoved(self, Channel):
- """
- Emitted when a channel is removed from the value of
- Channels, either because it closed
- or because it was split using the Splittable.DRAFT.Split method.
-
- [FIXME: relative ordering of this vs. Closed? Do we
- care?]
-
- """
- pass
-
--- butterfly/Connection_Interface_Mail_Notification.py
+++ butterfly/Connection_Interface_Mail_Notification.py
-# -*- coding: utf-8 -*-
-# Generated from the Telepathy spec
-""" Copyright (C) 2007 Collabora Limited
-
- 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.
-
-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
-Library General Public License for more details.
-
-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.
-
-"""
-
-import dbus.service
-
-
-class ConnectionInterfaceMailNotification(dbus.service.Interface):
- """\
- An interface to support receiving notifications about a e-mail
- account associated with this connection.
-
- In protocols where this is possible, this interface also allows the
- connection manager to provide the necessary information for clients
- to open a web-based mail client without having to re-authenticate.
-
- To use this interface, a client MUST first subscribe using the
- Subscribe method. The subscription
- mechanic aims at reducing network traffic and memory footprint in the
- situation where nobody is currently interesting in provided
- information. When done with this interface, clients SHOULD call
- Unsubscribe to release resources in
- the CM.
-
- Protocols have various different levels of Mail Notification support.
- To describe the level of support, the interface provides a property
- called MailNotificationFlags.
- Not all combinations are valid; protocols can be divided into four
- categories as follows.
-
- Connections to the most capable protocols, such as Google's XMPP Mail
- Notification extension, have the Supports_Unread_Mails flag (this
- implies that they must also have Supports_Unread_Mail_Count, but not
- Emits_Mails_Received). On these connections, clients
- requiring change notification MUST monitor the
- UnreadMailsChanged signal, and
- either recover the initial state from the
- UnreadMails property (if they require
- details other than the number of mails) or the
- UnreadMailCount property (if they
- are only interested in the number of unread mails). The
- MailsReceived signal is never emitted
- on these connections, so clients that will display a short-term
- notification for each new mail MUST do so in response to emission of
- the UnreadMailsChanged signal.
-
- The most common situation, seen in protocols like MSN and Yahoo, is
- that the number of unread mails is provided and kept up-to-date,
- and a separate notification is emitted with some details of each new
- mail. This is a combination of the following two features, and clients
- SHOULD implement one or both as appropriate for their requirements.
-
- On protocols that have the Emits_Mails_Received flag (which implies
- that they do not have Supports_Unread_Mails), the CM does not keep
- track of any mails; it simply emits a notification whenever new mail
- arrives. Those events may be used for short term display (like a
- notification popup) to inform the user. No protocol is known to support
- only this feature, but it is useful for integration with libraries that
- that do not implement tracking of the number of mails. Clients
- requiring these notifications MUST monitor the
- MailsReceived signal on any connections
- with this flag.
-
- On protocols that have the Supports_Unread_Mail_Count flag but not
- the Supports_Unread_Mails flag, clients cannot display complete
- details of unread email, but can display an up-to-date count of the
- number of unread mails. To do this, they must monitor the
- UnreadMailsChanged signal, and
- retrieve the initial state from the
- UnreadMailCount property.
-
-
- Orthogonal features described by the
- MailNotificationFlags property include the
- RequestSomethingURL methods, which are used to obtain URLs allowing
- clients to open a webmail client. Connections SHOULD support as many
- of these methods as possible.
- """
-
- def __init__(self):
- self._interfaces.add('org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT')
-
- @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT', in_signature='', out_signature='')
- def Subscribe(self):
- """
- This method subscribes a client to the notification interface. This
- MUST be called by clients before using this interface.
-
- The Connection tracks a subscription count (like a refcount) for
- each unique bus name that has called Subscribe(). When a client calls
- Unsubscribe(), it releases one "reference". If a client exits
- (or crashes), the Connection releases all "references" held on its
- behalf.
-
-
- The reference count imposed on the subscription simplifies
- implementation of client running in the same process
- (e.g. plug-ins): two plug-ins interested in mail notification can
- call Subscribe and Unsubscribe independently without interfering
- with each other.
-
- This method exists to reduce memory and network overhead when
- there is no active subscription. An example of a protocol that
- benefits from this method is the Google XMPP Mail Notification
- extension: in this protocol, the CM receives a notification
- that something has changed, but to get more information, the CM
- must request this information. Knowing that nobody is currently
- interested in this information, the CM can avoid generating
- useless network traffic. Similarly, the CM may free
- the list of unread messages to reduce memory overhead.
-
-
-
- """
- raise NotImplementedError
-
- @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT', in_signature='', out_signature='')
- def Unsubscribe(self):
- """
- This method unsubscribes a client from the notification interface.
- This SHOULD be called by each client that has successfully called
- Subscribe when it no longer needs the mail notification interface.
-
-
- See Subscribe for rationale.
-
-
- """
- raise NotImplementedError
-
- @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT', in_signature='', out_signature='(sua(ss))')
- def RequestInboxURL(self):
- """
- This method creates and returns a URL and an optional POST data that
- allow opening the Inbox folder of a webmail account. This URL MAY
- contain tokens with a short lifetime, so clients SHOULD request a new
- URL for each visit to the webmail interface. This method is implemented
- only if the Supports_Request_Inbox_URL flag is set in
- MailNotificationFlags.
-
-
- We are not using properties here because the tokens are unsuitable
- for sharing between clients, and network round-trips may be required
- to obtain the information that leads to authentication free webmail
- access.
-
-
- """
- raise NotImplementedError
-
- @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT', in_signature='sv', out_signature='(sua(ss))')
- def RequestMailURL(self, ID, URL_Data):
- """
- This method creates and returns a URL and optional POST data that
- allow opening a specific mail in a webmail interface. This
- method is implemented only if Supports_Request_Mail_URL flag
- is set in MailNotificationFlags.
-
- See RequestInboxURL for design
- rationale.
-
-
- """
- raise NotImplementedError
-
- @dbus.service.signal('org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT', signature='aa{sv}')
- def MailsReceived(self, Mails):
- """
- Emitted when new e-mails messages arrive to the inbox associated with
- this connection. This signal is used for protocols that are not able
- to maintain the UnreadMails list, but
- do provide real-time notification about newly arrived e-mails. It MUST
- NOT be emitted unless Emits_Mails_Received is set in
- MailNotificationFlags.
-
- """
- pass
-
- @dbus.service.signal('org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT', signature='uaa{sv}as')
- def UnreadMailsChanged(self, Count, Mails_Added, Mails_Removed):
- """
- Emitted when UnreadMails or
- UnreadMailCount have changed. It MUST
- NOT be emited if Supports_Unread_Mail_Count flag is not set
- in MailNotificationFlags.
-
- Mails_Added and
- Mails_Removed MUST be empty if the
- Supports_Unread_Mails flag is not set.
-
- """
- pass
- --- butterfly/Makefile.am
+++ butterfly/Makefile.am
@@ -4,8 +4,6 @@
butterfly_PYTHON = \
aliasing.py \
capabilities.py \
- Channel_Interface_Conference.py \
- Connection_Interface_Mail_Notification.py \
connection.py \
debug.py \
__init__.py \
@@ -15,4 +13,5 @@
connection_manager.py \
contacts.py \
handle.py \
- mail_notification.py
+ mail_notification.py \
+ protocol.py
--- butterfly/Makefile.in
+++ butterfly/Makefile.in
@@ -200,8 +200,6 @@
butterfly_PYTHON = \
aliasing.py \
capabilities.py \
- Channel_Interface_Conference.py \
- Connection_Interface_Mail_Notification.py \
connection.py \
debug.py \
__init__.py \
@@ -211,7 +209,8 @@
connection_manager.py \
contacts.py \
handle.py \
- mail_notification.py
+ mail_notification.py \
+ protocol.py
all: all-recursive
--- butterfly/aliasing.py
+++ butterfly/aliasing.py
@@ -25,7 +25,6 @@
from papyon.service.description.AB.constants import \
ContactGeneral, ContactAnnotations
-from butterfly.handle import ButterflyHandleFactory
from butterfly.util.decorator import async
__all__ = ['ButterflyAliasing']
@@ -34,11 +33,13 @@
class ButterflyAliasing(
telepathy.server.ConnectionInterfaceAliasing,
- papyon.event.ContactEventInterface):
+ papyon.event.ContactEventInterface,
+ papyon.event.ProfileEventInterface):
def __init__(self):
telepathy.server.ConnectionInterfaceAliasing.__init__(self)
papyon.event.ContactEventInterface.__init__(self, self.msn_client)
+ papyon.event.ProfileEventInterface.__init__(self, self.msn_client)
def GetAliasFlags(self):
return telepathy.constants.CONNECTION_ALIAS_FLAG_USER_SET
@@ -58,7 +59,7 @@
def SetAliases(self, aliases):
for handle_id, alias in aliases.iteritems():
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- if handle != ButterflyHandleFactory(self, 'self'):
+ if handle != self._self_handle:
if alias == handle.name:
alias = u""
contact = handle.contact
@@ -80,7 +81,7 @@
else:
self.msn_client.profile.display_name = alias.encode('utf-8')
logger.info("Self alias changed to '%s'" % alias)
- self.AliasesChanged(((ButterflyHandleFactory(self, 'self'), alias), ))
+ self.AliasesChanged(((self._self_handle, alias), ))
# papyon.event.ContactEventInterface
def on_contact_display_name_changed(self, contact):
@@ -96,8 +97,7 @@
# papyon.event.ContactEventInterface
def on_contact_memberships_changed(self, contact):
- handle = ButterflyHandleFactory(self, 'contact',
- contact.account, contact.network_id)
+ handle = self.ensure_contact_handle(contact)
if contact.is_member(papyon.Membership.FORWARD):
alias = handle.pending_alias
if alias is not None:
@@ -108,10 +108,14 @@
update_contact_infos(contact, infos)
handle.pending_alias = None
+ # papyon.event.ProfileEventInterface
+ def on_profile_display_name_changed(self):
+ self._contact_alias_changed(self.msn_client.profile)
+
def _get_alias(self, handle_id):
"""Get the alias from one handle id"""
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- if handle == ButterflyHandleFactory(self, 'self'):
+ if handle == self._self_handle:
display_name = self.msn_client.profile.display_name
if display_name == "":
display_name = handle.get_name().split('@', 1)[0]
@@ -133,11 +137,12 @@
@async
def _contact_alias_changed(self, contact):
- handle = ButterflyHandleFactory(self, 'contact',
- contact.account, contact.network_id)
+ alias = None
- alias = contact.infos.get(ContactGeneral.ANNOTATIONS, {}).\
- get(ContactAnnotations.NICKNAME, None)
+ handle = self.ensure_contact_handle(contact)
+ if handle != self._self_handle:
+ alias = contact.infos.get(ContactGeneral.ANNOTATIONS, {}).\
+ get(ContactAnnotations.NICKNAME, None)
if alias == "" or alias is None:
alias = contact.display_name
--- butterfly/avatars.py
+++ butterfly/avatars.py
@@ -26,7 +26,6 @@
import papyon.event
import papyon.util.string_io as StringIO
-from butterfly.handle import ButterflyHandleFactory
from butterfly.util.decorator import async
__all__ = ['ButterflyAvatars']
@@ -74,10 +73,7 @@
result = {}
for handle_id in contacts:
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- if handle == self.GetSelfHandle():
- contact = handle.profile
- else:
- contact = handle.contact
+ contact = handle.contact
if contact is not None:
msn_object = contact.msn_object
@@ -93,15 +89,14 @@
def RequestAvatars(self, contacts):
for handle_id in contacts:
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- if handle == self.GetSelfHandle():
- msn_object = self.msn_client.profile.msn_object
- self._msn_object_retrieved(msn_object, handle)
+ if handle == self._self_handle:
+ contact = self.msn_client.profile
else:
contact = handle.contact
- if contact is not None:
- msn_object = contact.msn_object
- self.msn_client.msn_object_store.request(msn_object,
- (self._msn_object_retrieved, handle), peer=contact)
+ if contact is not None:
+ msn_object = contact.msn_object
+ self.msn_client.msn_object_store.request(msn_object,
+ (self._msn_object_retrieved, handle), peer=contact)
def SetAvatar(self, avatar, mime_type):
self._avatar_known = True
@@ -128,8 +123,7 @@
avatar_token = contact.msn_object._data_sha.encode("hex")
else:
avatar_token = ""
- handle = ButterflyHandleFactory(self, 'contact',
- contact.account, contact.network_id)
+ handle = self.ensure_contact_handle(contact)
self.AvatarUpdated(handle, avatar_token)
# papyon.event.ProfileEventInterface
@@ -138,7 +132,7 @@
if msn_object is not None:
avatar_token = msn_object._data_sha.encode("hex")
logger.info("Self avatar changed to %s" % avatar_token)
- handle = ButterflyHandleFactory(self, 'self')
+ handle = self._self_handle
self.AvatarUpdated(handle, avatar_token)
@async
--- butterfly/capabilities.py
+++ butterfly/capabilities.py
@@ -23,11 +23,7 @@
import papyon
import papyon.event
-from telepathy._generated.Connection_Interface_Contact_Capabilities \
- import ConnectionInterfaceContactCapabilities
-
from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
__all__ = ['ButterflyCapabilities']
@@ -35,7 +31,7 @@
class ButterflyCapabilities(
telepathy.server.ConnectionInterfaceCapabilities,
- ConnectionInterfaceContactCapabilities,
+ telepathy.server.ConnectionInterfaceContactCapabilities,
papyon.event.ContactEventInterface):
text_chat_class = \
@@ -80,127 +76,54 @@
def __init__(self):
telepathy.server.ConnectionInterfaceCapabilities.__init__(self)
- ConnectionInterfaceContactCapabilities.__init__(self)
+ telepathy.server.ConnectionInterfaceContactCapabilities.__init__(self)
papyon.event.ContactEventInterface.__init__(self, self.msn_client)
- # handle -> list(RCC)
- self._contact_caps = {}
self._video_clients = []
self._update_capabilities_calls = []
- def AdvertiseCapabilities(self, add, remove):
- #for caps, specs in add:
- #if caps == telepathy.CHANNEL_TYPE_STREAMED_MEDIA:
- #if specs & telepathy.CHANNEL_MEDIA_CAPABILITY_VIDEO:
- #self._self_handle.profile.client_id.has_webcam = True
- #self._self_handle.profile.client_id.supports_rtc_video = True
- #for caps in remove:
- #if caps == telepathy.CHANNEL_TYPE_STREAMED_MEDIA:
- #self._self_handle.profile.client_id.has_webcam = False
-
- return telepathy.server.ConnectionInterfaceCapabilities.\
- AdvertiseCapabilities(self, add, remove)
-
- def GetContactCapabilities(self, handles):
- if 0 in handles:
- raise telepathy.InvalidHandle('Contact handle list contains zero')
-
- ret = dbus.Dictionary({}, signature='ua(a{sv}as)')
- for i in handles:
- handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, i)
- # If the handle has no contact capabilities yet then it
- # won't be in the dict. It's fair to return an empty list
- # here for its contact caps.
- if handle in self._contact_caps:
- ret[handle] = dbus.Array(self._contact_caps[handle], signature='(a{sv}as)')
- else:
- ret[handle] = dbus.Array([], signature='(a{sv}as)')
-
- return ret
-
- def UpdateCapabilities(self, caps):
- if self._status != telepathy.CONNECTION_STATUS_CONNECTED:
- self._update_capabilities_calls.append(caps)
- return
-
- # butterfly voip is disabled, so
- return
-
- # We only care about voip.
- for client, classes, capabilities in caps:
- video = False
- for channel_class in classes:
- # Does this client support video?
- if channel_class[telepathy.CHANNEL_INTERFACE + '.ChannelType'] == \
- telepathy.CHANNEL_TYPE_STREAMED_MEDIA:
- video = True
- self._video_clients.append(client)
- else:
- # *Did* it used to support video?
- if client in self._video_clients:
- self._video_clients.remove(client)
-
- changed = False
- # We've got no more clients that support video; remove the cap.
- if not video and not self._video_clients:
- self._self_handle.profile.client_id.has_webcam = False
- changed = True
-
- # We want video.
- if video and not self._self_handle.profile.client_id.has_webcam:
- self._self_handle.profile.client_id.has_webcam = True
- self._self_handle.profile.client_id.supports_rtc_video = True
- changed = True
-
- # Signal.
- if changed:
- updated = dbus.Dictionary({self._self_handle: self._contact_caps[self._self_handle]},
- signature='ua(a{sv}as)')
- self.ContactCapabilitiesChanged(updated)
+ ### Events handling ------------------------------------------------------
# papyon.event.ContactEventInterface
def on_contact_client_capabilities_changed(self, contact):
- self._update_capabilities(contact)
+ handle = self.ensure_contact_handle(contact)
+ if handle == self._self_handle:
+ return # don't update our own capabilities using server ones
+ self._update_capabilities(handle)
+ self._update_contact_capabilities([handle])
# papyon.event.AddressBookEventInterface
def on_addressbook_contact_added(self, contact):
"""When we add a contact in our contact list, add the
default capabilities to the contact"""
if contact.is_member(papyon.Membership.FORWARD):
- handle = ButterflyHandleFactory(self, 'contact',
- contact.account, contact.network_id)
- self.add_default_capabilities([handle])
-
- def _diff_capabilities(self, handle, ctype, new_gen=None,
- new_spec=None, added_gen=None, added_spec=None):
-
- if handle in self._caps and ctype in self._caps[handle]:
- old_gen, old_spec = self._caps[handle][ctype]
- else:
- old_gen = 0
- old_spec = 0
-
- if new_gen is None:
- new_gen = old_gen
- if new_spec is None:
- new_spec = old_spec
- if added_gen:
- new_gen |= added_gen
- if added_spec:
- new_spec |= new_spec
-
- if old_gen != new_gen or old_spec != new_spec:
- diff = (int(handle), ctype, old_gen, new_gen, old_spec, new_spec)
- return diff
+ handle = self.ensure_contact_handle(contact)
+ self._add_default_capabilities([handle])
+ self._update_contact_capabilities([handle])
+
+
+ ### Capabilities interface -----------------------------------------------
+
+ def _get_capabilities(self, contact):
+ gen_caps = 0
+ spec_caps = 0
+ caps = contact.client_capabilities
+
+ if caps.supports_sip_invite:
+ gen_caps |= telepathy.CONNECTION_CAPABILITY_FLAG_CREATE
+ gen_caps |= telepathy.CONNECTION_CAPABILITY_FLAG_INVITE
+ spec_caps |= telepathy.CHANNEL_MEDIA_CAPABILITY_AUDIO
+ spec_caps |= telepathy.CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_STUN
+ if caps.has_webcam:
+ spec_caps |= telepathy.CHANNEL_MEDIA_CAPABILITY_VIDEO
- return None
+ return gen_caps, spec_caps
- def add_default_capabilities(self, contacts_handles):
+ def _add_default_capabilities(self, handles):
"""Add the default capabilities to these contacts."""
ret = []
- cc_ret = dbus.Dictionary({}, signature='ua(a{sv}as)')
- for handle in contacts_handles:
+ for handle in handles:
new_flag = telepathy.CONNECTION_CAPABILITY_FLAG_CREATE
ctype = telepathy.CHANNEL_TYPE_TEXT
@@ -211,65 +134,98 @@
diff = self._diff_capabilities(handle, ctype, added_gen=new_flag)
ret.append(diff)
- # ContactCapabilities
- caps = self._contact_caps.setdefault(handle, [])
- caps.append(self.text_chat_class)
- caps.append(self.file_transfer_class)
- cc_ret[handle] = self._contact_caps[handle]
-
self.CapabilitiesChanged(ret)
- self.ContactCapabilitiesChanged(cc_ret)
- def _update_capabilities(self, contact):
- handle = ButterflyHandleFactory(self, 'contact',
- contact.account, contact.network_id)
+ def _update_capabilities(self, handle):
ctype = telepathy.CHANNEL_TYPE_STREAMED_MEDIA
- new_gen, new_spec, rcc = self._get_capabilities(contact)
+ new_gen, new_spec = self._get_capabilities(handle.contact)
diff = self._diff_capabilities(handle, ctype, new_gen, new_spec)
if diff is not None:
self.CapabilitiesChanged([diff])
- if rcc is None:
- return
- self._contact_caps.setdefault(handle, [])
+ ### ContactCapabilities interface ----------------------------------------
- if rcc in self._contact_caps[handle]:
+ def AdvertiseCapabilities(self, add, remove):
+ for caps, specs in add:
+ if caps == telepathy.CHANNEL_TYPE_STREAMED_MEDIA:
+ if specs & telepathy.CHANNEL_MEDIA_CAPABILITY_VIDEO:
+ self._msn_client.profile.client_id.has_webcam = True
+ self._msn_client.profile.client_id.supports_rtc_video = True
+ for caps in remove:
+ if caps == telepathy.CHANNEL_TYPE_STREAMED_MEDIA:
+ self._msn_client.profile.client_id.has_webcam = False
+
+ return telepathy.server.ConnectionInterfaceCapabilities.\
+ AdvertiseCapabilities(self, add, remove)
+
+ def UpdateCapabilities(self, caps):
+ if self._status != telepathy.CONNECTION_STATUS_CONNECTED:
+ self._update_capabilities_calls.append(caps)
return
- if self.audio_chat_class in self._contact_caps[handle]:
- self._contact_caps[handle].remove(self.audio_chat_class)
+ # We only care about voip.
+ for client, classes, capabilities in caps:
+ video = False
+ for channel_class in classes:
+ # Does this client support video?
+ if channel_class[telepathy.CHANNEL_INTERFACE + '.ChannelType'] == \
+ telepathy.CHANNEL_TYPE_STREAMED_MEDIA:
+ video = True
+ break
- if self.audio_chat_class in self._contact_caps[handle]:
- self._contact_caps[handle].remove(self.audio_chat_class)
+ if video and client not in self._video_clients:
+ self._video_clients.append(client)
+ elif not video and client in self._video_clients:
+ # *Did* it used to support video?
+ self._video_clients.remove(client)
- self._contact_caps[handle].append(rcc)
+ video = (len(self._video_clients) > 0)
+ changed = False
- ret = dbus.Dictionary({handle: self._contact_caps[handle]},
- signature='ua(a{sv}as)')
- self.ContactCapabilitiesChanged(ret)
+ # We've got no more clients that support video; remove the cap.
+ if not video and not self._video_clients:
+ self._msn_client.profile.client_id.has_webcam = False
+ changed = True
- def _get_capabilities(self, contact):
- gen_caps = 0
- spec_caps = 0
+ # We want video.
+ if video and (not self._msn_client.profile.client_id.has_webcam or
+ not self._msn_client.profile.client_id.supports_rtc_video):
+ self._msn_client.profile.client_id.has_webcam = True
+ self._msn_client.profile.client_id.supports_rtc_video = True
+ changed = True
- rcc = None
+ # Signal.
+ if changed:
+ updated = dbus.Dictionary({self._self_handle: self._contact_caps[self._self_handle]},
+ signature='ua(a{sv}as)')
+ self.ContactCapabilitiesChanged(updated)
+ def _get_contact_capabilities(self, contact):
+ contact_caps = []
caps = contact.client_capabilities
- #if caps.supports_sip_invite:
- #gen_caps |= telepathy.CONNECTION_CAPABILITY_FLAG_CREATE
- #gen_caps |= telepathy.CONNECTION_CAPABILITY_FLAG_INVITE
- #spec_caps |= telepathy.CHANNEL_MEDIA_CAPABILITY_AUDIO
- #spec_caps |= telepathy.CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_STUN
-
- #if caps.has_webcam:
- #spec_caps |= telepathy.CHANNEL_MEDIA_CAPABILITY_VIDEO
- #rcc = self.av_chat_class
- #else:
- #rcc = self.audio_chat_class
- return gen_caps, spec_caps, rcc
+ contact_caps.append(self.text_chat_class)
+ contact_caps.append(self.file_transfer_class)
+ if caps.supports_sip_invite:
+ if caps.has_webcam:
+ contact_caps.append(self.av_chat_class)
+ else:
+ contact_caps.append(self.audio_chat_class)
+
+ return contact_caps
+
+ def _update_contact_capabilities(self, handles):
+ caps = {}
+ for handle in handles:
+ caps[handle] = self._get_contact_capabilities(handle.contact)
+ self._contact_caps[handle] = caps[handle] # update global dict
+ ret = dbus.Dictionary(caps, signature='ua(a{sv}as)')
+ self.ContactCapabilitiesChanged(ret)
+
+
+ ### Initialization -------------------------------------------------------
@async
def _populate_capabilities(self):
@@ -278,10 +234,10 @@
handles = set([self._self_handle])
for contact in self.msn_client.address_book.contacts:
if contact.is_member(papyon.Membership.FORWARD):
- handle = ButterflyHandleFactory(self, 'contact',
- contact.account, contact.network_id)
+ handle = self.ensure_contact_handle(contact)
handles.add(handle)
- self.add_default_capabilities(handles)
+ self._add_default_capabilities(handles)
+ self._update_contact_capabilities(handles)
# These caps were updated before we were online.
for caps in self._update_capabilities_calls:
--- butterfly/channel/__init__.py
+++ butterfly/channel/__init__.py
@@ -36,8 +36,8 @@
# otherwise use InitiatorID.
elif telepathy.CHANNEL_INTERFACE + '.InitiatorID' in props:
- self._initiator = ButterflyHandleFactory(conn, 'contact',
- id=props[telepathy.CHANNEL_INTERFACE + '.InitiatorID'])
+ self._initiator = conn.ensure_handle(telepathy.HANDLE_TYPE_CONTACT,
+ props[telepathy.CHANNEL_INTERFACE + '.InitiatorID'])
# If we don't have either of the above but we requested the channel,
# then we're the initiator.
@@ -55,7 +55,7 @@
'InitiatorID': lambda: self._initiator.name
})
- self._add_immutables({
+ self._add_immutable_properties({
'InitiatorHandle': telepathy.CHANNEL_INTERFACE,
'InitiatorID': telepathy.CHANNEL_INTERFACE,
})
--- butterfly/channel/conference.py
+++ butterfly/channel/conference.py
@@ -26,7 +26,6 @@
import papyon.event
from butterfly.channel.muc import ButterflyMucChannel
-from butterfly.Channel_Interface_Conference import *
__all__ = ['ButterflyConferenceChannel']
@@ -34,11 +33,11 @@
class ButterflyConferenceChannel(
ButterflyMucChannel,
- ChannelInterfaceConference):
+ telepathy.server.ChannelInterfaceConference):
def __init__(self, conn, manager, conversation, props, object_path=None):
ButterflyMucChannel.__init__(self, conn, manager, conversation, props, object_path)
- ChannelInterfaceConference.__init__(self)
+ telepathy.server.ChannelInterfaceConference.__init__(self)
_, _, handle = manager._get_type_requested_handle(props)
@@ -61,36 +60,6 @@
# Invite contacts in InitialInvitee{IDs,Handles}
self._invite_initial_invitees(props, ic)
- # D-Bus properties for conference interface
- self._implement_property_get(CHANNEL_INTERFACE_CONFERENCE, {
- 'Channels':
- lambda: dbus.Array(self._conference_channels, signature='o'),
- 'InitialChannels':
- lambda: dbus.Array(self._conference_initial_channels,
- signature='o'),
- 'InitialInviteeHandles':
- lambda: dbus.Array(
- [h.get_id() for h in self._conference_initial_invitees],
- signature='u'),
- 'InitialInviteeIDs':
- lambda: dbus.Array(
- [h.get_name() for h in self._conference_initial_invitees],
- signature='s'),
- 'InvitationMessage':
- lambda: dbus.String(''),
- 'SupportsNonMerges':
- lambda: dbus.Boolean(True)
- })
-
- # Immutable conference properties
- self._add_immutables({
- 'InitialChannels': CHANNEL_INTERFACE_CONFERENCE,
- 'InitialInviteeIDs': CHANNEL_INTERFACE_CONFERENCE,
- 'InitialInviteeHandles': CHANNEL_INTERFACE_CONFERENCE,
- 'InvitationMessage': CHANNEL_INTERFACE_CONFERENCE,
- 'SupportsNonMerges': CHANNEL_INTERFACE_CONFERENCE
- })
-
def _get_initial_channels(self, props):
logger.info('Getting channels from InitialChannels')
ic_paths = props[CHANNEL_INTERFACE_CONFERENCE + '.InitialChannels']
@@ -137,11 +106,7 @@
# Get InitialInviteeIDs
for invitee_id in props.get(CHANNEL_INTERFACE_CONFERENCE + '.InitialInviteeIDs', []):
- handle = None
- for h in self._conn_ref()._handles.itervalues():
- if h.get_name() == invitee_id:
- handle = h
- break
+ handle = self._conn_ref().ensure_handle(telepathy.HANDLE_TYPE_CONTACT, invitee_id)
if handle is None or handle.contact is None:
raise telepathy.NotAvailable('Contact "%s" not available' % invitee_id)
--- butterfly/channel/contact_list.py
+++ butterfly/channel/contact_list.py
@@ -24,7 +24,6 @@
import papyon.event
from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
from butterfly.channel import ButterflyChannel
__all__ = ['ButterflyContactListChannelFactory']
@@ -97,18 +96,21 @@
props[telepathy.CHANNEL_INTERFACE + '.TargetHandleType'],
props[telepathy.CHANNEL_INTERFACE + '.TargetHandle'])
- if handle.get_name() == 'subscribe':
+ if handle.get_name() == 'stored':
+ raise telepathy.errors.NotImplemented
+ elif handle.get_name() == 'subscribe':
channel_class = ButterflySubscribeListChannel
elif handle.get_name() == 'publish':
channel_class = ButterflyPublishListChannel
elif handle.get_name() == 'hide':
- channel_class = ButterflyHideListChannel
+ raise telepathy.errors.NotImplemented
elif handle.get_name() == 'allow':
- channel_class = ButterflyAllowListChannel
+ raise telepathy.errors.NotImplemented
elif handle.get_name() == 'deny':
- channel_class = ButterflyDenyListChannel
+ raise telepathy.errors.NotImplemented
else:
- raise TypeError("Unknown list type : " + handle.get_name())
+ logger.error("Unknown list type : " + handle.get_name())
+ raise telepathy.errors.InvalidHandle
return channel_class(connection, manager, props)
@@ -139,8 +141,7 @@
ad, lp, rp = self._filter_contact(contact)
if ad or lp or rp:
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
if ad: added.add(handle)
if lp: local_pending.add(handle)
if rp: remote_pending.add(handle)
@@ -150,8 +151,7 @@
# papyon.event.AddressBookEventInterface
def on_addressbook_contact_deleted(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
ad, lp, rp = self._filter_contact(contact)
if self._contains_handle(handle) and not ad:
self.MembersChanged('', (), [handle], (), (), 0,
@@ -174,8 +174,7 @@
for contact in connection.msn_client.address_book.contacts:
ad, lp, rp = self._filter_contact(contact)
if ad or lp or rp:
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
if ad: added.add(handle)
if lp: local_pending.add(handle)
if rp: remote_pending.add(handle)
@@ -221,9 +220,11 @@
@Lockable(mutex, 'add_subscribe', 'finished_cb')
def _add(self, handle_id, message, finished_cb):
handle = self._conn.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
+ if handle is self._conn.GetSelfHandle():
+ return True # don't add ourself
if handle.contact is not None and \
handle.contact.is_member(papyon.Membership.FORWARD):
- return True
+ return True # contact already there
account = handle.account
network = handle.network
@@ -288,16 +289,18 @@
def _remove(self, handle_id, finished_cb):
handle = self._conn.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
contact = handle.contact
+ if handle is self._conn.GetSelfHandle():
+ return True # don't try to remove ourself
if contact is None or not contact.is_member(papyon.Membership.FORWARD):
- return True
+ return True # contact not in address book
+
ab = self._conn.msn_client.address_book
ab.delete_contact(contact, done_cb=(finished_cb,),
failed_cb=(finished_cb,))
# papyon.event.ContactEventInterface
def on_contact_memberships_changed(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
if contact.is_member(papyon.Membership.FORWARD):
self.MembersChanged('', [handle], (), (), (), 0,
telepathy.CHANNEL_GROUP_CHANGE_REASON_INVITED)
@@ -315,7 +318,8 @@
ButterflyListChannel.__init__(self, connection, manager, props,
object_path='RosterChannel/List/publish')
papyon.event.ContactEventInterface.__init__(self, connection.msn_client)
- self.GroupFlagsChanged(0, 0)
+ self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD |
+ telepathy.CHANNEL_GROUP_FLAG_CAN_REMOVE, 0)
def AddMembers(self, contacts, message):
for handle_id in contacts:
@@ -330,8 +334,7 @@
for contact in self._conn.msn_client.address_book.contacts:
if not contact.is_member(papyon.Membership.PENDING):
continue
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
result.append((handle, handle,
telepathy.CHANNEL_GROUP_CHANGE_REASON_INVITED,
contact.attributes.get('invite_message', '')))
@@ -346,14 +349,13 @@
def _add(self, handle_id, message, finished_cb):
handle = self._conn.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
contact = handle.contact
+ if handle is self._conn.GetSelfHandle():
+ return True # don't add ourself
if contact is not None and contact.is_member(papyon.Membership.ALLOW):
- return True
-
- # This will occur if the contact doesn't actually exist
- # (e.g. nobody at example.com).
+ return True # contact is already allowed
if contact is None:
logger.debug('Cannot allow/accept None contact %s' % handle.get_name())
- return True
+ return True # contact doesn't actually exist
account = handle.account
network = handle.network
@@ -370,6 +372,8 @@
handle = self._conn.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
contact = handle.contact
ab = self._conn.msn_client.address_book
+ if handle is self._conn.GetSelfHandle():
+ return True # don't try to remove ourself
if contact.is_member(papyon.Membership.PENDING):
ab.decline_contact_invitation(contact, False, done_cb=(finished_cb,),
failed_cb=(finished_cb,))
@@ -377,12 +381,11 @@
ab.disallow_contact(contact, done_cb=(finished_cb,),
failed_cb=(finished_cb,))
else:
- return True
+ return True # contact is neither pending or allowed
# papyon.event.ContactEventInterface
def on_contact_memberships_changed(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
if self._contains_handle(handle):
if contact.is_member(papyon.Membership.PENDING):
# Nothing worth our attention
--- butterfly/channel/file_transfer.py
+++ butterfly/channel/file_transfer.py
@@ -31,7 +31,6 @@
import socket
from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
from telepathy.interfaces import CHANNEL_TYPE_FILE_TRANSFER
@@ -75,9 +74,16 @@
self._filename = session.filename
self._size = session.size
- session.connect("accepted", self._transfer_accepted)
- session.connect("progressed", self._transfer_progressed)
- session.connect("completed", self._transfer_completed)
+ handles = []
+ handles.append(session.connect("accepted", self._transfer_accepted))
+ handles.append(session.connect("rejected", self._transfer_rejected))
+ handles.append(session.connect("canceled", self._transfer_canceled))
+ handles.append(session.connect("progressed", self._transfer_progressed))
+ handles.append(session.connect("completed", self._transfer_completed))
+ handles.append(session.connect("disposed", self._transfer_disposed))
+ self._handles = handles
+
+ self._sources = []
dbus_interface = telepathy.CHANNEL_TYPE_FILE_TRANSFER
self._implement_property_get(dbus_interface, {
@@ -167,22 +173,27 @@
def Close(self):
logger.debug("Close")
- self.cleanup()
- if self.state not in (telepathy.FILE_TRANSFER_STATE_CANCELLED,
- telepathy.FILE_TRANSFER_STATE_COMPLETED):
- self.set_state(telepathy.FILE_TRANSFER_STATE_CANCELLED,
- telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_CANCELLED)
+
+ try:
+ self.cancel()
+ if self.state != telepathy.FILE_TRANSFER_STATE_COMPLETED:
+ self.set_state(telepathy.FILE_TRANSFER_STATE_CANCELLED,
+ telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_STOPPED)
+
+ self.cleanup()
+ except:
+ pass
+
telepathy.server.ChannelTypeFileTransfer.Close(self)
- self.remove_from_connection()
- def cleanup(self):
+ def cancel(self):
if self._receiving and self.state == telepathy.FILE_TRANSFER_STATE_PENDING:
self._session.reject()
-
- if self.state not in (telepathy.FILE_TRANSFER_STATE_CANCELLED,
+ elif self.state not in (telepathy.FILE_TRANSFER_STATE_CANCELLED,
telepathy.FILE_TRANSFER_STATE_COMPLETED):
self._session.cancel()
+ def cleanup(self):
if self.socket:
self.socket.close()
self.socket = None
@@ -191,6 +202,11 @@
shutil.rmtree(self._tmpdir)
self._tmpdir = None
+ for handle in self._handles:
+ self._session.disconnect(handle)
+ self._handles = []
+ self._session = None
+
def GetSelfHandle(self):
return self._conn.GetSelfHandle()
@@ -208,14 +224,18 @@
sock.setblocking(False)
channel = gobject.IOChannel(sock.fileno())
channel.set_flags(channel.get_flags() | gobject.IO_FLAG_NONBLOCK)
- channel.add_watch(gobject.IO_IN, self._socket_connected)
- channel.add_watch(gobject.IO_HUP | gobject.IO_ERR,
- self._socket_disconnected)
+ self._sources.append(channel.add_watch(gobject.IO_IN,
+ self._socket_connected))
+ self._sources.append(channel.add_watch(gobject.IO_HUP | gobject.IO_ERR,
+ self._socket_disconnected))
return channel
def _socket_connected(self, channel, condition):
logger.debug("Client socket connected")
sock = self.socket.accept()[0]
+ for source in self._sources:
+ gobject.source_remove(source)
+ channel.close()
if self._receiving:
buffer = DataBuffer(sock)
self._session.set_receive_data_buffer(buffer, self.size)
@@ -228,11 +248,13 @@
def _socket_disconnected(self, channel, condition):
logger.debug("Client socket disconnected")
- #self.cleanup()
- #TODO only cancel if the socket is disconnected while listening
- #self._session.cancel()
- #self.set_state(telepathy.FILE_TRANSFER_STATE_CANCELLED,
- # telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR)
+ for source in self._sources:
+ gobject.source_remove(source)
+ channel.close()
+
+ self.cancel()
+ self.set_state(telepathy.FILE_TRANSFER_STATE_CANCELLED,
+ telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR)
def _transfer_accepted(self, session):
logger.debug("Transfer has been accepted")
@@ -241,6 +263,28 @@
self.set_state(telepathy.FILE_TRANSFER_STATE_OPEN,
telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_NONE)
+ def _transfer_rejected(self, session):
+ logger.debug("Transfer has been declined")
+ self.set_state(telepathy.FILE_TRANSFER_STATE_CANCELLED,
+ telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_REMOTE_STOPPED)
+
+ def _transfer_canceled(self, session):
+ logger.debug("Transfer has been cancelled")
+ self.set_state(telepathy.FILE_TRANSFER_STATE_CANCELLED,
+ telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_REMOTE_STOPPED)
+
+ def _transfer_completed(self, session, data):
+ logger.debug("Transfer completed")
+ self.set_state(telepathy.FILE_TRANSFER_STATE_COMPLETED,
+ telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_NONE)
+
+ def _transfer_disposed(self, session):
+ if self.state not in (telepathy.FILE_TRANSFER_STATE_CANCELLED,
+ telepathy.FILE_TRANSFER_STATE_COMPLETED):
+ logger.debug("Transfer has been disposed before completion")
+ self.set_state(telepathy.FILE_TRANSFER_STATE_CANCELLED,
+ telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_STOPPED)
+
def _transfer_progressed(self, session, size):
self._transferred += size
@@ -272,7 +316,7 @@
# Protect against clock skew, if the interval is negative the
# worst thing that can happen is that we wait an extra second
# before emitting the signal.
- interval = abs(interval)
+ interval = int(abs(interval))
if interval > 1000:
emit_signal()
@@ -280,12 +324,6 @@
self._progress_timer = gobject.timeout_add(1000 - interval,
emit_signal)
- def _transfer_completed(self, session, data):
- logger.debug("Transfer completed")
- self.set_state(telepathy.FILE_TRANSFER_STATE_COMPLETED,
- telepathy.FILE_TRANSFER_STATE_CHANGE_REASON_NONE)
- self.cleanup()
-
class DataBuffer(object):
def __init__(self, socket, size=0):
@@ -293,7 +331,6 @@
self._size = size
self._offset = 0
self._buffer = ""
- #self.add_channel()
def seek(self, offset, position):
if position == 0:
@@ -320,26 +357,3 @@
self._size += len(data)
self._offset += len(data)
self._socket.send(data)
-
- def add_channel(self):
- sock = self._socket
- sock.setblocking(False)
- channel = gobject.IOChannel(sock.fileno())
- channel.set_encoding(None)
- channel.set_buffered(False)
- channel.set_flags(channel.get_flags() | gobject.IO_FLAG_NONBLOCK)
- channel.add_watch(gobject.IO_HUP | gobject.IO_ERR, self.on_error)
- channel.add_watch(gobject.IO_IN | gobject.IO_PRI, self.on_stream_received)
- self.channel = channel
-
- def on_error(self, channel, condition):
- logger.error("DataBuffer %s" % condition)
-
- def on_stream_disconnected(self, channel, condition):
- pass
-
- def on_stream_received(self, channel, condition):
- logger.info("Received data to send")
- data = channel.read(1024)
- print data
- #self._session.send_chunk(data)
--- butterfly/channel/group.py
+++ butterfly/channel/group.py
@@ -24,7 +24,6 @@
import papyon.event
from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
from butterfly.channel.contact_list import ButterflyListChannel
__all__ = ['ButterflyGroupChannel']
@@ -108,6 +107,8 @@
logger.debug("Deleting group %s" % self._handle.name)
ab = self._conn.msn_client.address_book
group = self._handle.group
+ if len(ab.contacts.search_by_groups(group)) == 0:
+ raise telepathy.NotAvailable("Can't delete non-empty group")
ab.delete_group(group)
def _filter_contact(self, contact):
@@ -132,8 +133,7 @@
def on_addressbook_group_contact_added(self, group, contact):
group_name = group.name.decode("utf-8")
if group_name == self._handle.name:
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
added = set()
added.add(handle)
@@ -147,8 +147,7 @@
def on_addressbook_group_contact_deleted(self, group, contact):
group_name = group.name.decode("utf-8")
if group_name == self._handle.name:
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
removed = set()
removed.add(handle)
--- butterfly/channel/im.py
+++ butterfly/channel/im.py
@@ -28,7 +28,6 @@
import papyon
import papyon.event
-from butterfly.handle import ButterflyHandleFactory
from butterfly.channel.text import ButterflyTextChannel
from butterfly.Channel_Interface_Conference import CHANNEL_INTERFACE_CONFERENCE
@@ -136,8 +135,7 @@
# papyon.event.ConversationEventInterface
def on_conversation_user_joined(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
logger.info("User %s joined" % unicode(handle))
if self._initial_handle == handle:
@@ -147,7 +145,7 @@
telepathy.CHANNEL + '.ChannelType': dbus.String(telepathy.CHANNEL_TYPE_TEXT),
telepathy.CHANNEL + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_NONE),
CHANNEL_INTERFACE_CONFERENCE + '.InitialChannels': dbus.Array([self._object_path], signature='o'),
- CHANNEL_INTERFACE_CONFERENCE + '.InitialInviteeIDs': dbus.String(handle.get_name()),
+ CHANNEL_INTERFACE_CONFERENCE + '.InitialInviteeIDs': dbus.Array([dbus.String(handle.get_name())], signature='s'),
telepathy.CHANNEL + '.Requested': dbus.Boolean(False)
}
@@ -157,13 +155,19 @@
logger.info('Created new MUC channel to replace this 1-1 one: %s' % \
new_channel._object_path)
+ # papyon.event.ConversationEventInterface
+ def on_conversation_closed(self):
+ logger.info('Conversation closed')
+ self._offline_contact = self._initial_handle.contact
+ self._offline_handle = self._initial_handle
+ self._conversation = None
+
# papyon.event.ContactEventInterface
def on_contact_presence_changed(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
# Recreate a conversation if our contact join
if self._offline_contact == contact and contact.presence != papyon.Presence.OFFLINE:
- logger.info('Contact %s connected, inviting him to the text channel' % unicode(contact))
+ logger.info('Contact %s connected, inviting him to the text channel' % unicode(handle))
client = self._conn_ref().msn_client
self._conversation = papyon.Conversation(client, [contact])
papyon.event.ConversationEventInterface.__init__(self, self._conversation)
@@ -186,8 +190,7 @@
# when acked by the client
self._pending_offline_messages[id] = message
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- sender.account, sender.network_id)
+ handle = self._conn.ensure_contact_handle(sender)
type = telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL
logger.info("User %r sent a offline message" % handle)
self._signal_text_received(id, timestamp, handle, type, 0, message.display_name, text)
--- butterfly/channel/media.py
+++ butterfly/channel/media.py
@@ -25,7 +25,6 @@
import papyon.event
from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
from butterfly.media import ButterflySessionHandler
from butterfly.channel import ButterflyChannel
@@ -56,7 +55,6 @@
telepathy.server.ChannelInterfaceMediaSignalling.__init__(self)
papyon.event.CallEventInterface.__init__(self, call)
papyon.event.ContactEventInterface.__init__(self, conn.msn_client)
- papyon.event.MediaSessionEventInterface.__init__(self, call.media_session)
ButterflyChannel.__init__(self, conn, props)
self._call = call
@@ -99,9 +97,16 @@
if types:
self.RequestStreams(handle, types)
+ for stream in call.media_session._streams:
+ self.on_stream_created(stream)
+ for stream in call.media_session.streams:
+ self.on_stream_added(stream)
+ papyon.event.MediaSessionEventInterface.__init__(self, call.media_session)
+
def Close(self):
logger.info("Channel closed by client")
- self._call.end()
+ if self._call:
+ self._call.end()
def GetSessionHandlers(self):
return [(self._session_handler, self._session_handler.subtype)]
@@ -120,6 +125,11 @@
self._handle = self._conn.handle(telepathy.HANDLE_TYPE_CONTACT, handle)
streams = dbus.Array([], signature="a(uuuuuu)")
+
+ if self._call is None:
+ logger.warning("Call has already been closed")
+ return streams
+
for type in types:
handler = self._session_handler.CreateStream(type, 3)
handler.connect("state-changed", self.on_stream_state_changed)
@@ -153,10 +163,12 @@
def AddMembers(self, handles, message):
logger.info("Add members %r: %s" % (handles, message))
for handle in handles:
- print handle, self.GetSelfHandle()
- if handle == int(self.GetSelfHandle()):
- if self.GetSelfHandle() in self._local_pending:
+ print handle, int(self._conn.self_handle)
+ if handle == int(self._conn.self_handle):
+ if self._conn.self_handle in self._local_pending:
self._call.accept()
+ for handler in self._session_handler.ListStreams():
+ handler.send_candidates()
def RemoveMembers(self, handles, message):
logger.info("Remove members %r: %s" % (handles, message))
@@ -166,6 +178,7 @@
#papyon.event.call.CallEventInterface
def on_call_accepted(self):
+ logger.info("Call accepted")
self.on_call_answered(telepathy.MEDIA_STREAM_DIRECTION_BIDIRECTIONAL, 0)
#papyon.event.call.CallEventInterface
@@ -175,13 +188,15 @@
def on_call_answered(self, direction, pending_send):
for handler in self._session_handler.ListStreams():
handler.set_direction(direction, pending_send)
+ logger.info("Direction changed to %i, %i" % (direction,
+ pending_send))
self.StreamDirectionChanged(handler.id, direction, pending_send)
#papyon.event.call.CallEventInterface
def on_call_ended(self):
logger.info("Call has ended")
+ self._call = None
telepathy.server.ChannelTypeStreamedMedia.Close(self)
- self.remove_from_connection()
self._session_handler.remove_from_connection()
#papyon.event.media.MediaSessionEventInterface
@@ -211,7 +226,7 @@
#papyon.event.media.ContactEventInterface
def on_contact_presence_changed(self, contact):
- if contact == self._call.peer and \
+ if self._call is not None and contact == self._call.peer and \
contact.presence == papyon.Presence.OFFLINE:
logger.info("%s is now offline, closing channel" % contact)
self.Close()
@@ -221,7 +236,8 @@
self.StreamError(handler.id, error, message)
# TODO: properly remove the stream without ending the whole
# call unless it was the last stream of the session.
- self._call.end()
+ if self._call is not None:
+ self._call.end()
#StreamHandler event
def on_stream_state_changed(self, handler, state):
@@ -233,11 +249,11 @@
remote_pending = []
if self._call.incoming:
- local_pending.append(self._conn.GetSelfHandle())
+ local_pending.append(self._conn.self_handle)
added.append(self._handle)
else:
remote_pending.append(self._handle)
- added.append(self._conn.GetSelfHandle())
+ added.append(self._conn.self_handle)
self.MembersChanged('', added, [], local_pending, remote_pending,
0, telepathy.CHANNEL_GROUP_CHANGE_REASON_NONE)
--- butterfly/channel/muc.py
+++ butterfly/channel/muc.py
@@ -25,7 +25,6 @@
import papyon.event
from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
from butterfly.channel.text import ButterflyTextChannel
__all__ = ['ButterflyMucChannel']
@@ -55,15 +54,14 @@
def RemoveMembers(self, contacts, message):
# Group interface, only removing ourself is supported
- if int(self.GetSelfHandle()) in contacts:
+ if int(self._conn.self_handle) in contacts:
self.Close()
else :
raise telepathy.PermissionDenied
# papyon.event.ConversationEventInterface
def on_conversation_user_joined(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
logger.info("User %s joined" % unicode(handle))
if handle not in self._members:
@@ -72,8 +70,7 @@
# papyon.event.ConversationEventInterface
def on_conversation_user_left(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
logger.info("User %s left" % unicode(handle))
self.MembersChanged('', [], [handle], [], [],
@@ -88,11 +85,10 @@
@async
def __add_initial_participants(self):
handles = []
- handles.append(self._conn.GetSelfHandle())
+ handles.append(self._conn.self_handle)
if self._conversation:
for participant in self._conversation.participants:
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- participant.account, participant.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
handles.append(handle)
if handles:
--- butterfly/channel/text.py
+++ butterfly/channel/text.py
@@ -31,7 +31,6 @@
from telepathy._generated.Channel_Interface_Messages import ChannelInterfaceMessages
from telepathy.interfaces import CHANNEL_INTERFACE_MESSAGES
-from butterfly.handle import ButterflyHandleFactory
from butterfly.channel import ButterflyChannel
__all__ = ['ButterflyTextChannel']
@@ -60,7 +59,7 @@
ButterflyChannel.__init__(self, conn, props)
telepathy.server.ChannelInterfaceChatState.__init__(self)
ChannelInterfaceMessages.__init__(self)
- papyon.event.ConversationEventInterface.__init__(self, conn.msn_client)
+ papyon.event.ContactEventInterface.__init__(self, conn.msn_client)
self._implement_property_get(CHANNEL_INTERFACE_MESSAGES, {
'SupportedContentTypes': lambda: ["text/plain"] ,
@@ -81,11 +80,10 @@
def _remove_typing_timeouts(self):
# Remove any timeouts we had running.
- handle = ButterflyHandleFactory(self._conn_ref(), 'self')
-
if self._send_typing_notification_timeout != 0:
gobject.source_remove(self._send_typing_notification_timeout)
self._send_typing_notification_timeout = 0
+ handle = self._conn.self_handle
self.ChatStateChanged(handle, telepathy.CHANNEL_CHAT_STATE_ACTIVE)
for handle, tag in self._typing_notifications.items():
@@ -118,7 +116,7 @@
return set()
def _send_typing_notification(self):
- # No need to emit ChatStateChanged in this method becuase it will not
+ # No need to emit ChatStateChanged in this method because it will not
# have changed from composing otherwise this source will have been
# removed.
@@ -164,6 +162,7 @@
}, signature='sv')
if sender_nick not in (None, ''):
+ sender_nick = unicode(sender_nick, "utf-8")
headers[dbus.String('sender-nickname')] = dbus.String(sender_nick)
body = dbus.Dictionary({dbus.String('content-type'): dbus.String('text/plain'),
@@ -191,8 +190,7 @@
gobject.source_remove(self._send_typing_notification_timeout)
self._send_typing_notification_timeout = 0
- handle = ButterflyHandleFactory(self._conn_ref(), 'self')
- self.ChatStateChanged(handle, state)
+ self.ChatStateChanged(self._conn.GetSelfHandle(), state)
@dbus.service.method(telepathy.CHANNEL_TYPE_TEXT, in_signature='us', out_signature='',
async_callbacks=('_success', '_error'))
@@ -206,9 +204,9 @@
def Close(self):
if self._conversation is not None:
self._conversation.leave()
+ self._conversation = None
self._remove_typing_timeouts()
telepathy.server.ChannelTypeText.Close(self)
- self.remove_from_connection()
def GetPendingMessageContent(self, message_id, parts):
# We don't support pending message
@@ -254,7 +252,7 @@
# Redefine GetSelfHandle since we use our own handle
# as Butterfly doesn't have channel specific handles
def GetSelfHandle(self):
- return self._conn_ref().GetSelfHandle()
+ return self._conn.GetSelfHandle()
def _contact_typing_notification_timeout(self, handle):
# Contact hasn't sent a typing notification for ten seconds. He or she
@@ -265,8 +263,7 @@
# papyon.event.ConversationEventInterface
def on_conversation_user_typing(self, contact):
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- contact.account, contact.network_id)
+ handle = self._conn.ensure_contact_handle(contact)
logger.info("User %s is typing" % unicode(handle))
# Remove any previous timeout.
@@ -286,8 +283,7 @@
def on_conversation_message_received(self, sender, message):
id = self._recv_id
timestamp = int(time.time())
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- sender.account, sender.network_id)
+ handle = self._conn.ensure_contact_handle(sender)
type = telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL
logger.info("User %s sent a message" % unicode(handle))
content = re.sub('\r\n', '\n', message.content)
@@ -300,12 +296,19 @@
# We used to use (MESSAGE_TYPE_ACTION, "nudge") to send nudges, and our own
# "$contact sent you a nudge" string when receiving, but that's not very nice.
# We should implement this properly at some point. See fd.o#24699.
- handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
- sender.account, sender.network_id)
+ handle = self._conn.ensure_contact_handle(sender)
logger.info("User %s sent a nudge" % unicode(handle))
+ # papyon.event.ConversationEventInterface
+ def on_conversation_error(self, error_type, error):
+ logger.warning("Conversation error %s %s" % (str(error_type),
+ str(error)))
+ if error_type == papyon.event.ConversationErrorType.MESSAGE:
+ timestamp = int(time.time())
+ self.SendError(telepathy.CHANNEL_TEXT_SEND_ERROR_UNKNOWN, timestamp,
+ telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "")
+
@dbus.service.signal(telepathy.CHANNEL_INTERFACE_MESSAGES, signature='aa{sv}')
def MessageReceived(self, message):
id = message[0]['pending-message-id']
self._pending_messages2[id] = dbus.Array(message, signature='a{sv}')
-
--- butterfly/channel_manager.py
+++ butterfly/channel_manager.py
@@ -33,8 +33,6 @@
from butterfly.channel.media import ButterflyMediaChannel
from butterfly.handle import ButterflyHandleFactory
-from butterfly.Channel_Interface_Conference import CHANNEL_INTERFACE_CONFERENCE
-
__all__ = ['ButterflyChannelManager']
logger = logging.getLogger('Butterfly.ChannelManager')
@@ -84,61 +82,15 @@
__media_channel_id = 1
__ft_channel_id = 1
- def __init__(self, connection):
+ def __init__(self, connection, protocol):
telepathy.server.ChannelManager.__init__(self, connection)
- classes = [
- ({telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_TEXT,
- telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)},
- [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
- telepathy.CHANNEL_INTERFACE + '.TargetID']),
-
- ({telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_TEXT,
- telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_NONE)},
- [CHANNEL_INTERFACE_CONFERENCE + '.InitialChannels',
- CHANNEL_INTERFACE_CONFERENCE + '.InitialInviteeHandles',
- CHANNEL_INTERFACE_CONFERENCE + '.InitialInviteeIDs',
- CHANNEL_INTERFACE_CONFERENCE + '.InitialMessage',
- CHANNEL_INTERFACE_CONFERENCE + '.SupportsNonMerges'])
- ]
- self.implement_channel_classes(telepathy.CHANNEL_TYPE_TEXT, self._get_text_channel, classes)
-
- classes = [
- ({telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_CONTACT_LIST,
- telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_GROUP)},
- [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
- telepathy.CHANNEL_INTERFACE + '.TargetID']),
-
- ({telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_CONTACT_LIST,
- telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_LIST)},
- [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
- telepathy.CHANNEL_INTERFACE + '.TargetID'])
- ]
- self.implement_channel_classes(telepathy.CHANNEL_TYPE_CONTACT_LIST, self._get_list_channel, classes)
-
-# classes = [
-# ({telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_STREAMED_MEDIA,
-# telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)},
-# [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
-# telepathy.CHANNEL_INTERFACE + '.TargetID',
-# telepathy.CHANNEL_TYPE_STREAMED_MEDIA + '.InitialAudio',
-# telepathy.CHANNEL_TYPE_STREAMED_MEDIA + '.InitialVideo'])
-# ]
-# self.implement_channel_classes(telepathy.CHANNEL_TYPE_STREAMED_MEDIA, self._get_media_channel, classes)
-
- classes = [
- ({telepathy.CHANNEL_INTERFACE + '.ChannelType': telepathy.CHANNEL_TYPE_FILE_TRANSFER,
- telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)},
- [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
- telepathy.CHANNEL_INTERFACE + '.TargetID',
- telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.ContentType',
- telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Filename',
- telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Size',
- telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.ContentHash',
- telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Description',
- telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Date'])
- ]
- self.implement_channel_classes(telepathy.CHANNEL_TYPE_FILE_TRANSFER, self._get_ft_channel, classes)
+ self.set_requestable_channel_classes(protocol.requestable_channels)
+
+ self.implement_channel_classes(telepathy.CHANNEL_TYPE_TEXT, self._get_text_channel)
+ self.implement_channel_classes(telepathy.CHANNEL_TYPE_CONTACT_LIST, self._get_list_channel)
+ self.implement_channel_classes(telepathy.CHANNEL_TYPE_STREAMED_MEDIA, self._get_media_channel)
+ self.implement_channel_classes(telepathy.CHANNEL_TYPE_FILE_TRANSFER, self._get_ft_channel)
def _get_list_channel(self, props):
_, surpress_handler, handle = self._get_type_requested_handle(props)
@@ -168,7 +120,7 @@
# MUC which has been upgraded from a 1-1 chat
elif handle.get_type() == telepathy.HANDLE_TYPE_NONE \
- and CHANNEL_INTERFACE_CONFERENCE + '.InitialChannels' in props:
+ and telepathy.CHANNEL_INTERFACE_CONFERENCE + '.InitialChannels' in props:
channel = ButterflyConferenceChannel(self._conn, self, conversation, props,
object_path=path)
--- butterfly/connection.py
+++ butterfly/connection.py
@@ -51,66 +51,42 @@
papyon.event.InviteEventInterface,
papyon.event.OfflineMessagesEventInterface):
- _secret_parameters = set([
- 'password',
- 'http-proxy-password',
- 'https-proxy-password'
- ])
- _mandatory_parameters = {
- 'account' : 's',
- 'password' : 's'
- }
- _optional_parameters = {
- 'server' : 's',
- 'port' : 'q',
- 'http-proxy-server' : 's',
- 'http-proxy-port' : 'q',
- 'http-proxy-username' : 's',
- 'http-proxy-password' : 's',
- 'https-proxy-server' : 's',
- 'https-proxy-port' : 'q',
- 'https-proxy-username' : 's',
- 'https-proxy-password' : 's',
- 'http-method' : 'b',
- }
- _parameter_defaults = {
- 'server' : 'messenger.hotmail.com',
- 'port' : 1863,
- 'http-method' : False
- }
- def __init__(self, manager, parameters):
- self.check_parameters(parameters)
+ def __init__(self, protocol, manager, parameters):
+ protocol.check_parameters(parameters)
try:
account = unicode(parameters['account'])
self._server = (parameters['server'].encode('utf-8'), parameters['port'])
- # Build the proxies configurations
self._proxies = {}
+ self._direct_proxies = [None]
+ self._http_proxies = [None]
+ self._default_http_proxy = None
+ self._default_https_proxy = None
+
+ # Build the proxies configurations
+ self._try_http = parameters['http-method']
proxy = build_proxy_infos(parameters, 'http')
if proxy is not None:
- self._proxies['http'] = proxy
+ self._http_proxies = [proxy]
+ self._default_http_proxy = proxy
proxy = build_proxy_infos(parameters, 'https')
if proxy is not None:
- self._proxies['https'] = proxy
+ self._default_https_proxy = proxy
- self._suggested_proxies = []
-
- # If the HTTP proxy parameters have been set, don't try any
- # others proxies automatically.
- if 'http' not in self._proxies:
- self._fill_suggested_proxies()
- self._use_next_proxy()
+ self._fill_suggested_proxies()
+ self._use_next_proxy()
self._manager = weakref.proxy(manager)
- self._new_client(use_http=parameters['http-method'])
+ self._new_client(use_http=self._try_http)
self._account = (parameters['account'].encode('utf-8'),
parameters['password'].encode('utf-8'))
- self._channel_manager = ButterflyChannelManager(self)
+ self._channel_manager = ButterflyChannelManager(self, protocol)
# Call parent initializers
- telepathy.server.Connection.__init__(self, 'msn', account, 'butterfly')
+ telepathy.server.Connection.__init__(self, 'msn', account,
+ 'butterfly', protocol)
telepathy.server.ConnectionInterfaceRequests.__init__(self)
ButterflyPresence.__init__(self)
ButterflyAliasing.__init__(self)
@@ -119,7 +95,9 @@
ButterflyContacts.__init__(self)
ButterflyMailNotification.__init__(self)
- self.set_self_handle(ButterflyHandleFactory(self, 'self'))
+ self_handle = self.create_handle(telepathy.HANDLE_TYPE_CONTACT,
+ self._account[0])
+ self.set_self_handle(self_handle)
self.__disconnect_reason = telepathy.CONNECTION_STATUS_REASON_NONE_SPECIFIED
self._initial_presence = papyon.Presence.INVISIBLE
@@ -140,10 +118,11 @@
if use_http:
self._tried_http = True
self._msn_client = papyon.Client(self._server, self._proxies,
- papyon.transport.HTTPPollConnection)
+ papyon.transport.HTTPPollConnection, 18)
else:
self._tried_http = False
- self._msn_client = papyon.Client(self._server, self._proxies)
+ self._msn_client = papyon.Client(self._server, self._proxies,
+ version=18)
papyon.event.ClientEventInterface.__init__(self, self._msn_client)
papyon.event.InviteEventInterface.__init__(self, self._msn_client)
@@ -153,29 +132,60 @@
try:
import libproxy
except ImportError:
+ logger.warning("Please install libproxy python bindings to enable proxy support.")
return
factory = libproxy.ProxyFactory()
- proxies = factory.getProxies('http://gateway.messenger.msn.com/')
- # Remove socks proxies that papyon doesn't support.
- proxies = [p for p in proxies if p.startswith('http://') or p == 'direct://']
-
- if proxies:
- self._suggested_proxies = proxies
+ # Get DirectConnection proxies
+ proxies = factory.getProxies('none://messenger.msn.com:1863')
+ proxies = [self._parse_proxy(p) for p in proxies]
+ self._direct_proxies = proxies
+
+ # Get HTTP proxies (if not already set by a parameter)
+ if not self._default_http_proxy:
+ proxies = factory.getProxies('http://gateway.messenger.msn.com/')
+ proxies = [self._parse_proxy(p) for p in proxies]
+ self._http_proxies = proxies
+ if len(proxies) > 0:
+ self._default_http_proxy = proxies[0]
+
+ # Get HTTPS proxies (if not already set by a parameter)
+ if not self._default_https_proxy:
+ proxies = factory.getProxies('https://rsi.hotmail.com/rsi/rsi.asmx')
+ proxies = [self._parse_proxy(p) for p in proxies]
+ if len(proxies) > 0:
+ self._default_https_proxy = proxies[0]
def _use_next_proxy(self):
- if not self._suggested_proxies:
+ if not self._try_http and self._direct_proxies:
+ direct_proxy = self._direct_proxies.pop(0)
+ http_proxy = self._default_http_proxy
+ https_proxy = self._default_https_proxy
+ elif self._http_proxies:
+ self._try_http = True
+ direct_proxy = None
+ http_proxy = self._http_proxies.pop(0)
+ https_proxy = self._default_https_proxy
+ else:
return False
- # Use the first one.
- proxy = self._suggested_proxies.pop(0)
+ self._proxies['direct'] = direct_proxy
+ self._proxies['http'] = http_proxy
+ self._proxies['https'] = https_proxy
+
+ # Clean proxies (remove None)
+ for conn_type in ('direct', 'http', 'https'):
+ if conn_type not in self._proxies:
+ pass
+ proxy = self._proxies[conn_type]
+ if proxy is None:
+ del self._proxies[conn_type]
+ logger.info('Using %s proxy: %s' % (conn_type, proxy))
- if proxy == 'direct://':
- if 'http' in self._proxies:
- del self._proxies['http']
- return True
+ return True
+ def _parse_proxy(self, proxy):
# libproxy documentation states:
#
# * The format of the returned proxy strings are as follows:
@@ -183,12 +193,13 @@
# * - socks://[username:password@]proxy:port
# * - direct://
# etc.
- #
- # We've already removed every proxy other than http and
- # direct, and have dealt with direct, so any other element
- # will be an HTTP proxy:
- proxy = proxy[len('http://'):]
+ if proxy is None or proxy == "direct://":
+ return None
+
+ index = proxy.find("://")
+ ptype = proxy[0:index]
+ proxy = proxy[index + 3:]
# Get username and password out.
if '@' in proxy:
@@ -197,19 +208,12 @@
else:
user = password = None
- server, port = proxy.split(':')
+ if ':' in proxy:
+ server, port = proxy.split(':')
- self._proxies['http'] = \
- papyon.ProxyInfos(host=server, port=int(port), type='http',
+ return papyon.ProxyInfos(host=server, port=int(port), type=ptype,
user=user, password=password)
- if user:
- logger.info('Using proxy: http://%s:***@%s:%u' % (user, server, int(port)))
- else:
- logger.info('Using proxy: http://%s:%u' % (server, int(port)))
-
- return True
-
@property
def manager(self):
return self._manager
@@ -222,6 +226,44 @@
self.check_handle(handle_type, handle_id)
return self._handles[handle_type, handle_id]
+ def create_handle(self, handle_type, handle_name, **kwargs):
+ """Create new handle with given type and name."""
+ handle_id = self.get_handle_id()
+ handle = ButterflyHandleFactory(self, handle_type, handle_id,
+ handle_name, **kwargs)
+ if handle is None:
+ raise telepathy.NotAvailable('Handle type unsupported %d' % handle_type)
+ logger.info("New Handle %s" % unicode(handle))
+ self._handles[handle_type, handle_id] = handle
+ return handle
+
+ def is_valid_handle_name(self, handle_type, handle_name):
+ """Make sure the name is valid for this type of handle."""
+ if handle_type == telepathy.HANDLE_TYPE_CONTACT:
+ if '@' not in handle_name:
+ return False
+ if '.' not in handle_name.split("@", 1)[1]:
+ return False
+ return True
+
+ def normalize_handle_name(self, handle_type, handle_name):
+ """Normalize handle name so the name is consistent everywhere."""
+ if not self.is_valid_handle_name(handle_type, handle_name):
+ raise telepathy.InvalidHandle('TargetID %s not valid for type %d' %
+ (name, handle_type))
+ if handle_type == telepathy.HANDLE_TYPE_CONTACT:
+ return handle_name.lower().strip()
+ return handle_name
+
+ def ensure_contact_handle(self, contact):
+ """Build handle name for contact and ensure handle."""
+ if contact is None:
+ return telepathy.NoneHandler()
+ handle_type = telepathy.HANDLE_TYPE_CONTACT
+ extension = network_to_extension.get(contact.network_id, "")
+ handle_name = contact.account.lower() + extension
+ return self.ensure_handle(handle_type, handle_name, contact=contact)
+
def Connect(self):
if self._status == telepathy.CONNECTION_STATUS_DISCONNECTED:
logger.info("Connecting")
@@ -233,6 +275,15 @@
self.__disconnect_reason = telepathy.CONNECTION_STATUS_REASON_REQUESTED
if self._msn_client.state != papyon.event.ClientState.CLOSED:
self._msn_client.logout()
+ else:
+ self._disconnected()
+
+ def _disconnected(self):
+ logger.info("Disconnected")
+ self.StatusChanged(telepathy.CONNECTION_STATUS_DISCONNECTED,
+ self.__disconnect_reason)
+ self._channel_manager.close()
+ self._manager.disconnected(self)
def GetInterfaces(self):
# The self._interfaces set is only ever touched in ButterflyConnection.__init__,
@@ -248,34 +299,6 @@
return self._interfaces
- def RequestHandles(self, handle_type, names, sender):
- self.check_connected()
- self.check_handle_type(handle_type)
-
- handles = []
- for name in names:
- if handle_type == telepathy.HANDLE_TYPE_CONTACT:
- network_id = papyon.NetworkID.MSN
- for network, extension in network_to_extension.items():
- if name.endswith(extension):
- name = name[0:-len(extension)]
- network_id = network
- break
- contacts = self.msn_client.address_book.contacts.\
- search_by_account(name).\
- search_by_network_id(network_id)
- handle = ButterflyHandleFactory(self, 'contact',
- name, network_id)
- elif handle_type == telepathy.HANDLE_TYPE_LIST:
- handle = ButterflyHandleFactory(self, 'list', name)
- elif handle_type == telepathy.HANDLE_TYPE_GROUP:
- handle = ButterflyHandleFactory(self, 'group', name)
- else:
- raise telepathy.NotAvailable('Handle type unsupported %d' % handle_type)
- handles.append(handle.id)
- self.add_client_handle(handle, sender)
- return handles
-
def _generate_props(self, channel_type, handle, suppress_handler, initiator_handle=None):
props = {
telepathy.CHANNEL_INTERFACE + '.ChannelType': channel_type,
@@ -317,33 +340,33 @@
self.StatusChanged(telepathy.CONNECTION_STATUS_CONNECTING,
telepathy.CONNECTION_STATUS_REASON_REQUESTED)
elif state == papyon.event.ClientState.SYNCHRONIZED:
- handle = ButterflyHandleFactory(self, 'list', 'subscribe')
+ handle = self.ensure_handle(telepathy.HANDLE_TYPE_LIST, 'subscribe')
props = self._generate_props(telepathy.CHANNEL_TYPE_CONTACT_LIST,
handle, False)
self._channel_manager.channel_for_props(props, signal=True)
- handle = ButterflyHandleFactory(self, 'list', 'publish')
+ handle = self.ensure_handle(telepathy.HANDLE_TYPE_LIST, 'publish')
props = self._generate_props(telepathy.CHANNEL_TYPE_CONTACT_LIST,
handle, False)
self._channel_manager.channel_for_props(props, signal=True)
- #handle = ButterflyHandleFactory(self, 'list', 'hide')
+ #handle = self.ensure_handle(telepathy.HANDLE_TYPE_LIST, 'hide')
#props = self._generate_props(telepathy.CHANNEL_TYPE_CONTACT_LIST,
# handle, False)
#self._channel_manager.channel_for_props(props, signal=True)
- #handle = ButterflyHandleFactory(self, 'list', 'allow')
+ #handle = self.ensure_handle(telepathy.HANDLE_TYPE_LIST, 'allow')
#props = self._generate_propstelepathy.CHANNEL_TYPE_CONTACT_LIST,
# handle, False)
#self._channel_manager.channel_for_props(props, signal=True)
- #handle = ButterflyHandleFactory(self, 'list', 'deny')
+ #handle = self.ensure_handle(telepathy.HANDLE_TYPE_LIST, 'deny')
#props = self._generate_props(telepathy.CHANNEL_TYPE_CONTACT_LIST,
# handle, False)
#self._channel_manager.channel_for_props(props, signal=True)
for group in self.msn_client.address_book.groups:
- handle = ButterflyHandleFactory(self, 'group',
+ handle = self.ensure_handle(telepathy.HANDLE_TYPE_GROUP,
group.name.decode("utf-8"))
props = self._generate_props(
telepathy.CHANNEL_TYPE_CONTACT_LIST, handle, False)
@@ -363,15 +386,11 @@
self._client.profile.end_point_name = "PAPYON"
if (presence is not None) or (message is not None):
- self._presence_changed(ButterflyHandleFactory(self, 'self'),
+ self._presence_changed(self._self_handle,
self._client.profile.presence,
self._client.profile.personal_message)
elif state == papyon.event.ClientState.CLOSED:
- self.StatusChanged(telepathy.CONNECTION_STATUS_DISCONNECTED,
- self.__disconnect_reason)
- #FIXME
- self._channel_manager.close()
- self._advertise_disconnected()
+ self._disconnected()
# papyon.event.ClientEventInterface
def on_client_error(self, type, error):
@@ -381,11 +400,10 @@
# connect to HTTP if we're already connected and we lose
# connectivity (see fd.o#26147).
if self._status == telepathy.CONNECTION_STATUS_CONNECTING and \
- (self._tried_http is False or \
- (self._tried_http is True and self._use_next_proxy())):
+ self._use_next_proxy():
logger.info("Failed to connect, trying HTTP "
"(possibly again with another proxy)")
- self._new_client(use_http=True)
+ self._new_client(use_http=self._try_http)
self._msn_client.login(*self._account)
else:
self.__disconnect_reason = telepathy.CONNECTION_STATUS_REASON_NETWORK_ERROR
@@ -403,8 +421,7 @@
if len(conversation.participants) == 1:
p = list(conversation.participants)[0]
- handle = ButterflyHandleFactory(self, 'contact',
- p.account, p.network_id)
+ handle = self.ensure_contact_handle(p)
else:
handle = telepathy.server.handle.NoneHandle()
@@ -420,29 +437,24 @@
# papyon.event.InviteEventInterface
def on_invite_conference(self, call):
- logger.debug("Call invite, ignoring it")
- #logger.debug("Call invite")
- #handle = ButterflyHandleFactory(self, 'contact', call.peer.account,
- #call.peer.network_id)
-
- #props = self._generate_props(telepathy.CHANNEL_TYPE_STREAMED_MEDIA,
- #handle, False, initiator_handle=handle)
+ logger.debug("Call invite")
- #channel = self._channel_manager.channel_for_props(props,
- #signal=True, call=call)
+ handle = self.ensure_contact_handle(call.peer)
+ props = self._generate_props(telepathy.CHANNEL_TYPE_STREAMED_MEDIA,
+ handle, False, initiator_handle=handle)
+ channel = self._channel_manager.channel_for_props(props,
+ signal=True, call=call)
# papyon.event.InviteEventInterface
def on_invite_webcam(self, session, producer):
direction = (producer and "send") or "receive"
- logger.debug("Invitation to %s webcam, ignoring it" % direction)
- #logger.debug("Invitation to %s webcam" % direction)
+ logger.debug("Invitation to %s webcam" % direction)
- #handle = ButterflyHandleFactory(self, 'contact', session.peer.account,
- #session.peer.network_id)
- #props = self._generate_props(telepathy.CHANNEL_TYPE_STREAMED_MEDIA,
- #handle, False, initiator_handle=handle)
- #channel = self._channel_manager.channel_for_props(props, signal=True,
- #call=session)
+ handle = self.ensure_contact_handle(session.peer)
+ props = self._generate_props(telepathy.CHANNEL_TYPE_STREAMED_MEDIA,
+ handle, False, initiator_handle=handle)
+ channel = self._channel_manager.channel_for_props(props, signal=True,
+ call=session)
# papyon.event.OfflineMessagesEventInterface
def on_oim_messages_received(self, messages):
@@ -458,8 +470,8 @@
# Request butterfly text channel (creation, what happen when it exist)
sender = message.sender
logger.info('received offline message from %s : %s' % (sender.account, message.text))
- handle = ButterflyHandleFactory(self, 'contact',
- sender.account, sender.network_id)
+
+ handle = self.ensure_contact_handle(sender)
props = self._generate_props(telepathy.CHANNEL_TYPE_TEXT,
handle, False)
channel = self._channel_manager.channel_for_props(props,
@@ -470,17 +482,13 @@
# papyon.event.InviteEventInterface
def on_invite_file_transfer(self, session):
logger.debug("File transfer invite")
- handle = ButterflyHandleFactory(self, 'contact', session.peer.account,
- session.peer.network_id)
+ handle = self.ensure_contact_handle(session.peer)
props = self._generate_props(telepathy.CHANNEL_TYPE_FILE_TRANSFER,
handle, False)
channel = self._channel_manager.create_channel_for_props(props,
signal=True, session=session)
- def _advertise_disconnected(self):
- self._manager.disconnected(self)
-
def build_proxy_infos(parameters, proxy_type='http'):
server_key = proxy_type + '-proxy-server'
--- butterfly/connection_manager.py
+++ butterfly/connection_manager.py
@@ -21,7 +21,7 @@
import dbus
import logging
-from butterfly.connection import ButterflyConnection
+from butterfly.protocol import ButterflyProtocol
__all__ = ['ButterflyConnectionManager']
@@ -37,42 +37,11 @@
"Initializer"
telepathy.server.ConnectionManager.__init__(self, 'butterfly')
- self._protos['msn'] = ButterflyConnection
+ self._implement_protocol('msn', ButterflyProtocol)
+
self._shutdown = shutdown_func
logger.info("Connection manager created")
- def GetParameters(self, proto):
- "Returns the mandatory and optional parameters for the given proto."
- if proto not in self._protos:
- raise telepathy.NotImplemented('unknown protocol %s' % proto)
-
- result = []
- connection_class = self._protos[proto]
- secret_parameters = connection_class._secret_parameters
- mandatory_parameters = connection_class._mandatory_parameters
- optional_parameters = connection_class._optional_parameters
- default_parameters = connection_class._parameter_defaults
-
- for parameter_name, parameter_type in mandatory_parameters.iteritems():
- flags = telepathy.CONN_MGR_PARAM_FLAG_REQUIRED
- if parameter_name in secret_parameters:
- flags |= telepathy.CONN_MGR_PARAM_FLAG_SECRET
- param = (parameter_name, flags, parameter_type, '')
- result.append(param)
-
- for parameter_name, parameter_type in optional_parameters.iteritems():
- flags = 0
- default = ''
- if parameter_name in secret_parameters:
- flags |= telepathy.CONN_MGR_PARAM_FLAG_SECRET
- if parameter_name in default_parameters:
- flags |= telepathy.CONN_MGR_PARAM_FLAG_HAS_DEFAULT
- default = default_parameters[parameter_name]
- param = (parameter_name, flags, parameter_type, default)
- result.append(param)
-
- return result
-
def disconnected(self, conn):
def shutdown():
if self._shutdown is not None and \
@@ -80,11 +49,11 @@
self._shutdown()
return False
result = telepathy.server.ConnectionManager.disconnected(self, conn)
- gobject.timeout_add(5000, shutdown)
+ gobject.timeout_add_seconds(5, shutdown)
def quit(self):
"Terminates all connections. Must be called upon quit"
- conns = self._connections[:]
+ conns = self._connections.copy()
for connection in conns:
connection.Disconnect()
logger.info("Connection manager quitting")
--- butterfly/handle.py
+++ butterfly/handle.py
@@ -29,37 +29,16 @@
network_to_extension = {papyon.NetworkID.EXTERNAL: "#yahoo"}
-def ButterflyHandleFactory(connection, type, *args):
- mapping = {'self': ButterflySelfHandle,
- 'contact': ButterflyContactHandle,
- 'list': ButterflyListHandle,
- 'group': ButterflyGroupHandle}
- handle = mapping[type](connection, *args)
- connection._handles[handle.get_type(), handle.get_id()] = handle
+def ButterflyHandleFactory(connection, type, id, name, **kwargs):
+ mapping = {telepathy.HANDLE_TYPE_CONTACT: ButterflyContactHandle,
+ telepathy.HANDLE_TYPE_LIST: ButterflyListHandle,
+ telepathy.HANDLE_TYPE_GROUP: ButterflyGroupHandle}
+ handle = mapping[type](connection, id, name, **kwargs)
+ connection._handles[handle.type, handle.id] = handle
return handle
-class ButterflyHandleMeta(type):
- def __call__(cls, connection, *args):
- obj, newly_created = cls.__new__(cls, connection, *args)
- if newly_created:
- obj.__init__(connection, connection.get_handle_id(), *args)
- logger.info("New Handle %s" % unicode(obj))
- return obj
-
-
class ButterflyHandle(telepathy.server.Handle):
- __metaclass__ = ButterflyHandleMeta
-
- instances = weakref.WeakValueDictionary()
- def __new__(cls, connection, *args):
- key = (cls, connection._account[0], args)
- if key not in cls.instances.keys():
- instance = object.__new__(cls)
- cls.instances[key] = instance # TRICKY: instances is a weakdict
- return instance, True
- return cls.instances[key], False
-
def __init__(self, connection, id, handle_type, name):
telepathy.server.Handle.__init__(self, id, handle_type, name)
self._conn = weakref.proxy(connection)
@@ -73,30 +52,25 @@
return "<Butterfly%sHandle id=%u name='%s'>" % \
(type_str, self.id, self.name)
- id = property(telepathy.server.Handle.get_id)
- type = property(telepathy.server.Handle.get_type)
- name = property(telepathy.server.Handle.get_name)
-
-class ButterflySelfHandle(ButterflyHandle):
- instance = None
-
- def __init__(self, connection, id):
+class ButterflyContactHandle(ButterflyHandle):
+ def __init__(self, connection, id, contact_name, contact=None):
handle_type = telepathy.HANDLE_TYPE_CONTACT
- handle_name = connection._account[0]
- self._connection = connection
- ButterflyHandle.__init__(self, connection, id, handle_type, handle_name)
-
- @property
- def profile(self):
- return self._connection.msn_client.profile
+ handle_name = contact_name
+ self._contact = contact
+ if contact is None:
+ contact_account = contact_name.lower()
+ contact_network = papyon.NetworkID.MSN
+ for network, extension in network_to_extension.items():
+ if contact_name.endswith(extension):
+ contact_account = contact_name[0:-len(extension)]
+ contact_network = network
+ break
+ else:
+ contact_account = contact.account
+ contact_network = contact.network_id
-class ButterflyContactHandle(ButterflyHandle):
- def __init__(self, connection, id, contact_account, contact_network):
- extension = network_to_extension.get(contact_network, "")
- handle_type = telepathy.HANDLE_TYPE_CONTACT
- handle_name = contact_account + extension
self.account = contact_account
self.network = contact_network
self.pending_groups = set()
@@ -105,8 +79,14 @@
@property
def contact(self):
- return self._conn.msn_client.address_book.search_contact(self.account,
- self.network)
+ if self._contact is None:
+ if self.account == self._conn._msn_client.profile.account.lower() and \
+ self.network == papyon.NetworkID.MSN:
+ self._contact = self._conn.msn_client.profile
+ else:
+ self._contact = self._conn.msn_client.address_book.search_contact(
+ self.account, self.network)
+ return self._contact
class ButterflyListHandle(ButterflyHandle):
@@ -129,4 +109,3 @@
if group.name.decode("utf-8").lower() == self.name.lower():
return group
return None
-
--- butterfly/mail_notification.py
+++ butterfly/mail_notification.py
@@ -17,7 +17,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from base64 import b64encode, b64decode
-from butterfly.Connection_Interface_Mail_Notification import ConnectionInterfaceMailNotification
from string import join
import dbus.service
import logging
@@ -32,10 +31,6 @@
logger = logging.getLogger('Butterfly.MailNotification')
-# Interface name
-CONN_IFACE_MAIL_NOTIFICATION = \
- 'org.freedesktop.Telepathy.Connection.Interface.MailNotification.DRAFT'
-
# Mail_Notification_Flags (bitfield/set of flags, 0 for none)
MAIL_NOTIFICATION_FLAG_SUPPORTS_UNREAD_MAIL_COUNT = 1
MAIL_NOTIFICATION_FLAG_SUPPORTS_UNREAD_MAILS = 2
@@ -56,20 +51,17 @@
class ButterflyMailNotification(
telepathy.server.DBusProperties,
- ConnectionInterfaceMailNotification,
+ telepathy.server.ConnectionInterfaceMailNotification,
papyon.event.MailboxEventInterface):
def __init__(self):
logger.debug("Initialized")
telepathy.server.DBusProperties.__init__(self)
- ConnectionInterfaceMailNotification.__init__(self)
- # FIXME MSN Account is not always attached to an e-mail account. The
- # tp-python generator should allow sub-class initialisation without
- # adding the interface to the list. (see bug #26044)
- self._interfaces.remove(CONN_IFACE_MAIL_NOTIFICATION)
+ telepathy.server.ConnectionInterfaceMailNotification.__init__(self)
+ self._interfaces.remove(telepathy.CONNECTION_INTERFACE_MAIL_NOTIFICATION)
papyon.event.MailboxEventInterface.__init__(self, self.msn_client)
- self._implement_property_get(CONN_IFACE_MAIL_NOTIFICATION,
+ self._implement_property_get(telepathy.CONNECTION_INTERFACE_MAIL_NOTIFICATION,
{'MailNotificationFlags': lambda: self.mail_notification_flags,
'UnreadMailCount': lambda: self.unread_mail_count,
'MailAddress': lambda: self.mail_address})
@@ -82,7 +74,7 @@
Account support e-mail notification (see 'EmailEnabled' feild in
client profile)."""
- self._interfaces.add(CONN_IFACE_MAIL_NOTIFICATION)
+ self._interfaces.add(telepathy.CONNECTION_INTERFACE_MAIL_NOTIFICATION)
@property
@@ -112,7 +104,7 @@
pass
- @dbus.service.method(CONN_IFACE_MAIL_NOTIFICATION,
+ @dbus.service.method(telepathy.CONNECTION_INTERFACE_MAIL_NOTIFICATION,
in_signature='', out_signature='(sua(ss))',
async_callbacks=('_success', '_error'))
def RequestInboxURL(self, _success, _error):
--- butterfly/media/session_handler.py
+++ butterfly/media/session_handler.py
@@ -25,7 +25,6 @@
import papyon.event
from butterfly.util.decorator import async
-from butterfly.handle import ButterflyHandleFactory
from butterfly.media import ButterflyStreamHandler
from butterfly.media.constants import *
from papyon.media.constants import *
@@ -107,6 +106,9 @@
return handler
def NewStream(self, stream=None, handler=None):
+ if handler is None and stream is None:
+ logger.error("A stream or a handler must be given to NewStream")
+ return
if handler is None:
handler = self.FindStream(stream)
if not self._ready:
--- butterfly/media/stream_handler.py
+++ butterfly/media/stream_handler.py
@@ -46,6 +46,8 @@
self._interfaces = set()
self._callbacks = {}
+ self._ready = False
+ self._accepted = False
self._state = telepathy.MEDIA_STREAM_STATE_CONNECTING
self._direction = stream.direction
if self._stream.created_locally:
@@ -59,7 +61,6 @@
telepathy.server.DBusProperties.__init__(self)
telepathy.server.MediaStreamHandler.__init__(self, connection._name, path)
- papyon.event.MediaStreamEventInterface.__init__(self, stream)
self._implement_property_get(telepathy.interfaces.MEDIA_STREAM_HANDLER,
{'CreatedLocally': lambda: self.created_locally,
@@ -67,6 +68,12 @@
'STUNServers': lambda: self.stun_servers,
'RelayInfo': lambda: self.relay_info})
+ if stream._remote_candidates:
+ self.on_remote_candidates_received(stream._remote_candidates)
+ if stream._remote_codecs:
+ self.on_remote_codecs_received(stream._remote_codecs)
+ papyon.event.MediaStreamEventInterface.__init__(self, stream)
+
@property
def id(self):
return self._id
@@ -96,6 +103,10 @@
return self._stream.created_locally
@property
+ def ready_for_candidates(self):
+ return self._ready and (self._stream.created_locally or self._accepted)
+
+ @property
def nat_traversal(self):
if self._session.type is MediaSessionType.SIP:
return "wlm-8.5"
@@ -134,13 +145,14 @@
def Ready(self, codecs):
logger.info("Stream %i is ready" % self._id)
+ self._ready = True
is_webcam = (self._session.type is MediaSessionType.WEBCAM_SEND or
self._session.type is MediaSessionType.WEBCAM_RECV)
- if self._remote_candidates:
- self.SetRemoteCandidateList(self._remote_candidates)
if self._remote_codecs:
self.SetRemoteCodecs(self._remote_codecs)
+ if self._remote_candidates and self.ready_for_candidates:
+ self.SetRemoteCandidateList(self._remote_candidates)
self.SetStreamPlaying(self._direction &
telepathy.MEDIA_STREAM_DIRECTION_RECEIVE)
@@ -150,6 +162,11 @@
if self.created_locally or is_webcam:
self.SetLocalCodecs(codecs)
+ def send_candidates(self):
+ self._accepted = True
+ if self._remote_candidates and self.ready_for_candidates:
+ self.SetRemoteCandidateList(self._remote_candidates)
+
def StreamState(self, state):
logger.info("Stream %i state changed to %i" % (self._id, state))
self._state = state
@@ -197,7 +214,7 @@
def on_remote_candidates_received(self, candidates):
list = self.convert_media_candidates(candidates)
self._remote_candidates = list
- if self._stream.created_locally:
+ if list and self.ready_for_candidates:
self.SetRemoteCandidateList(list)
#papyon.event.MediaStreamEventInterface
@@ -286,8 +303,9 @@
base_port = port
elif ttype == telepathy.MEDIA_STREAM_TRANSPORT_TYPE_RELAY:
ttype = "relay"
- base_addr = None
- base_port = None
+ local_ip = self._conn.msn_client.local_ip
+ base_addr = local_ip
+ base_port = port
return MediaCandidate(id, component_id, proto, priority,
username, password, ttype, ip, port, base_addr, base_port)
--- butterfly/presence.py
+++ butterfly/presence.py
@@ -28,7 +28,6 @@
import telepathy.errors
import papyon
-from butterfly.handle import ButterflyHandleFactory
from butterfly.util.decorator import async
__all__ = ['ButterflyPresence']
@@ -94,9 +93,10 @@
papyon.event.ContactEventInterface.__init__(self, self.msn_client)
papyon.event.ProfileEventInterface.__init__(self, self.msn_client)
- dbus_interface = 'org.freedesktop.Telepathy.Connection.Interface.SimplePresence'
-
- self._implement_property_get(dbus_interface, {'Statuses' : self.get_statuses})
+ self._implement_property_get(
+ telepathy.CONNECTION_INTERFACE_SIMPLE_PRESENCE, {
+ 'Statuses' : lambda: self._protocol.statuses
+ })
def GetStatuses(self):
@@ -166,10 +166,7 @@
presences = {}
for handle_id in contacts:
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- try:
- contact = handle.contact
- except AttributeError:
- contact = handle.profile
+ contact = handle.contact
if contact is not None:
presence = ButterflyPresenceMapping.to_telepathy[contact.presence]
@@ -216,10 +213,7 @@
presences = dbus.Dictionary(signature='u(uss)')
for handle_id in contacts:
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, handle_id)
- try:
- contact = handle.contact
- except AttributeError:
- contact = handle.profile
+ contact = handle.contact
if contact is not None:
presence = ButterflyPresenceMapping.to_telepathy[contact.presence]
@@ -234,43 +228,9 @@
personal_message), signature='uss')
return presences
- def get_statuses(self):
- # you get one of these for each status
- # {name:(Type, May_Set_On_Self, Can_Have_Message}
- return dbus.Dictionary({
- ButterflyPresenceMapping.ONLINE:(
- telepathy.CONNECTION_PRESENCE_TYPE_AVAILABLE,
- True, True),
- ButterflyPresenceMapping.AWAY:(
- telepathy.CONNECTION_PRESENCE_TYPE_AWAY,
- True, True),
- ButterflyPresenceMapping.BUSY:(
- telepathy.CONNECTION_PRESENCE_TYPE_BUSY,
- True, True),
- ButterflyPresenceMapping.IDLE:(
- telepathy.CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY,
- True, True),
- ButterflyPresenceMapping.BRB:(
- telepathy.CONNECTION_PRESENCE_TYPE_AWAY,
- True, True),
- ButterflyPresenceMapping.PHONE:(
- telepathy.CONNECTION_PRESENCE_TYPE_AWAY,
- True, True),
- ButterflyPresenceMapping.LUNCH:(
- telepathy.CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY,
- True, True),
- ButterflyPresenceMapping.INVISIBLE:(
- telepathy.CONNECTION_PRESENCE_TYPE_HIDDEN,
- True, False),
- ButterflyPresenceMapping.OFFLINE:(
- telepathy.CONNECTION_PRESENCE_TYPE_OFFLINE,
- True, False)
- }, signature='s(ubb)')
-
# papyon.event.ContactEventInterface
def on_contact_presence_changed(self, contact):
- handle = ButterflyHandleFactory(self, 'contact',
- contact.account, contact.network_id)
+ handle = self.ensure_contact_handle(contact)
logger.info("Contact %s presence changed to '%s'" % (unicode(handle),
contact.presence))
self._presence_changed(handle, contact.presence, contact.personal_message)
@@ -281,7 +241,7 @@
# papyon.event.ProfileEventInterface
def on_profile_presence_changed(self):
profile = self.msn_client.profile
- self._presence_changed(ButterflyHandleFactory(self, 'self'),
+ self._presence_changed(self._self_handle,
profile.presence, profile.personal_message)
# papyon.event.ProfileEventInterface
--- butterfly/protocol.py
+++ butterfly/protocol.py
+# telepathy-butterfly - an MSN connection manager for Telepathy
+#
+# Copyright (C) 2010 Collabora Ltd.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import logging
+import dbus
+
+import telepathy
+import papyon
+import papyon.event
+
+from butterfly.connection import ButterflyConnection
+from butterfly.presence import ButterflyPresenceMapping
+
+__all__ = ['ButterflyProtocol']
+
+logger = logging.getLogger('Butterfly.Protocol')
+
+class ButterflyProtocol(telepathy.server.Protocol,
+ telepathy.server.ProtocolInterfacePresence):
+
+ _proto = "msn"
+ _vcard_field = ""
+ _english_name = "MSN"
+ _icon = "im-msn"
+
+ _secret_parameters = set([
+ 'password',
+ 'http-proxy-password',
+ 'https-proxy-password'
+ ])
+ _mandatory_parameters = {
+ 'account' : 's',
+ 'password' : 's'
+ }
+ _optional_parameters = {
+ 'server' : 's',
+ 'port' : 'q',
+ 'http-proxy-server' : 's',
+ 'http-proxy-port' : 'q',
+ 'http-proxy-username' : 's',
+ 'http-proxy-password' : 's',
+ 'https-proxy-server' : 's',
+ 'https-proxy-port' : 'q',
+ 'https-proxy-username' : 's',
+ 'https-proxy-password' : 's',
+ 'http-method' : 'b',
+ }
+ _parameter_defaults = {
+ 'server' : u'messenger.hotmail.com',
+ 'port' : 1863,
+ 'http-method' : False
+ }
+
+ _requestable_channel_classes = [
+ ({telepathy.CHANNEL_INTERFACE + '.ChannelType': dbus.String(telepathy.CHANNEL_TYPE_TEXT),
+ telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)},
+ [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
+ telepathy.CHANNEL_INTERFACE + '.TargetID']),
+
+ ({telepathy.CHANNEL_INTERFACE + '.ChannelType': dbus.String(telepathy.CHANNEL_TYPE_TEXT),
+ telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_NONE)},
+ [telepathy.CHANNEL_INTERFACE_CONFERENCE + '.InitialChannels',
+ telepathy.CHANNEL_INTERFACE_CONFERENCE + '.InitialInviteeHandles',
+ telepathy.CHANNEL_INTERFACE_CONFERENCE + '.InitialInviteeIDs',
+ telepathy.CHANNEL_INTERFACE_CONFERENCE + '.InitialMessage',
+ telepathy.CHANNEL_INTERFACE_CONFERENCE + '.SupportsNonMerges']),
+
+ ({telepathy.CHANNEL_INTERFACE + '.ChannelType': dbus.String(telepathy.CHANNEL_TYPE_CONTACT_LIST),
+ telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_GROUP)},
+ [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
+ telepathy.CHANNEL_INTERFACE + '.TargetID']),
+
+ ({telepathy.CHANNEL_INTERFACE + '.ChannelType': dbus.String(telepathy.CHANNEL_TYPE_CONTACT_LIST),
+ telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_LIST)},
+ [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
+ telepathy.CHANNEL_INTERFACE + '.TargetID']),
+
+ ({telepathy.CHANNEL_INTERFACE + '.ChannelType': dbus.String(telepathy.CHANNEL_TYPE_STREAMED_MEDIA),
+ telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)},
+ [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
+ telepathy.CHANNEL_INTERFACE + '.TargetID',
+ telepathy.CHANNEL_TYPE_STREAMED_MEDIA + '.InitialAudio',
+ telepathy.CHANNEL_TYPE_STREAMED_MEDIA + '.InitialVideo']),
+
+ ({telepathy.CHANNEL_INTERFACE + '.ChannelType': dbus.String(telepathy.CHANNEL_TYPE_FILE_TRANSFER),
+ telepathy.CHANNEL_INTERFACE + '.TargetHandleType': dbus.UInt32(telepathy.HANDLE_TYPE_CONTACT)},
+ [telepathy.CHANNEL_INTERFACE + '.TargetHandle',
+ telepathy.CHANNEL_INTERFACE + '.TargetID',
+ telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.ContentType',
+ telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Filename',
+ telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Size',
+ telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.ContentHash',
+ telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Description',
+ telepathy.CHANNEL_TYPE_FILE_TRANSFER + '.Date'])
+ ]
+
+ _supported_interfaces = [
+ telepathy.CONNECTION_INTERFACE_ALIASING,
+ telepathy.CONNECTION_INTERFACE_AVATARS,
+ telepathy.CONNECTION_INTERFACE_CAPABILITIES,
+ telepathy.CONNECTION_INTERFACE_CONTACT_CAPABILITIES,
+ telepathy.CONNECTION_INTERFACE_PRESENCE,
+ telepathy.CONNECTION_INTERFACE_SIMPLE_PRESENCE,
+ telepathy.CONNECTION_INTERFACE_CONTACTS,
+ telepathy.CONNECTION_INTERFACE_REQUESTS,
+ telepathy.CONNECTION_INTERFACE_MAIL_NOTIFICATION
+ ]
+
+ _statuses = {
+ ButterflyPresenceMapping.ONLINE:(
+ telepathy.CONNECTION_PRESENCE_TYPE_AVAILABLE,
+ True, True),
+ ButterflyPresenceMapping.AWAY:(
+ telepathy.CONNECTION_PRESENCE_TYPE_AWAY,
+ True, True),
+ ButterflyPresenceMapping.BUSY:(
+ telepathy.CONNECTION_PRESENCE_TYPE_BUSY,
+ True, True),
+ ButterflyPresenceMapping.IDLE:(
+ telepathy.CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY,
+ True, True),
+ ButterflyPresenceMapping.BRB:(
+ telepathy.CONNECTION_PRESENCE_TYPE_AWAY,
+ True, True),
+ ButterflyPresenceMapping.PHONE:(
+ telepathy.CONNECTION_PRESENCE_TYPE_AWAY,
+ True, True),
+ ButterflyPresenceMapping.LUNCH:(
+ telepathy.CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY,
+ True, True),
+ ButterflyPresenceMapping.INVISIBLE:(
+ telepathy.CONNECTION_PRESENCE_TYPE_HIDDEN,
+ True, False),
+ ButterflyPresenceMapping.OFFLINE:(
+ telepathy.CONNECTION_PRESENCE_TYPE_OFFLINE,
+ True, False)
+ }
+
+
+ def __init__(self, connection_manager):
+ telepathy.server.Protocol.__init__(self, connection_manager, 'msn')
+ telepathy.server.ProtocolInterfacePresence.__init__(self)
+
+ def create_connection(self, connection_manager, parameters):
+ return ButterflyConnection(self, connection_manager, parameters)
--- configure
+++ configure
@@ -1,13 +1,13 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for telepathy-butterfly 0.5.12.
+# Generated by GNU Autoconf 2.67 for telepathy-butterfly 0.5.15.
#
# Report bugs to <http://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=butterfly>.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -319,7 +319,7 @@
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -359,19 +359,19 @@
fi # as_fn_arith
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
- as_status=$?; test $as_status -eq 0 && as_status=1
- if test "$3"; then
- as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $1" >&2
+ $as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -533,7 +533,7 @@
exec 6>&1
# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -552,8 +552,8 @@
# Identity of this package.
PACKAGE_NAME='telepathy-butterfly'
PACKAGE_TARNAME='telepathy-butterfly'
-PACKAGE_VERSION='0.5.12'
-PACKAGE_STRING='telepathy-butterfly 0.5.12'
+PACKAGE_VERSION='0.5.15'
+PACKAGE_STRING='telepathy-butterfly 0.5.15'
PACKAGE_BUGREPORT='http://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=butterfly'
PACKAGE_URL=''
@@ -701,8 +701,9 @@
fi
case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
@@ -747,7 +748,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -773,7 +774,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid feature name: $ac_useropt"
+ as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -977,7 +978,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -993,7 +994,7 @@
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error "invalid package name: $ac_useropt"
+ as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1023,8 +1024,8 @@
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
;;
*=*)
@@ -1032,7 +1033,7 @@
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
@@ -1050,13 +1051,13 @@
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error "missing argument to $ac_option"
+ as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
- fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1079,7 +1080,7 @@
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1093,8 +1094,8 @@
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1109,9 +1110,9 @@
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error "working directory cannot be determined"
+ as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error "pwd does not report name of working directory"
+ as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
@@ -1150,11 +1151,11 @@
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1180,7 +1181,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures telepathy-butterfly 0.5.12 to adapt to many kinds of systems.
+\`configure' configures telepathy-butterfly 0.5.15 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1194,7 +1195,7 @@
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
+ -q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
@@ -1247,7 +1248,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of telepathy-butterfly 0.5.12:";;
+ short | recursive ) echo "Configuration of telepathy-butterfly 0.5.15:";;
esac
cat <<\_ACEOF
@@ -1321,10 +1322,10 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-telepathy-butterfly configure 0.5.12
-generated by GNU Autoconf 2.65
+telepathy-butterfly configure 0.5.15
+generated by GNU Autoconf 2.67
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1338,8 +1339,8 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by telepathy-butterfly $as_me 0.5.12, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+It was created by telepathy-butterfly $as_me 0.5.15, which was
+generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -1449,11 +1450,9 @@
{
echo
- cat <<\_ASBOX
-## ---------------- ##
+ $as_echo "## ---------------- ##
## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
@@ -1487,11 +1486,9 @@
)
echo
- cat <<\_ASBOX
-## ----------------- ##
+ $as_echo "## ----------------- ##
## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
@@ -1504,11 +1501,9 @@
echo
if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
+ $as_echo "## ------------------- ##
## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
@@ -1522,11 +1517,9 @@
fi
if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
+ $as_echo "## ----------- ##
## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
echo
cat confdefs.h
echo
@@ -1581,7 +1574,12 @@
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- ac_site_file1=$CONFIG_SITE
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
@@ -1596,7 +1594,11 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
done
@@ -1672,7 +1674,7 @@
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -1689,16 +1691,22 @@
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- for ac_t in install-sh install.sh shtool; do
- if test -f "$ac_dir/$ac_t"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/$ac_t -c"
- break 2
- fi
- done
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
done
if test -z "$ac_aux_dir"; then
- as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
@@ -1814,11 +1822,11 @@
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
esac
# Do `set' in a subshell so we don't clobber the current shell's
@@ -1840,7 +1848,7 @@
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- as_fn_error "ls -t appears to fail. Make sure there is not a broken
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
fi
@@ -1850,7 +1858,7 @@
# Ok.
:
else
- as_fn_error "newly created file is older than distributed files!
+ as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -2088,7 +2096,7 @@
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
@@ -2096,7 +2104,7 @@
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -2130,7 +2138,7 @@
am__isrc=' -I$(srcdir)'
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
- as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
fi
fi
@@ -2146,7 +2154,7 @@
# Define the identity of the package.
PACKAGE='telepathy-butterfly'
- VERSION='0.5.12'
+ VERSION='0.5.15'
cat >>confdefs.h <<_ACEOF
@@ -2225,7 +2233,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
- as_fn_error "too old" "$LINENO" 5
+ as_fn_error $? "too old" "$LINENO" 5
fi
am_display_PYTHON=$PYTHON
else
@@ -2309,7 +2317,7 @@
if test "$PYTHON" = :; then
- as_fn_error "no suitable Python interpreter found" "$LINENO" 5
+ as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5
else
@@ -2548,6 +2556,7 @@
ac_libobjs=
ac_ltlibobjs=
+U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -2710,19 +2719,19 @@
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
- as_status=$?; test $as_status -eq 0 && as_status=1
- if test "$3"; then
- as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
- $as_echo "$as_me: error: $1" >&2
+ $as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -2918,7 +2927,7 @@
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -2971,8 +2980,8 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by telepathy-butterfly $as_me 0.5.12, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+This file was extended by telepathy-butterfly $as_me 0.5.15, which was
+generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -3024,11 +3033,11 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-telepathy-butterfly config.status 0.5.12
-configured by $0, generated by GNU Autoconf 2.65,
+telepathy-butterfly config.status 0.5.15
+configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -3046,11 +3055,16 @@
while test $# != 0
do
case $1 in
- --*=*)
+ --*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
*)
ac_option=$1
ac_optarg=$2
@@ -3072,6 +3086,7 @@
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
@@ -3082,7 +3097,7 @@
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error "unrecognized option: \`$1'
+ -*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
@@ -3138,7 +3153,7 @@
"butterfly/media/Makefile") CONFIG_FILES="$CONFIG_FILES butterfly/media/Makefile" ;;
"data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
- *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
esac
done
@@ -3174,7 +3189,7 @@
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
@@ -3191,7 +3206,7 @@
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\r'
+ ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
@@ -3205,18 +3220,18 @@
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -3305,20 +3320,28 @@
else
cat
fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
- || as_fn_error "could not setup config files machinery" "$LINENO" 5
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
s/^[^=]*=[ ]*$//
}'
fi
@@ -3336,7 +3359,7 @@
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -3364,7 +3387,7 @@
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -3391,7 +3414,7 @@
case $ac_tag in
*:-:* | *:-) cat >"$tmp/stdin" \
- || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -3528,22 +3551,22 @@
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
+which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
+which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$tmp/stdin"
case $ac_file in
-) cat "$tmp/out" && rm -f "$tmp/out";;
*) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
esac \
- || as_fn_error "could not create $ac_file" "$LINENO" 5
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
@@ -3558,7 +3581,7 @@
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
- as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
@@ -3579,7 +3602,7 @@
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit $?
+ $ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
--- configure.ac
+++ configure.ac
@@ -6,7 +6,7 @@
dnl The telepathy-python version number (must actually be numeric at the moment)
m4_define(telepathy_butterfly_major_version, 0)
m4_define(telepathy_butterfly_minor_version, 5)
-m4_define(telepathy_butterfly_micro_version, 12)
+m4_define(telepathy_butterfly_micro_version, 15)
m4_define(telepathy_butterfly_maybe_datestamp,
m4_esyscmd([if test x]telepathy_butterfly_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
--- telepathy-butterfly
+++ telepathy-butterfly
@@ -25,18 +25,20 @@
import sys
import logging
+version = (0, 5, 15)
+
if sys.version_info < (2, 5):
print >> sys.stderr, 'Critical: python >= 2.5 required. Exiting.'
sys.exit(1)
import telepathy
-if telepathy.version < (0, 15, 17):
- print >> sys.stderr, 'Critical: telepathy-python >= 0.15.17 required. Exiting.'
+if telepathy.version < (0, 15, 19):
+ print >> sys.stderr, 'Critical: telepathy-python >= 0.15.19 required. Exiting.'
sys.exit(1)
import papyon
-if papyon.version < (0, 4, 9):
- print >> sys.stderr, 'Critical: papyon >= 0.4.9 required. Exiting.'
+if papyon.version < (0, 5, 3):
+ print >> sys.stderr, 'Critical: papyon >= 0.5.3 required. Exiting.'
sys.exit(1)
@@ -51,7 +53,7 @@
logger = logging.getLogger('Butterfly')
-IDLE_TIMEOUT = 5000
+IDLE_TIMEOUT = 5
PROCESS_NAME = 'telepathy-butterfly'
if __name__ == '__main__':
@@ -90,7 +92,7 @@
logger.info('No connection received - quitting')
quit()
return False
- gobject.timeout_add(IDLE_TIMEOUT, timeout_cb)
+ gobject.timeout_add_seconds(IDLE_TIMEOUT, timeout_cb)
shutdown_callback = quit
else:
shutdown_callback = None
@@ -104,6 +106,12 @@
logger.warning('Failed to acquire bus name, connection manager already running?')
sys.exit(1)
+ def v2str(version):
+ return ".".join(map(lambda x: str(x), version))
+ logger.info("Starting butterfly %s: telepathy-python %s, papyon %s" %
+ (v2str(version), v2str(telepathy.version), v2str(papyon.version)))
+
+
mainloop = gobject.MainLoop(is_running=True)
gobject.threads_init()
++++++ deleted files:
--- telepathy-butterfly.yaml
More information about the MeeGo-commits
mailing list