Mercurial > prosody-modules
comparison mod_post_msg/mod_post_msg.lua @ 1417:9b6fbababb8c
mod_post_msg: Fix indentation
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 28 May 2014 20:34:57 +0200 |
parents | e556219cb43d |
children | a0375f84d65a |
comparison
equal
deleted
inserted
replaced
1416:7ddb522d9b28 | 1417:9b6fbababb8c |
---|---|
46 message = msg({ to = to, from = authed_user, type = "chat"},request.body); | 46 message = msg({ to = to, from = authed_user, type = "chat"},request.body); |
47 end | 47 end |
48 elseif body_type == "application/x-www-form-urlencoded" then | 48 elseif body_type == "application/x-www-form-urlencoded" then |
49 local post_body = formdecode(request.body); | 49 local post_body = formdecode(request.body); |
50 message = msg({ to = post_body.to or to, from = authed_user, | 50 message = msg({ to = post_body.to or to, from = authed_user, |
51 type = post_body.type or "chat"}, post_body.body); | 51 type = post_body.type or "chat"}, post_body.body); |
52 if post_body.html then | 52 if post_body.html then |
53 local html, err = xml.parse(post_body.html); | 53 local html, err = xml.parse(post_body.html); |
54 if not html then | 54 if not html then |
55 module:log("warn", "mod_post_msg: invalid XML: %s", err); | 55 module:log("warn", "mod_post_msg: invalid XML: %s", err); |
56 return 400; | 56 return 400; |
57 end | 57 end |
58 message:tag("html", {xmlns="http://jabber.org/protocol/xhtml-im"}):add_child(html):up(); | 58 message:tag("html", {xmlns="http://jabber.org/protocol/xhtml-im"}):add_child(html):up(); |
59 end | 59 end |
60 else | 60 else |
61 return 415; | 61 return 415; |
62 end | 62 end |
63 if message and message.attr.to then | 63 if message and message.attr.to then |