Compare commits

...

2 Commits

Author SHA1 Message Date
genofire 612d577b21 fix validation of notifcation by sender/from address
continuous-integration/drone the build was successful Details
Reviewed-on: genofire/unified-push-xmpp#19
2021-09-21 11:34:56 +02:00
karmanyaahm 8eb9ba32b5 Add a not condition to an if statement
continuous-integration/drone the build was successful Details
2021-09-21 05:24:30 +02:00
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ func (s *XMPPService) message(msgHead stanza.Message, t xmlstream.TokenReadEncod
return nil return nil
} }
from := msgHead.From.String() from := msgHead.From.String()
if settings := strings.Split(conn.Settings, ":"); len(settings) > 1 && settings[0] == from { if settings := strings.Split(conn.Settings, ":"); !(len(settings) > 1 && settings[0] == from) {
log.WithField("from", from).Info("message not from gateway, that is no notification") log.WithField("from", from).Info("message not from gateway, that is no notification")
return nil return nil
} }