Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2008-05-08 13:50:35 (GMT)
committer Morgan Collett <morgan.collett@gmail.com>2008-06-13 14:59:34 (GMT)
commit7a62df6758254ee9b6bb764c1ccccb9b40627131 (patch)
tree95d29c9d028efcddb6d11eb7f82f22e3286f3c44 /src
parent35f08ef4fc1426b0d538d8a846b31c8e74ba307b (diff)
when receiving a private invitation, check that the channel is of type text before launching Chat
Diffstat (limited to 'src')
-rw-r--r--src/model/Owner.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/model/Owner.py b/src/model/Owner.py
index 73bd5da..7affb83 100644
--- a/src/model/Owner.py
+++ b/src/model/Owner.py
@@ -18,6 +18,8 @@
import gobject
import os
+from telepathy.interfaces import CHANNEL_TYPE_TEXT
+
from sugar import env
from sugar import profile
from sugar.presence import presenceservice
@@ -83,7 +85,7 @@ class ShellOwner(gobject.GObject):
activity.props.id)
def _private_invitation_cb(self, pservice, bus_name, connection,
- channel):
+ channel, channel_type):
"""Handle a private-invitation from Presence Service.
This is a connection by a non-Sugar XMPP client, so
@@ -95,7 +97,7 @@ class ShellOwner(gobject.GObject):
tp_channel = json.write([str(bus_name), str(connection),
str(channel)])
registry = activity.get_registry()
- if registry.get_activity('org.laptop.Chat'):
+ if registry.get_activity('org.laptop.Chat') and channel_type == CHANNEL_TYPE_TEXT:
activityfactory.create_with_uri('org.laptop.Chat', tp_channel)
def _activity_disappeared_cb(self, pservice, activity):