forked from mudhorn/TC2-BBS-mesh
Make short_name case insensitive
Make short_name case insensitive and added config.ini to gitignore, added example_config.ini, and updated README
This commit is contained in:
parent
ab9449ad0b
commit
8bf833daa9
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ bulletins.db
|
|||
venv/
|
||||
.venv
|
||||
.idea
|
||||
config.ini
|
|
@ -54,7 +54,13 @@ If you're a Docker user, TC²-BBS Meshtastic is available on Docker Hub!
|
|||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
5. Set up the configuration in `config.ini`:
|
||||
5. Rename `example_config.ini`:
|
||||
|
||||
```sh
|
||||
mv example_config.ini config.ini
|
||||
```
|
||||
|
||||
6. Set up the configuration in `config.ini`:
|
||||
|
||||
**[interface]**
|
||||
If using `type = serial` and you have multiple devices connected, you will need to uncomment the `port =` line and enter the port of your device.
|
||||
|
|
|
@ -273,7 +273,7 @@ def handle_mail_steps(sender_id, message, step, state, interface, bbs_nodes):
|
|||
update_user_state(sender_id, None)
|
||||
|
||||
elif step == 3:
|
||||
short_name = message
|
||||
short_name = message.lower()
|
||||
nodes = get_node_info(interface, short_name)
|
||||
if not nodes:
|
||||
send_message("I'm unable to find that node in my database.", sender_id, interface)
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
[interface]
|
||||
type = serial
|
||||
# port = /dev/ttyACM0
|
||||
port = COM3
|
||||
# hostname = 192.168.x.x
|
||||
|
||||
|
||||
|
@ -30,5 +30,5 @@ type = serial
|
|||
# [sync]
|
||||
# bbs_nodes = !17d7e4b7,!18e9f5a3,!1a2b3c4d
|
||||
|
||||
# [sync]
|
||||
# bbs_nodes = !17d7e4b7
|
||||
[sync]
|
||||
bbs_nodes = !f53f441f
|
||||
|
|
34
example_config.ini
Normal file
34
example_config.ini
Normal file
|
@ -0,0 +1,34 @@
|
|||
###############################
|
||||
#### Select Interface type ####
|
||||
###############################
|
||||
# [type = serial] for USB connected devices
|
||||
#If there are multiple serial devices connected, be sure to use the "port" option and specify a port
|
||||
# Linux Example:
|
||||
# port = /dev/ttyUSB0
|
||||
#
|
||||
# Windows Example:
|
||||
# port = COM3
|
||||
# [type = tcp] for network connected devices (ESP32 devices only - this does not work for WisBlock)
|
||||
# If using tcp, remove the # from the beginning and replace 192.168.x.x with the IP address of your device
|
||||
# Example:
|
||||
# [interface]
|
||||
# type = tcp
|
||||
# hostname = 192.168.1.100
|
||||
|
||||
[interface]
|
||||
type = serial
|
||||
# port = /dev/ttyACM0
|
||||
# hostname = 192.168.x.x
|
||||
|
||||
|
||||
############################
|
||||
#### BBS NODE SYNC LIST ####
|
||||
############################
|
||||
# Provide a list of other nodes running TC²-BBS to sync mail messages and bulletins with
|
||||
# Enter in a list of other BBS Nodes by their nodeID separated by commas (no spaces)
|
||||
# Example:
|
||||
# [sync]
|
||||
# bbs_nodes = !17d7e4b7,!18e9f5a3,!1a2b3c4d
|
||||
|
||||
# [sync]
|
||||
# bbs_nodes = !17d7e4b7
|
2
utils.py
2
utils.py
|
@ -28,7 +28,7 @@ def send_message(message, destination, interface):
|
|||
def get_node_info(interface, short_name):
|
||||
nodes = [{'num': node_id, 'shortName': node['user']['shortName'], 'longName': node['user']['longName']}
|
||||
for node_id, node in interface.nodes.items()
|
||||
if node['user']['shortName'] == short_name]
|
||||
if node['user']['shortName'].lower() == short_name]
|
||||
return nodes
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue