Software /
code /
verse
Diff
plugins/disco.lua @ 113:769366a8b238
verse.plugins.disco: Add stream:remove_disco_feature()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 25 Aug 2010 16:18:12 +0100 |
parent | 112:4f8429727316 |
child | 115:9f8cacfca7c7 |
line wrap: on
line diff
--- a/plugins/disco.lua Wed Aug 25 13:21:25 2010 +0100 +++ b/plugins/disco.lua Wed Aug 25 16:18:12 2010 +0100 @@ -89,6 +89,15 @@ function stream:add_disco_feature(feature) table.insert(self.disco.info.features, {var=feature}); end + + function stream:remove_disco_feature(feature) + for idx, disco_feature in ipairs(self.disco.info.features) do + if disco_feature.var == feature then + table.remove(self.disco.info.features, idx); + return true; + end + end + end function stream:jid_has_identity(jid, category, type) local cached_disco = self.disco.cache[jid];