mirror of https://github.com/kf7eel/hbnet.git
only add message to mailbox if user exists, comment out stuff
This commit is contained in:
parent
563d3ec1fd
commit
1bd7495b7d
18
bridge.py
18
bridge.py
|
|
@ -1116,15 +1116,15 @@ class routerHBP(HBSYSTEM):
|
|||
# just make a new one from the HBP header. This is good enough, and it saves lots of time
|
||||
else:
|
||||
self.STATUS[_slot]['RX_LC'] = LC_OPT + _dst_id + _rf_src
|
||||
# Download rules
|
||||
if _rf_src not in user_rules:
|
||||
user_rules[_rf_src] = self.name
|
||||
if _rf_src in user_rules:
|
||||
## print('in')
|
||||
if user_rules[_rf_src] != self.name:
|
||||
user_rules[_rf_src] = self.name
|
||||
## print('updated')
|
||||
## print(user_rules)
|
||||
## # Download rules
|
||||
## if _rf_src not in user_rules:
|
||||
## user_rules[_rf_src] = self.name
|
||||
## if _rf_src in user_rules:
|
||||
#### print('in')
|
||||
## if user_rules[_rf_src] != self.name:
|
||||
## user_rules[_rf_src] = self.name
|
||||
#### print('updated')
|
||||
#### print(user_rules)
|
||||
for _bridge in BRIDGES:
|
||||
## print(BRIDGES)
|
||||
## print(_bridge)
|
||||
|
|
|
|||
|
|
@ -1419,7 +1419,6 @@ def data_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _fr
|
|||
|
||||
## if int_id(_dst_id) == data_id:
|
||||
if int_id(_dst_id) in data_id:
|
||||
|
||||
process_sms(_rf_src, msg_found, _call_type, UNIT_MAP[_rf_src][0])
|
||||
## if int_id(_dst_id) != data_id:
|
||||
if int_id(_dst_id) not in data_id:
|
||||
|
|
|
|||
47
web/app.py
47
web/app.py
|
|
@ -3600,18 +3600,23 @@ Name: <strong>''' + p.name + '''</strong> - Port: <strong>''' + str(
|
|||
server = _server,
|
||||
system_name = _system_name
|
||||
)
|
||||
add_sms_mail = MailBox(
|
||||
snd_callsign = _snd_call,
|
||||
rcv_callsign = _rcv_call,
|
||||
message = _msg,
|
||||
time = datetime.datetime.utcnow(),
|
||||
snd_id = _snd_id,
|
||||
rcv_id = _rcv_id,
|
||||
server = _server,
|
||||
system_name = _system_name
|
||||
)
|
||||
# Only add to mailbox if user exists
|
||||
try:
|
||||
usr_nm = User.query.filter(User.dmr_ids.ilike('%' + str(_rcv_id) + '%')).first()
|
||||
add_sms_mail = MailBox(
|
||||
snd_callsign = _snd_call,
|
||||
rcv_callsign = str(usr_nm.username).upper(),
|
||||
message = _msg,
|
||||
time = datetime.datetime.utcnow(),
|
||||
snd_id = _snd_id,
|
||||
rcv_id = _rcv_id,
|
||||
server = _server,
|
||||
system_name = _system_name
|
||||
)
|
||||
db.session.add(add_sms_mail)
|
||||
except:
|
||||
pass
|
||||
db.session.add(add_sms)
|
||||
db.session.add(add_sms_mail)
|
||||
db.session.commit()
|
||||
|
||||
def mailbox_add(_snd_call, _rcv_call, _msg, _snd_id, _rcv_id, _server, _system_name):
|
||||
|
|
@ -5130,20 +5135,20 @@ Name: <strong>''' + p.name + '''</strong> - Port: <strong>''' + str(
|
|||
@roles_required('Admin')
|
||||
def test_peer_db():
|
||||
if request.args.get('save_mode'):
|
||||
if request.form.get('enabled') == 'true':
|
||||
peer_enabled = False
|
||||
use_acl = False
|
||||
unit_enabled = False
|
||||
peer_loose = True
|
||||
if request.form.get('enabled') == 'True':
|
||||
peer_enabled = True
|
||||
## if request.form.get('loose') == 'true':
|
||||
## peer_loose = True
|
||||
if request.form.get('use_acl') == 'true':
|
||||
if request.form.get('use_acl') == 'True':
|
||||
use_acl = True
|
||||
if request.form.get('enable_unit') == 'True':
|
||||
unit_enabled = True
|
||||
## else:
|
||||
## peer_loose = False
|
||||
peer_enabled = False
|
||||
use_acl = False
|
||||
unit_enabled = False
|
||||
peer_loose = True
|
||||
## print(request.form.get('enable_unit'))
|
||||
## print(enable_unit)
|
||||
if request.form.get('name_text') == '':
|
||||
|
|
@ -5202,8 +5207,8 @@ Name: <strong>''' + p.name + '''</strong> - Port: <strong>''' + str(
|
|||
<tr>
|
||||
<td style="width: 175.567px;"><strong> Active:</strong></td>
|
||||
<td style="width: 399.433px;"> <select name="enabled">
|
||||
<option value="true">True</option>
|
||||
<option value="false">False</option>
|
||||
<option value="True">True</option>
|
||||
<option value="False">False</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -5414,8 +5419,8 @@ Name: <strong>''' + p.name + '''</strong> - Port: <strong>''' + str(
|
|||
<td style="width: 175.567px;"><strong> Active:</strong></td>
|
||||
<td style="width: 399.433px;"> <select name="enabled">
|
||||
<option value="''' + str(p.enabled) + '''" selected>Current: ''' + str(p.enabled) + '''</option>
|
||||
<option value="true">True</option>
|
||||
<option value="false">False</option>
|
||||
<option value="True">True</option>
|
||||
<option value="False">False</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue