Thu, 26 Aug 2010 17:48:57 +0100
verse.plugins.disco: Add stream:add_disco_item()
plugins/disco.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/disco.lua Wed Aug 25 16:27:30 2010 +0100 +++ b/plugins/disco.lua Thu Aug 26 17:48:57 2010 +0100 @@ -99,6 +99,19 @@ end end + function stream:add_disco_item(item, node) + local disco_items = self.disco.items; + if node then + disco_items = self.disco.nodes[node]; + if not disco_items then + disco_items = { features = {}, items = {} }; + self.disco.nodes[node] = disco_items; + disco_items = disco_items.items; + end + end + table.insert(disco_items, item); + end + function stream:jid_has_identity(jid, category, type) local cached_disco = self.disco.cache[jid]; if not cached_disco then