mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-26 07:29:24 +00:00
Relay attachments from mattermost to slack (slack). Closes #260
This commit is contained in:
@ -147,6 +147,17 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con
|
||||
|
||||
func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrMsgID {
|
||||
var brMsgIDs []*BrMsgID
|
||||
|
||||
// TODO refactor
|
||||
// only slack now, check will have to be done in the different bridges.
|
||||
// we need to check if we can't use fallback or text in other bridges
|
||||
if msg.Extra != nil {
|
||||
if dest.Protocol != "slack" {
|
||||
if msg.Text == "" {
|
||||
return brMsgIDs
|
||||
}
|
||||
}
|
||||
}
|
||||
// only relay join/part when configged
|
||||
if msg.Event == config.EVENT_JOIN_LEAVE && !gw.Bridges[dest.Account].Config.ShowJoinPart {
|
||||
return brMsgIDs
|
||||
@ -199,6 +210,10 @@ func (gw *Gateway) ignoreMessage(msg *config.Message) bool {
|
||||
return true
|
||||
}
|
||||
if msg.Text == "" {
|
||||
// we have an attachment
|
||||
if msg.Extra != nil {
|
||||
return false
|
||||
}
|
||||
log.Debugf("ignoring empty message %#v from %s", msg, msg.Account)
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user