Software /
code /
prosody
Comparison
util/stanza.lua @ 3502:28887137bb1b
util.stanza: Make the current element <message> instead of <body> when body text is passed to st.message().
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 21 Sep 2010 17:24:25 +0500 |
parent | 3478:4621c92d2368 |
child | 3638:6f58a3063c14 |
comparison
equal
deleted
inserted
replaced
3501:90c18e0355af | 3502:28887137bb1b |
---|---|
341 | 341 |
342 function message(attr, body) | 342 function message(attr, body) |
343 if not body then | 343 if not body then |
344 return stanza("message", attr); | 344 return stanza("message", attr); |
345 else | 345 else |
346 return stanza("message", attr):tag("body"):text(body); | 346 return stanza("message", attr):tag("body"):text(body):up(); |
347 end | 347 end |
348 end | 348 end |
349 function iq(attr) | 349 function iq(attr) |
350 if attr and not attr.id then attr.id = new_id(); end | 350 if attr and not attr.id then attr.id = new_id(); end |
351 return stanza("iq", attr or { id = new_id() }); | 351 return stanza("iq", attr or { id = new_id() }); |