Don't take copies again

This commit is contained in:
Neil Alexander 2020-05-05 17:14:23 +01:00
parent ade8352045
commit 4ff46624ff
2 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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
} }