mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-22 10:42:02 -08:00
Do not ignore empty messages with files for bridges that support it
This commit is contained in:
parent
46f5acc4f9
commit
f1e9833310
@ -152,7 +152,10 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
|
|||||||
// only slack now, check will have to be done in the different bridges.
|
// 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
|
// we need to check if we can't use fallback or text in other bridges
|
||||||
if msg.Extra != nil {
|
if msg.Extra != nil {
|
||||||
if dest.Protocol != "slack" {
|
if dest.Protocol != "discord" &&
|
||||||
|
dest.Protocol != "slack" &&
|
||||||
|
dest.Protocol != "mattermost" &&
|
||||||
|
dest.Protocol != "telegram" {
|
||||||
if msg.Text == "" {
|
if msg.Text == "" {
|
||||||
return brMsgIDs
|
return brMsgIDs
|
||||||
}
|
}
|
||||||
@ -210,8 +213,8 @@ func (gw *Gateway) ignoreMessage(msg *config.Message) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if msg.Text == "" {
|
if msg.Text == "" {
|
||||||
// we have an attachment
|
// we have an attachment or actual bytes
|
||||||
if msg.Extra != nil && msg.Extra["attachments"] != nil {
|
if msg.Extra != nil && (msg.Extra["attachments"] != nil || len(msg.Extra["file"]) > 0) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
log.Debugf("ignoring empty message %#v from %s", msg, msg.Account)
|
log.Debugf("ignoring empty message %#v from %s", msg, msg.Account)
|
||||||
|
Loading…
Reference in New Issue
Block a user