Mercurial > prosody-modules
comparison mod_rtbl/mod_rtbl.lua @ 6302:13f674a9fb22
mod_rtbl: Correctly export API
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 31 Jul 2025 15:06:52 +0100 |
| parents | 77b5dd33a8f3 |
| children | d1d774f79ea8 |
comparison
equal
deleted
inserted
replaced
| 6301:77b5dd33a8f3 | 6302:13f674a9fb22 |
|---|---|
| 4 local set = require "util.set"; | 4 local set = require "util.set"; |
| 5 local st = require "util.stanza"; | 5 local st = require "util.stanza"; |
| 6 | 6 |
| 7 module:depends("pubsub_subscription"); | 7 module:depends("pubsub_subscription"); |
| 8 | 8 |
| 9 local function new_rtbl_subscription(rtbl_service_jid, rtbl_node, handlers) | 9 function new_rtbl_subscription(rtbl_service_jid, rtbl_node, handlers) |
| 10 local rtbl = {}; | 10 local rtbl = {}; |
| 11 local items = {}; | 11 local items = {}; |
| 12 rtbl.items = items; | 12 rtbl.items = items; |
| 13 | 13 |
| 14 local function notify(event_type, hash) | 14 local function notify(event_type, hash) |
| 121 module:hook("iq-result/host/"..request_id, update_list); | 121 module:hook("iq-result/host/"..request_id, update_list); |
| 122 module:add_timer(0, request_list); | 122 module:add_timer(0, request_list); |
| 123 | 123 |
| 124 return rtbl; | 124 return rtbl; |
| 125 end | 125 end |
| 126 | |
| 127 return { | |
| 128 new_rtbl_subscription = new_rtbl_subscription; | |
| 129 }; |
