Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 4502:48afaec5d1de
mod_rest: Allow empty @to to mean to=account is in normal XMPP
Noticed an XXX in snikket-web-portal wrt needing to explicitly set @to
in order to talk to 'self' services in Prosody, where to=nil is the same
as to=account
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 07 Mar 2021 21:02:18 +0100 |
| parents | eea62d30ae08 |
| children | 80912726405d |
comparison
equal
deleted
inserted
replaced
| 4501:42f43f1383db | 4502:48afaec5d1de |
|---|---|
| 239 elseif payload.name ~= "message" and payload.name ~= "presence" and payload.name ~= "iq" then | 239 elseif payload.name ~= "message" and payload.name ~= "presence" and payload.name ~= "iq" then |
| 240 return post_errors.new("name"); | 240 return post_errors.new("name"); |
| 241 end | 241 end |
| 242 | 242 |
| 243 local to = jid.prep(payload.attr.to); | 243 local to = jid.prep(payload.attr.to); |
| 244 if not to then | 244 if payload.attr.to and not to then |
| 245 return post_errors.new("to"); | 245 return post_errors.new("to"); |
| 246 end | 246 end |
| 247 | 247 |
| 248 if payload.attr.from then | 248 if payload.attr.from then |
| 249 local requested_from = jid.prep(payload.attr.from); | 249 local requested_from = jid.prep(payload.attr.from); |
