On 2011-12-19 14:29 , MyCloud Service & Computers wrote:
Hi,

Hi Menno,

I have a question for the MUC example (muc_client.tac)
line 59:
"nick, text = message.body.split(':', 1)", Python (PyDev in eclipse)
complains about "nick"
and the "if text == u'hello':" is not triggering the greeting.

What was the error you were seeing?


I like to use this example also to "join" a muc when the muc is not
there yet (creating a new MUC) this looks like not working.
After join a not existing MUC it looks like the created MUC is not
accessible more from any client including the one that did create it?

Some servers enforce new rooms to be configured by the creator before they can be used. I didn't think of that when writing this example and while reviewing the code before including it into Wokkel's mainline. This behavior turns out to be required by XEP-0045, but the servers tested I against don't enforce it. E.g. Prosody seems to just create a room and act as if it already existed, effectively making it a regular join.


> Is there example code that supports creating a new MUC is it is not
> there and than join the MUC and be a "bot"?

As outlined in section 10 (<http://xmpp.org/extensions/xep-0045.html#createroom>), the client gets back a status code 201 when the join caused a room to be created. This is the cue to either accept the default configuration (by sending an empty configuration form) or to request the configuration form ('getConfiguration') and submit the completed form ('configure'). For user-facing clients, the form would of course be displayed to the user, but since you are talking about a bot, that would need to be done programmatically.

Unfortunately, the current implementation doesn't expose that status very conveniently and I would even go as far as to consider this a bug that needs to be fixed before I can release 0.7.0. I also discovered that submitting empty forms is not possible in the current implementation.

Thanks for the report!


One extra question,
- is the current MUC implementation capable to create a MUC with
password and join a MUC with password?

Making a room password protected is done using the room configuration form, so yes (once the above is properly fixed). Joining a password-protected room is done by providing the 'password' keyword argument to the 'join' method.

--
ralphm
_______________________________________________
Twisted-Jabber mailing list
[email protected]
https://mailman.ik.nu/mailman/listinfo/twisted-jabber

Reply via email to