diff options
author | David Laban <david.laban@collabora.co.uk> | 2010-04-16 22:58:02 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2010-04-16 22:59:23 +0100 |
commit | ac478f447b0bf374c2833d4986584408df9efda1 (patch) | |
tree | f27bc2520874bc53b5014c7dfc79b2db6953d6fc | |
parent | daf779dd0460774b8108172d2a0ec3a9d79729e8 (diff) |
text channel: raise ValueError if a message ID is Received twice
Fixes fd.o#13623
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/server/channel.py | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -11,6 +11,9 @@ Fixes: * fd.o#27378: allow TargetHandle=0 when TargetHandleType=NONE. + * fd.o#13623: TextChannel should not send messages with the same id + more than once. + telepathy-python 0.15.17 (2010-03-12) ===================================== diff --git a/src/server/channel.py b/src/server/channel.py index 0c2dfa3..7a9d3d0 100644 --- a/src/server/channel.py +++ b/src/server/channel.py @@ -294,7 +294,10 @@ class ChannelTypeText(Channel, _ChannelTypeTextIface): @dbus.service.signal(CHANNEL_TYPE_TEXT, signature='uuuuus') def Received(self, id, timestamp, sender, type, flags, text): - self._pending_messages[id] = (timestamp, sender, type, flags, text) + if id in self._pending_messages: + raise ValueError("You can't receive the same message twice.") + else: + self._pending_messages[id] = (timestamp, sender, type, flags, text) from telepathy._generated.Channel_Interface_Chat_State \ |