[Bug 40734] Implement Channel.Interface.Subject

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Oct 28 01:50:01 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=40734

--- Comment #4 from Debarshi Ray <debarshi.ray at gmail.com> 2011-10-27 16:50:01 PDT ---
(In reply to comment #3)
> + send_command (self, cmd);
> + /* FIXME: don't return till we get a reply */
> + tp_svc_channel_interface_subject_return_from_set_subject (context);
> 
> Do you want me to fix this? I can, if you are terribly busy or something. :-)

I had some free time today, and so I made the SetSubject method not return till
we get a reply from the server and implemented a queueing system similar to the
RequestContactInfo method so that successive SetSubject calls get queued.

I tried to fix the test case but the following changes don't work:

diff --git a/tests/twisted/channels/muc-channel-topic.py
b/tests/twisted/channels/muc-channel-topic.py
index 0b7ccb3..4552895 100644
--- a/tests/twisted/channels/muc-channel-topic.py
+++ b/tests/twisted/channels/muc-channel-topic.py
@@ -37,10 +37,9 @@ def expect_and_check_can_set(q, channel, can_set):
         channel.Properties.Get(CHANNEL_IFACE_SUBJECT, 'CanSet'))

     if can_set:
-        # FIXME: this shouldn't return until the server gets back to us with
-        # RPL_TOPIC
-        channel.Subject2.SetSubject('what up')
-        e = q.expect('stream-TOPIC', data=[room, 'what up'])
+        call_async(q, channel.Subject2, 'SetSubject', 'what up')
+        q.expect_many(EventPattern('stream-TOPIC', data=[room, 'what up']),
+                      EventPattern('dbus-return', method='SetSubject'))
     else:
         call_async(q, channel.Subject2, 'SetSubject', 'boo hoo')
         q.expect('dbus-error', method='SetSubject',
@@ -90,8 +89,6 @@ def test(q, bus, conn, stream):
     assertEquals('', subject_props['Actor'])

     # Before the topic arrives from the server, check that our API works okay.
-    # FIXME: when we make SetSubject return asynchronously, this will need
-    # revising.
     test_can_set(q, stream, channel)

     # We're told the channel's topic, and (in a separte message) who set it
and

Wondering what can be wrong.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list