Don't print Sending EDU if there is noone to send to (#721)

The logs had a lot of:

```
Sending EDU event                             destinations="[]" edu_type=m.typing
```

Which is useless if it isn't actually sending the event anywhere (destinations is empty).
main
Andrew Morgan 2019-07-01 16:04:49 +01:00 committed by GitHub
parent a0dec456c1
commit 1eb77b8161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -96,9 +96,11 @@ func (oqs *OutgoingQueues) SendEDU(
// Remove our own server from the list of destinations. // Remove our own server from the list of destinations.
destinations = filterDestinations(oqs.origin, destinations) destinations = filterDestinations(oqs.origin, destinations)
if len(destinations) > 0 {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"destinations": destinations, "edu_type": e.Type, "destinations": destinations, "edu_type": e.Type,
}).Info("Sending EDU event") }).Info("Sending EDU event")
}
oqs.queuesMutex.Lock() oqs.queuesMutex.Lock()
defer oqs.queuesMutex.Unlock() defer oqs.queuesMutex.Unlock()