feat: Make the same domain policy configurable
This commit is contained in:
parent
c40390dd5c
commit
50983cae44
@ -6,6 +6,7 @@ BIWAPP = y # Warnmeldungen
|
||||
Recipients = some.user@xmpp.server,other@xmpp.server # Empfänger
|
||||
Timeout=630 # Zeit in Sekunden nach welcher nach neuen Warnungen geschaut wird
|
||||
DataDir = /etc/janine/data # Verzeichnis für persistente Daten
|
||||
SameDomain = True # Soll der Bot nur auf Nachrichten von der selben Domain antworten
|
||||
|
||||
[Bot]
|
||||
Avatar = /etc/janine/avatar.png # Bot Avatar (Optional)
|
||||
|
@ -135,8 +135,7 @@ class WarningBot:
|
||||
if not msg.body:
|
||||
return False
|
||||
|
||||
# TODO: Make this configurable
|
||||
if msg.from_.domain != self._jid.domain:
|
||||
if msg.from_.domain != self._jid.domain and self._same_domain:
|
||||
return False
|
||||
|
||||
return True
|
||||
@ -317,6 +316,7 @@ class WarningBot:
|
||||
self._data_dir = config['General'].get('DataDir', '/etc/janine')
|
||||
self._recipients = config['General']['Recipients'].split(',')
|
||||
self._refresh_timeout = int(config['General']['Timeout'])
|
||||
self._same_domain = config['General'].get('SameDomain', 'True') == 'True'
|
||||
|
||||
# Persistent data
|
||||
# Subscribed clients
|
||||
|
Loading…
Reference in New Issue
Block a user