Changeset 162:8bffd58d7b6d for doc/examples/muc_client.tac
- Timestamp:
- Jan 8, 2012, 9:26:06 AM (11 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/examples/muc_client.tac
r156 r162 16 16 17 17 from twisted.application import service 18 from twisted.python import log 18 19 from twisted.words.protocols.jabber.jid import JID 19 20 from wokkel.client import XMPPClient … … 42 43 """ 43 44 Once authorized, join the room. 45 46 If the join action causes a new room to be created, the room will be 47 locked until configured. Here we will just accept the default 48 configuration by submitting an empty form using L{configure}, which 49 usually results in a public non-persistent room. 50 51 Alternatively, you would use L{getConfiguration} to retrieve the 52 configuration form, and then submit the filled in form with the 53 required settings using L{configure}, possibly after presenting it to 54 an end-user. 44 55 """ 56 def joinedRoom(room): 57 if room.locked: 58 # Just accept the default configuration. 59 return self.configure(room.roomJID, {}) 60 45 61 MUCClient.connectionInitialized(self) 46 self.join(self.roomJID, self.nick) 62 63 d = self.join(self.roomJID, self.nick) 64 d.addCallback(joinedRoom) 65 d.addCallback(lambda _: log.msg("Joined room")) 66 d.addErrback(log.err, "Join failed") 67 47 68 48 69 def receivedGroupChat(self, room, user, message):
Note: See TracChangeset
for help on using the changeset viewer.