util.sasl: Adding clean_clone() method.
authorTobias Markmann <tm@ayena.de>
Thu, 26 Nov 2009 22:11:02 +0000 (23:11 +0100)
committerTobias Markmann <tm@ayena.de>
Thu, 26 Nov 2009 22:11:02 +0000 (23:11 +0100)
util/sasl.lua

index 7b7db0247ae50efa6537002a65fb71ed30562a20..e3ae8087d491016196470cae8f0baa8c133963b6 100644 (file)
@@ -90,6 +90,11 @@ function new(realm, profile, forbidden)
        return s;
 end
 
+-- get a fresh clone with the same realm, profiles and forbidden mechanisms
+function method:clean_clone()
+       return new(self.realm, self.profile, self:forbidden())
+end
+
 -- set the forbidden mechanisms
 function method:forbidden( restrict )
        if restrict then