Software /
code /
prosody
Comparison
util/stanza.lua @ 8894:7273fb6af831
util.stanza: Remove redundant check from :text now done in :add_direct_child
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 08 Jun 2018 17:44:44 +0200 |
parent | 8890:3490bc478804 |
child | 8999:a2a4c225a3f8 |
comparison
equal
deleted
inserted
replaced
8893:eb710675f7f8 | 8894:7273fb6af831 |
---|---|
114 return self; | 114 return self; |
115 end | 115 end |
116 | 116 |
117 function stanza_mt:text(text) | 117 function stanza_mt:text(text) |
118 if text ~= nil and text ~= "" then | 118 if text ~= nil and text ~= "" then |
119 check_text(text, "text"); | |
120 local last_add = self.last_add; | 119 local last_add = self.last_add; |
121 (last_add and last_add[#last_add] or self):add_direct_child(text); | 120 (last_add and last_add[#last_add] or self):add_direct_child(text); |
122 end | 121 end |
123 return self; | 122 return self; |
124 end | 123 end |