Software /
code /
prosody
Changeset
10116:4807535b8673
util.stanza: Use :text_tag internally everywhere
May allow future changes in a single place.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 02 Aug 2019 08:56:29 +0200 |
parents | 10115:c0bd5daa9c7f |
children | 10117:8643b784626c |
files | util/stanza.lua |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/util/stanza.lua Thu Aug 01 05:25:34 2019 +0200 +++ b/util/stanza.lua Fri Aug 02 08:56:29 2019 +0200 @@ -98,7 +98,7 @@ end function stanza_mt:body(text, attr) - return self:tag("body", attr):text(text); + return self:text_tag("body", text, attr); end function stanza_mt:text_tag(name, text, attr, namespaces) @@ -417,7 +417,7 @@ if not body then return new_stanza("message", attr); else - return new_stanza("message", attr):tag("body"):text(body):up(); + return new_stanza("message", attr):text_tag("body", body); end end local function iq(attr) @@ -449,7 +449,7 @@ t.attr.type = "error"; t:tag("error", {type = error_type}) --COMPAT: Some day xmlns:stanzas goes here :tag(condition, xmpp_stanzas_attr):up(); - if error_message then t:tag("text", xmpp_stanzas_attr):text(error_message):up(); end + if error_message then t:text_tag("text", error_message, xmpp_stanzas_attr); end return t; -- stanza ready for adding app-specific errors end