Mercurial > prosody-hg
comparison plugins/mod_http.lua @ 6054:7a5ddbaf758d
Merge 0.9->0.10
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 02 Apr 2014 17:41:38 +0100 |
| parents | 8c69cea8a1bf |
| children | 3b4fde51fa25 |
comparison
equal
deleted
inserted
replaced
| 6053:2f93a04564b2 | 6054:7a5ddbaf758d |
|---|---|
| 1 -- Prosody IM | 1 -- Prosody IM |
| 2 -- Copyright (C) 2008-2012 Matthew Wild | 2 -- Copyright (C) 2008-2012 Matthew Wild |
| 3 -- Copyright (C) 2008-2012 Waqas Hussain | 3 -- Copyright (C) 2008-2012 Waqas Hussain |
| 4 -- | 4 -- |
| 5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 module:set_global(); | 9 module:set_global(); |
| 109 else | 109 else |
| 110 module:log("error", "Invalid route in %s, %q. See http://prosody.im/doc/developers/http#routes", app_name, key); | 110 module:log("error", "Invalid route in %s, %q. See http://prosody.im/doc/developers/http#routes", app_name, key); |
| 111 end | 111 end |
| 112 end | 112 end |
| 113 end | 113 end |
| 114 | 114 |
| 115 local function http_app_removed(event) | 115 local function http_app_removed(event) |
| 116 local app_handlers = apps[event.item.name]; | 116 local app_handlers = apps[event.item.name]; |
| 117 apps[event.item.name] = nil; | 117 apps[event.item.name] = nil; |
| 118 for event, handler in pairs(app_handlers) do | 118 for event, handler in pairs(app_handlers) do |
| 119 module:unhook_object_event(server, event, handler); | 119 module:unhook_object_event(server, event, handler); |
| 120 end | 120 end |
| 121 end | 121 end |
| 122 | 122 |
| 123 module:handle_items("http-provider", http_app_added, http_app_removed); | 123 module:handle_items("http-provider", http_app_added, http_app_removed); |
| 124 | 124 |
| 125 server.add_host(host); | 125 server.add_host(host); |
| 126 function module.unload() | 126 function module.unload() |
| 127 server.remove_host(host); | 127 server.remove_host(host); |
