code: func (gw *Gateway) handleMessage(rmsg *config.Message, dest *bridge.Bridge) []*BrMsgID {
  	var brMsgIDs []*BrMsgID
  
  	// if we have an attached file, or other info
  	if rmsg.Extra != nil && len(rmsg.Extra[config.EventFileFailureSize]) != 0 && rmsg.Text == "" {
  		return brMsgIDs
  	}
  
  	if gw.ignoreEvent(rmsg.Event, dest) {
  		return brMsgIDs
  	}
  
  	// broadcast to every out channel (irc QUIT)
  	if rmsg.Channel == "" && rmsg.Event != config.EventJoinLeave {
  		gw.logger.Debug("empty channel")
  		return brMsgIDs
  	}
  
  	// Get the ID of the parent message in thread
  	var canonicalParentMsgID string
  	if rmsg.ParentID != "" && dest.GetBool("PreserveThreading") {
  		canonicalParentMsgID = gw.FindCanonicalMsgID(rmsg.Protocol, rmsg.ParentID)
  	}
  
  	channels := gw.getDestChannel(rmsg, *dest)
  	for idx := range channels {
  		channel := &channels[idx]
  		msgID, err := gw.SendMessage(rmsg, dest, channel, canonicalParentMsgID)
  		if err != nil {
  			gw.logger.Errorf("SendMessage failed: %s", err)
  			continue
  		}
  		if msgID == "" {
  			continue
  		}
  		brMsgIDs = append(brMsgIDs, &BrMsgID{dest, dest.Protocol + " " + msgID, channel.ID})
  	}
  	return brMsgIDs
  }
docs: // handleMessage makes sure the message get sent to the correct bridge/channels.
  // Returns an array of msg ID's