mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-17 03:43:11 -06:00
Take copies of events before passing to destination queues
This commit is contained in:
parent
10bf6fee36
commit
ed1bc9d2ee
|
|
@ -177,7 +177,7 @@ func (s *OutputRoomEventConsumer) processMessage(ore api.OutputNewRoomEvent) err
|
||||||
|
|
||||||
// Send the event.
|
// Send the event.
|
||||||
return s.queues.SendEvent(
|
return s.queues.SendEvent(
|
||||||
&ore.Event, gomatrixserverlib.ServerName(ore.SendAsServer), joinedHostsAtEvent,
|
ore.Event, gomatrixserverlib.ServerName(ore.SendAsServer), joinedHostsAtEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ func (s *OutputRoomEventConsumer) processInvite(oie api.OutputNewInviteEvent) er
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the event.
|
// Send the event.
|
||||||
return s.queues.SendInvite(&inviteReq)
|
return s.queues.SendInvite(inviteReq)
|
||||||
}
|
}
|
||||||
|
|
||||||
// joinedHostsAtEvent works out a list of matrix servers that were joined to
|
// joinedHostsAtEvent works out a list of matrix servers that were joined to
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ func NewOutgoingQueues(
|
||||||
|
|
||||||
// SendEvent sends an event to the destinations
|
// SendEvent sends an event to the destinations
|
||||||
func (oqs *OutgoingQueues) SendEvent(
|
func (oqs *OutgoingQueues) SendEvent(
|
||||||
ev *gomatrixserverlib.HeaderedEvent, origin gomatrixserverlib.ServerName,
|
ev gomatrixserverlib.HeaderedEvent, origin gomatrixserverlib.ServerName,
|
||||||
destinations []gomatrixserverlib.ServerName,
|
destinations []gomatrixserverlib.ServerName,
|
||||||
) error {
|
) error {
|
||||||
if origin != oqs.origin {
|
if origin != oqs.origin {
|
||||||
|
|
@ -84,7 +84,7 @@ func (oqs *OutgoingQueues) SendEvent(
|
||||||
oqs.queuesMutex.Unlock()
|
oqs.queuesMutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
go oq.sendEvent(ev)
|
go oq.sendEvent(&ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -92,7 +92,7 @@ func (oqs *OutgoingQueues) SendEvent(
|
||||||
|
|
||||||
// SendEvent sends an event to the destinations
|
// SendEvent sends an event to the destinations
|
||||||
func (oqs *OutgoingQueues) SendInvite(
|
func (oqs *OutgoingQueues) SendInvite(
|
||||||
inviteReq *gomatrixserverlib.InviteV2Request,
|
inviteReq gomatrixserverlib.InviteV2Request,
|
||||||
) error {
|
) error {
|
||||||
ev := inviteReq.Event()
|
ev := inviteReq.Event()
|
||||||
stateKey := ev.StateKey()
|
stateKey := ev.StateKey()
|
||||||
|
|
@ -131,7 +131,7 @@ func (oqs *OutgoingQueues) SendInvite(
|
||||||
oqs.queuesMutex.Unlock()
|
oqs.queuesMutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
go oq.sendInvite(inviteReq)
|
go oq.sendInvite(&inviteReq)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue