def check_subdomain(subdomain, jid)
      comp = strip_domain(subdomain)
      return true if comp.domain == jid.domain
      local_jid?(jid) ? cross_domain?(comp, jid) : cross_domain?(comp)
    end
def check_subdomain(subdomain, jid)
      comp = strip_domain(subdomain)
      return true if comp.domain == jid.domain
      local_jid?(jid) ? cross_domain?(comp, jid) : cross_domain?(comp)
    end
Return true if the third-level subdomain JID (component or pubsub) is
 allowed to communicate with the other JID. For example,
 pubsub.wonderland.lit should be allowed to send messages to
 alice@wonderland.lit because they share the second-level wonderland.lit
 domain.