Skip to content

Commit a38ac56

Browse files
authored
Merge branch 'main' into dev
2 parents 11985ec + ea7b92e commit a38ac56

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
6868
cache-to: type=gha,mode=max
6969
platforms: linux/amd64,linux/arm64
7070
# Build for both amd64 and arm64 architectures
71-
# This enables the image to run on both x86_64 and ARM devices (Raspberry Pi, Orange Pi, etc.)
71+
# This enables the image to run on both x86_64 and ARM devices (Raspberry Pi, Orange Pi, etc.)

config.ini.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,7 @@ auto_start = false
11331133
# Optional: database path for web viewer. If unset, the viewer uses [Bot] db_path (recommended).
11341134
# Only set this if you use a separate database for the viewer; you will see a startup warning.
11351135
# See docs/WEB_VIEWER.md for migrating from a separate database.
1136+
# db_path = meshcore_bot.db
11361137

11371138
# Additional hashtag channels to decode in the packet stream
11381139
# The web viewer can decrypt GroupText messages from hashtag channels

modules/commands/alternatives/wx_international.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ def matches_keyword(self, message: MeshMessage) -> bool:
109109
content = content[1:].strip()
110110
content_lower = content.lower()
111111
for keyword in self.keywords:
112-
# Match exact keyword or keyword followed by space
113-
if content_lower == keyword or content_lower.startswith(keyword + ' '):
112+
if content_lower.startswith(keyword + ' ') or content_lower == keyword:
114113
return True
115114
return False
116115

modules/commands/wx_command.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ def matches_keyword(self, message: MeshMessage) -> bool:
149149
content = content[1:].strip()
150150
content_lower = content.lower()
151151
for keyword in self.keywords:
152-
# Match exact keyword or keyword followed by space
153-
if content_lower == keyword or content_lower.startswith(keyword + ' '):
152+
if content_lower.startswith(keyword + ' ') or content_lower == keyword:
154153
return True
155154
return False
156155

modules/web_viewer/app.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ def inject_template_vars():
171171
self.logger.exception("Template context processor failed: %s", e)
172172
return dict(greeter_enabled=False, feed_manager_enabled=False, bot_name='MeshCore Bot')
173173

174+
def _get_db_path(self):
175+
"""Get the database path, falling back to [Bot] db_path if [Web_Viewer] db_path is unset"""
176+
# Use [Bot] db_path when [Web_Viewer] db_path is unset
177+
bot_db = self.config.get('Bot', 'db_path', fallback='meshcore_bot.db')
178+
if (self.config.has_section('Web_Viewer') and self.config.has_option('Web_Viewer', 'db_path')
179+
and self.config.get('Web_Viewer', 'db_path', fallback='').strip()):
180+
use_db = self.config.get('Web_Viewer', 'db_path').strip()
181+
else:
182+
use_db = bot_db
183+
return str(resolve_path(use_db, self.bot_root))
184+
174185
def _init_databases(self):
175186
"""Initialize database connections"""
176187
try:

0 commit comments

Comments
 (0)