Ignore:
Timestamp:
Jan 8, 2012, 9:26:06 AM (9 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Expose locked state of a room on join response with room created status.

When the presence in response to a join includes the room created status code
(201), the client should configure the room before it can be used. To enable
this, the locked state of the room is now exposed through the Room.locked
attribute.

Also, update example MUC client to deal with newly created, locked rooms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_muc.py

    r161 r162  
    16641664        def cb(room):
    16651665            self.assertEqual(self.roomJID, room.roomJID)
    1666             self.assertTrue('joined', room.state)
     1666            self.assertFalse(room.locked)
    16671667
    16681668        d = self.protocol.join(self.roomJID, self.nick)
     
    16811681
    16821682
     1683    def test_joinLocked(self):
     1684        """
     1685        A new room is locked by default.
     1686        """
     1687
     1688        def cb(room):
     1689            self.assertTrue(room.locked, "Room is not marked as locked")
     1690
     1691        d = self.protocol.join(self.roomJID, self.nick)
     1692        d.addCallback(cb)
     1693
     1694        # send back user presence, they joined
     1695        xml = """
     1696            <presence from='%s@%s/%s'>
     1697              <x xmlns='http://jabber.org/protocol/muc#user'>
     1698                <item affiliation='owner' role='moderator'/>
     1699                <status code="110"/>
     1700                <status code="201"/>
     1701              </x>
     1702            </presence>
     1703        """ % (self.roomIdentifier, self.service, self.nick)
     1704        self.stub.send(parseXml(xml))
     1705        return d
     1706
     1707
    16831708    def test_joinForbidden(self):
    16841709        """
Note: See TracChangeset for help on using the changeset viewer.