fritzy / SleekXMPP

Python 2.6+/3.1+ XMPP Library
http://groups.google.com/group/sleekxmpp-discussion
Other
1.1k stars 299 forks source link

ClientXMPP.make_message creating invalid Messages? #176

Closed muchadhesion closed 12 years ago

muchadhesion commented 12 years ago

Hi,

I'm having trouble persuading ClientXMPP.make_message to create a valid Message.

In the ipython output below, I end up with a message with 2 html bodys. see [14] ...Of which only the first (empty one) is propagated to m["body"], see [15]

What am I doing wrong?

$ipython
In [1]: import sleekxmpp as s

In [12]: c = s.ClientXMPP( "person1@xmpp.example.com", "password")

In [13]: m = c.make_message( "person1@xmpp.example.com", "BODY", None, "chat", None, "person2@xmpp.example.com", None)

In [14]: m
<message to="person1@xmpp.example.com" type="chat" xml:lang="en" from="person2@xmpp.example.com"><body /><body>BODY</body></message>

In [15]: m.values
{'body': u'', u'lang': u'en', 'from': person2@xmpp.example.com, 'mucnick': '', 'mucroom': '', 'to': person1@xmpp.example.com, 'type': 'chat', 'id': u'', 'subject': u''}
legastero commented 12 years ago

Hi,

Which version are you using? 1.1.7 should have corrected that issue.

-- Lance

On Jun 22, 2012, at 11:17 AM, muchadhesion wrote:

Hi,

I'm having trouble persuading ClientXMPP.make_message to create a valid Message.

In the ipython output below, I end up with a message with 2 html s. see [14] ...Of which only the first (empty one) is propagated to m["body"], see [15]

What am I doing wrong?

$ipython
In [1]: import sleekxmpp as s

In [12]: c = s.ClientXMPP( "person1@xmpp.example.com", "password")

In [13]: m = c.make_message( "person1@xmpp.example.com", "BODY", None, "chat", None, "person2@xmpp.example.com", None)

In [14]: m
<message to="person1@xmpp.example.com" type="chat" xml:lang="en" from="person2@xmpp.example.com"><body /><body>BODY</body></message>

In [15]: m.values
{'body': u'', u'lang': u'en', 'from': person2@xmpp.example.com, 'mucnick': '', 'mucroom': '', 'to': person1@xmpp.example.com, 'type': 'chat', 'id': u'', 'subject': u''}

Reply to this email directly or view it on GitHub: https://github.com/fritzy/SleekXMPP/issues/176

muchadhesion commented 12 years ago

Wow. Thanks for the swift response. I'm on 1.1.5 I'll update. Many thanks.