# HG changeset patch # User Matthew Wild # Date 1331761185 0 # Node ID 01d52f31b6b36c8e4c8c96c202c4bfd0d1f3ae42 # Parent 7f45b2cb3c03622716540d25722ae2d859c33ee0 portmanager: Support item-added/net-provider (global and shared modules only!) diff -r 7f45b2cb3c03 -r 01d52f31b6b3 core/portmanager.lua --- a/core/portmanager.lua Wed Mar 14 21:39:02 2012 +0000 +++ b/core/portmanager.lua Wed Mar 14 21:39:45 2012 +0000 @@ -52,6 +52,15 @@ module("portmanager", package.seeall); +prosody.events.add_handler("item-added/net-provider", function (event) + local item = event.item; + register_service(item.name, item); +end); +prosody.events.add_handler("item-removed/net-provider", function (event) + local item = event.item; + unregister_service(item.name, item); +end); + --- Public API function activate_service(service_name)