Software /
code /
prosody
Comparison
util/stanza.lua @ 8889:c4e430c69f88
util.stanza: Verify that child tags added are really stanzas (closes #1165)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 08 Jun 2018 17:04:47 +0200 |
parent | 8645:06c73b010488 |
child | 8890:3490bc478804 |
comparison
equal
deleted
inserted
replaced
8888:cbcac5b9b7ce | 8889:c4e430c69f88 |
---|---|
133 self.last_add = nil; | 133 self.last_add = nil; |
134 return self; | 134 return self; |
135 end | 135 end |
136 | 136 |
137 function stanza_mt:add_direct_child(child) | 137 function stanza_mt:add_direct_child(child) |
138 if type(child) == "table" then | 138 if is_stanza(child) then |
139 t_insert(self.tags, child); | 139 t_insert(self.tags, child); |
140 end | 140 end |
141 t_insert(self, child); | 141 t_insert(self, child); |
142 end | 142 end |
143 | 143 |