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: #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
2 changed files with 1 additions and 19 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
} }

View File

@ -11,24 +11,6 @@ So the XMPP-Address could be readed by Application-Server, Application and Distr
The XMPP Component implements [XEP-0225](https://xmpp.org/extensions/xep-0225.html) it could be plugged in at every common server (like [ejabberd](https://docs.ejabberd.im/admin/configuration/listen/#ejabberd-service) or [Prosody](https://prosody.im/doc/components)) with an Secret and domain name. The XMPP Component implements [XEP-0225](https://xmpp.org/extensions/xep-0225.html) it could be plugged in at every common server (like [ejabberd](https://docs.ejabberd.im/admin/configuration/listen/#ejabberd-service) or [Prosody](https://prosody.im/doc/components)) with an Secret and domain name.
## XMPP Specials
### Service Discovery XEP-0030
As Part of the XMPP-Component we implement the following result of an Service Discovery:
```xml
<iq type='result'
from='up.chat.sum7.eu'
id='iq-disco-request'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity
category='pubsub'
type='push'
name='Unified Push over XMPP'/>
<feature var='unifiedpush.org'/>
</query>
</iq
```
## Install ## Install
How to configure this gateway take a look into the [config_example.toml](config_example.toml), we prefer it place it under `/etc/up-gateway.conf` How to configure this gateway take a look into the [config_example.toml](config_example.toml), we prefer it place it under `/etc/up-gateway.conf`