From: Caio B. <cai...@gm...> - 2010-01-18 12:53:26
|
On Sat, Jan 16, 2010 at 9:38 PM, Norman Rasmussen <no...@ra...>wrote: > On Fri, Jan 15, 2010 at 7:18 PM, Caio Brentano <cai...@gm...>wrote: > >> Hi all >> >> I developed a little client just to send messages. It's ok to send >> messages directly to users. But I need to send messages to Conferences Room >> too. Any idea how can I do this? >> > > You need to send presence to the room to enter it before sending it a > message. Generally you send directed presence to room@server/Nick (where > Nick is the name of your client in the room). The room will then send you > presence and message history. As soon as you see yourself in the room you > can send it a message. so cl.sendPresence('room@server/Nick') should work > > The conference rooms in my company xmpp server requires Authentication. I >> didn't find anything about auth to rooms. >> > > You will need to create a Presence stanza, set the password, and send it > separately, something like this should work: > p = Presence('room@server/Nick) > p.setTag('x', namespace=NS_MUC).setTag('password', pass) > cl.send(p) > > I did this: p = xmpp.protocol.Presence('my_room@my_server/my_Nick') p.setTag('x', namespace=xmpp.protocol.NS_MUC).setTag('password', 'my_password') cnx.send(p) And got this errors: Traceback (most recent call last): File "./teste.py", line 14, in ? p.setTag('x', namespace=xmpp.protocol.NS_MUC).setTag('password', 'my_password') File "/home/semon/testePY/xmpp/simplexml.py", line 282, in setTag else: return self.addChild(name, attrs, namespace=namespace) File "/home/semon/testePY/xmpp/simplexml.py", line 164, in addChild else: newnode=Node(tag=name, parent=self, attrs=attrs, payload=payload) File "/home/semon/testePY/xmpp/simplexml.py", line 78, in __init__ for attr,val in attrs.items(): AttributeError: 'str' object has no attribute 'items' It seems that it doesn't know the attribute 'password'... Thanks... Thanks in advance! >> -- >> Caio Brentano >> >> >> ------------------------------------------------------------------------------ >> Throughout its 18-year history, RSA Conference consistently attracts the >> world's best and brightest in the field, creating opportunities for >> Conference >> attendees to learn about information security's most important issues >> through >> interactions with peers, luminaries and emerging and established >> companies. >> http://p.sf.net/sfu/rsaconf-dev2dev >> _______________________________________________ >> Xmpppy-devel mailing list >> Xmp...@li... >> https://lists.sourceforge.net/lists/listinfo/xmpppy-devel >> >> > > > -- > - Norman Rasmussen > - Email: no...@ra... > - Home page: http://norman.rasmussen.co.za/ > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for > Conference > attendees to learn about information security's most important issues > through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Xmpppy-devel mailing list > Xmp...@li... > https://lists.sourceforge.net/lists/listinfo/xmpppy-devel > > -- Caio Brentano |