mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-22 01:10:27 +00:00
Handle file upload/download only once for each message (#742)
This commit is contained in:
parent
26a7e35f27
commit
120bf39f55
@ -125,6 +125,7 @@ func (r *Router) handleReceive() {
|
||||
r.handleEventGetChannelMembers(&msg)
|
||||
r.handleEventFailure(&msg)
|
||||
r.handleEventRejoinChannels(&msg)
|
||||
idx := 0
|
||||
for _, gw := range r.Gateways {
|
||||
// record all the message ID's of the different bridges
|
||||
var msgIDs []*BrMsgID
|
||||
@ -133,7 +134,9 @@ func (r *Router) handleReceive() {
|
||||
}
|
||||
msg.Timestamp = time.Now()
|
||||
gw.modifyMessage(&msg)
|
||||
if idx == 0 {
|
||||
gw.handleFiles(&msg)
|
||||
}
|
||||
for _, br := range gw.Bridges {
|
||||
msgIDs = append(msgIDs, gw.handleMessage(&msg, br)...)
|
||||
}
|
||||
@ -141,6 +144,7 @@ func (r *Router) handleReceive() {
|
||||
if _, ok := gw.Messages.Get(msg.Protocol + " " + msg.ID); !ok && msg.ID != "" {
|
||||
gw.Messages.Add(msg.Protocol+" "+msg.ID, msgIDs)
|
||||
}
|
||||
idx++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user