# HG changeset patch # User Matthew Wild # Date 1328138843 0 # Node ID 57ac609444c48c408dbfc48ff38561ee312492f8 # Parent 8042558336b6afcb8abdd2d5bd02380fc63a41d6 mod_smacks: Only advertise stream features when a stream is authenticated, and doesn't already have smacks enabled diff -r 8042558336b6 -r 57ac609444c4 mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Mon Jan 30 04:20:24 2012 +0000 +++ b/mod_smacks/mod_smacks.lua Wed Feb 01 23:27:23 2012 +0000 @@ -21,13 +21,16 @@ module:hook("stream-features", function (event) - event.features:tag("sm", sm_attr):tag("optional"):up():up(); + local origin = event.origin; + if not(origin.smacks) and origin.type == "c2s" then + event.features:tag("sm", sm_attr):tag("optional"):up():up(); + end end); module:hook("s2s-stream-features", function (event) local origin = event.origin; - if s2s_smacks and (origin.type == "s2sin" or origin.type == "s2sout") then + if s2s_smacks and not(origin.smacks) and (origin.type == "s2sin" or origin.type == "s2sout") then event.features:tag("sm", sm_attr):tag("optional"):up():up(); end end);