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