aboutsummaryrefslogtreecommitdiffstats
path: root/util/stanza.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-08-02 08:56:29 +0200
committerKim Alvefur <zash@zash.se>2019-08-02 08:56:29 +0200
commit6e624e01c69504684b4afc4e4b1499da2d957c3d (patch)
tree0000af7db070c6999f909bdd266ae0cec24a6cbb /util/stanza.lua
parent45a8e8ea7f8f4342a2ca2f8c0ea7d2bbb6591f8d (diff)
downloadprosody-6e624e01c69504684b4afc4e4b1499da2d957c3d.tar.gz
prosody-6e624e01c69504684b4afc4e4b1499da2d957c3d.zip
util.stanza: Use :text_tag internally everywhere
May allow future changes in a single place.
Diffstat (limited to 'util/stanza.lua')
-rw-r--r--util/stanza.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 7fe5c7ae..55c38c73 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -98,7 +98,7 @@ function stanza_mt:query(xmlns)
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 @@ local function message(attr, body)
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 @@ local function error_reply(orig, error_type, condition, error_message)
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