portmanager, s2smanager, sessionmanager, stanza_router, storagemanager, usermanager...
[prosody.git] / util / sasl.lua
index c8490842d4e0503d44d469697716c1c5b59591cd..b91e29a6cd51c4c8da4b54e8e4fec318f4c20488 100644 (file)
@@ -100,14 +100,16 @@ end
 function method:mechanisms()
        local current_mechs = {};
        for mech, _ in pairs(self.mechs) do
-               if mechanism_channelbindings[mech] and self.profile.cb then
-                       local ok = false;
-                       for cb_name, _ in pairs(self.profile.cb) do
-                               if mechanism_channelbindings[mech][cb_name] then
-                                       ok = true;
+               if mechanism_channelbindings[mech] then
+                       if self.profile.cb then
+                               local ok = false;
+                               for cb_name, _ in pairs(self.profile.cb) do
+                                       if mechanism_channelbindings[mech][cb_name] then
+                                               ok = true;
+                                       end
                                end
+                               if ok == true then current_mechs[mech] = true; end
                        end
-                       if ok == true then current_mechs[mech] = true; end
                else
                        current_mechs[mech] = true;
                end