def send_presence(self, elem):
        Log.warn("send_presence me: %r elem: %r" % (self.authJID, elem_to_str(elem)))
        # we want to send a presence
        direct = elem.get('to')
        if not direct:
            # not sending directly to one JID
            # send to everyone who is watching me
            self.rosters.broadcast(self, elem)
            if elem.get('type') != 'probe':
                # if it is not a probe, send a copy to the client also
                self.recv_presence(elem)
            if not self.probed:
                # if we have not probed our watch list, probe them
                self.probed = True
                self.rosters.probe(self)
            # check if rosters will handle this 
        elif not self.rosters.send(self, direct, elem):
            # if not, send it to the JID specified
            self.send(direct, elem)
dataset/ETHPy150Open HenryHu/pybbs/xmppserver.py/XMPPServer.send_presence/original