router: always update msg ID cache
Bridges can now return different message IDs in response to edits.
This commit is contained in:
@@ -140,10 +140,11 @@ func (r *Router) handleReceive() {
|
|||||||
for _, br := range gw.Bridges {
|
for _, br := range gw.Bridges {
|
||||||
msgIDs = append(msgIDs, gw.handleMessage(&msg, br)...)
|
msgIDs = append(msgIDs, gw.handleMessage(&msg, br)...)
|
||||||
}
|
}
|
||||||
// only add the message ID if it doesn't already exists
|
|
||||||
if _, ok := gw.Messages.Get(msg.Protocol + " " + msg.ID); !ok && msg.ID != "" {
|
// Always add/update the message ID. This is necessary as msgIDs
|
||||||
gw.Messages.Add(msg.Protocol+" "+msg.ID, msgIDs)
|
// will change if a bridge returns a different ID in response to edits.
|
||||||
}
|
gw.Messages.Add(msg.Protocol+" "+msg.ID, msgIDs)
|
||||||
|
|
||||||
idx++
|
idx++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user