Software /
code /
prosody
Comparison
util/error.lua @ 13079:e7a5e5a0dc02
Merge 0.12->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 19 Apr 2023 11:42:36 +0200 |
parent | 12975:d10957394a3c |
parent | 13078:6da83deb8d7f |
comparison
equal
deleted
inserted
replaced
13076:f4e33d17eaa8 | 13079:e7a5e5a0dc02 |
---|---|
139 local function from_stanza(stanza, context, source) | 139 local function from_stanza(stanza, context, source) |
140 local error_type, condition, text, extra_tag = stanza:get_error(); | 140 local error_type, condition, text, extra_tag = stanza:get_error(); |
141 local error_tag = stanza:get_child("error"); | 141 local error_tag = stanza:get_child("error"); |
142 context = context or {}; | 142 context = context or {}; |
143 context.stanza = stanza; | 143 context.stanza = stanza; |
144 context.by = error_tag.attr.by or stanza.attr.from; | 144 context.by = error_tag and error_tag.attr.by or stanza.attr.from; |
145 | 145 |
146 local uri; | 146 local uri; |
147 if condition == "gone" or condition == "redirect" then | 147 if condition == "gone" or condition == "redirect" then |
148 uri = error_tag:get_child_text(condition, "urn:ietf:params:xml:ns:xmpp-stanzas"); | 148 uri = error_tag:get_child_text(condition, "urn:ietf:params:xml:ns:xmpp-stanzas"); |
149 end | 149 end |