mmrelay 1.0.7__tar.gz → 1.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mmrelay might be problematic. Click here for more details.
- {mmrelay-1.0.7 → mmrelay-1.0.8}/MANIFEST.in +0 -2
- {mmrelay-1.0.7/src/mmrelay.egg-info → mmrelay-1.0.8}/PKG-INFO +24 -48
- {mmrelay-1.0.7 → mmrelay-1.0.8}/README.md +21 -45
- {mmrelay-1.0.7 → mmrelay-1.0.8}/requirements.txt +2 -2
- {mmrelay-1.0.7 → mmrelay-1.0.8}/setup.cfg +3 -3
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/__init__.py +1 -1
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/main.py +4 -1
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/matrix_utils.py +52 -4
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/base_plugin.py +21 -16
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/drop_plugin.py +2 -3
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/help_plugin.py +2 -3
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/map_plugin.py +2 -3
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/ping_plugin.py +2 -3
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/weather_plugin.py +2 -3
- {mmrelay-1.0.7 → mmrelay-1.0.8/src/mmrelay.egg-info}/PKG-INFO +24 -48
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay.egg-info/requires.txt +2 -2
- {mmrelay-1.0.7 → mmrelay-1.0.8}/LICENSE +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/pyproject.toml +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/cli.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/config.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/config_checker.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/db_utils.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/log_utils.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/meshtastic_utils.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugin_loader.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/__init__.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/debug_plugin.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/health_plugin.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/mesh_relay_plugin.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/nodes_plugin.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/plugins/telemetry_plugin.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/setup_utils.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/tools/__init__.py +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/tools/mmrelay.service +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay/tools/sample_config.yaml +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay.egg-info/SOURCES.txt +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay.egg-info/dependency_links.txt +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay.egg-info/entry_points.txt +0 -0
- {mmrelay-1.0.7 → mmrelay-1.0.8}/src/mmrelay.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mmrelay
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: Bridge between Meshtastic mesh networks and Matrix chat rooms
|
|
5
5
|
Home-page: https://github.com/geoffwhittington/meshtastic-matrix-relay
|
|
6
6
|
Author: Geoff Whittington, Jeremiah K., and contributors
|
|
@@ -22,72 +22,45 @@ Requires-Dist: requests==2.32.3
|
|
|
22
22
|
Requires-Dist: markdown==3.8
|
|
23
23
|
Requires-Dist: haversine==2.9.0
|
|
24
24
|
Requires-Dist: schedule==1.2.2
|
|
25
|
-
Requires-Dist: platformdirs==4.3.
|
|
25
|
+
Requires-Dist: platformdirs==4.3.8
|
|
26
26
|
Requires-Dist: py-staticmaps>=0.4.0
|
|
27
27
|
Requires-Dist: rich==14.0.0
|
|
28
|
-
Requires-Dist: setuptools==80.
|
|
28
|
+
Requires-Dist: setuptools==80.8.0
|
|
29
29
|
Dynamic: license-file
|
|
30
30
|
|
|
31
31
|
# M<>M Relay
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## (Meshtastic <=> Matrix Relay)
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
A powerful and easy-to-use relay between Meshtastic devices and Matrix chat rooms, allowing seamless communication across platforms. This opens the door for bridging Meshtastic devices to [many other platforms](https://matrix.org/bridges/).
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
## Documentation
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
2. Move your configuration to the new standard location (`~/.mmrelay/config.yaml`)
|
|
41
|
-
3. See [ANNOUNCEMENT.md](ANNOUNCEMENT.md) for all the exciting new features
|
|
39
|
+
Visit our [Wiki](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki) for comprehensive guides and information.
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
A powerful and easy-to-use relay between Meshtastic devices and Matrix chat rooms, allowing seamless communication across platforms. This opens the door for bridging Meshtastic devices to [many other platforms](https://matrix.org/bridges/).
|
|
41
|
+
- [Installation Instructions](docs/INSTRUCTIONS.md) - Setup and configuration guide
|
|
42
|
+
- [v1.0 Release Announcement](docs/ANNOUNCEMENT.md) - New changes in v1.0
|
|
43
|
+
- [Upgrade Guide](docs/UPGRADE_TO_V1.md) - Migration guidance for existing users
|
|
48
44
|
|
|
49
45
|
---
|
|
50
46
|
|
|
51
|
-
##
|
|
47
|
+
## Quick Start
|
|
52
48
|
|
|
53
49
|
MMRelay runs on Linux, macOS, and Windows.
|
|
54
50
|
|
|
55
|
-
### Quick Installation
|
|
56
|
-
|
|
57
51
|
```bash
|
|
58
52
|
# Install using pipx for isolated installation (recommended)
|
|
59
53
|
pipx install mmrelay
|
|
60
54
|
|
|
61
|
-
#
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
For pipx installation instructions, see: [pipx installation guide](https://pipx.pypa.io/stable/installation/#on-linux)
|
|
55
|
+
# Generate a sample configuration file & then edit it
|
|
56
|
+
mmrelay --generate-config
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- **New Users**: See [INSTRUCTIONS.md](INSTRUCTIONS.md) for setup and configuration
|
|
70
|
-
- **Existing Users**: See [UPGRADE_TO_V1.md](UPGRADE_TO_V1.md) for migration guidance
|
|
71
|
-
- **Configuration**: Review [sample_config.yaml](src/mmrelay/tools/sample_config.yaml) for examples
|
|
72
|
-
|
|
73
|
-
### Command-Line Options
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
usage: mmrelay [-h] [--config CONFIG] [--data-dir DATA_DIR] [--log-level {error,warning,info,debug}] [--logfile LOGFILE] [--version] [--generate-config] [--install-service] [--check-config]
|
|
77
|
-
|
|
78
|
-
Options:
|
|
79
|
-
-h, --help Show this help message and exit
|
|
80
|
-
--config CONFIG Path to config file
|
|
81
|
-
--data-dir DATA_DIR Base directory for all data (logs, database, plugins)
|
|
82
|
-
--log-level {error,warning,info,debug}
|
|
83
|
-
Set logging level
|
|
84
|
-
--logfile LOGFILE Path to log file (can be overridden by --data-dir)
|
|
85
|
-
--version Show version and exit
|
|
86
|
-
--generate-config Generate a sample config.yaml file
|
|
87
|
-
--install-service Install or update the systemd user service
|
|
88
|
-
--check-config Check if the configuration file is valid
|
|
58
|
+
# Start the relay (without --install-service to run manually)
|
|
59
|
+
mmrelay --install-service
|
|
89
60
|
```
|
|
90
61
|
|
|
62
|
+
For detailed installation and configuration instructions, see the [Installation Guide](docs/INSTRUCTIONS.md).
|
|
63
|
+
|
|
91
64
|
---
|
|
92
65
|
|
|
93
66
|
## Features
|
|
@@ -133,7 +106,12 @@ See the full list of core plugins [here](https://github.com/geoffwhittington/mes
|
|
|
133
106
|
|
|
134
107
|
### Community & Custom Plugins
|
|
135
108
|
|
|
136
|
-
|
|
109
|
+
MMRelay's plugin system allows you to extend functionality in two ways:
|
|
110
|
+
|
|
111
|
+
- **Custom Plugins**: Create personal plugins for your own use, stored in `~/.mmrelay/plugins/custom/`
|
|
112
|
+
- **Community Plugins**: Share your creations with others or use plugins developed by the community
|
|
113
|
+
|
|
114
|
+
Check the [Community Plugins Development Guide](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki/Community-Plugin-Development-Guide) in our wiki to get started.
|
|
137
115
|
|
|
138
116
|
✨️ Visit the [Community Plugins List](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki/Community-Plugin-List)!
|
|
139
117
|
|
|
@@ -151,14 +129,12 @@ community-plugins:
|
|
|
151
129
|
|
|
152
130
|
### Plugin System
|
|
153
131
|
|
|
154
|
-
MMRelay features a powerful plugin system with standardized locations:
|
|
132
|
+
Plugins make it easy to extend functionality without modifying the core program. MMRelay features a powerful plugin system with standardized locations:
|
|
155
133
|
|
|
156
134
|
- **Core Plugins**: Pre-installed with the package
|
|
157
135
|
- **Custom Plugins**: Your own plugins in `~/.mmrelay/plugins/custom/`
|
|
158
136
|
- **Community Plugins**: Third-party plugins in `~/.mmrelay/plugins/community/`
|
|
159
137
|
|
|
160
|
-
Plugins make it easy to extend functionality without modifying the core code.
|
|
161
|
-
|
|
162
138
|
---
|
|
163
139
|
|
|
164
140
|
## Getting Started with Matrix
|
|
@@ -1,63 +1,36 @@
|
|
|
1
1
|
# M<>M Relay
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## (Meshtastic <=> Matrix Relay)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A powerful and easy-to-use relay between Meshtastic devices and Matrix chat rooms, allowing seamless communication across platforms. This opens the door for bridging Meshtastic devices to [many other platforms](https://matrix.org/bridges/).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Documentation
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
2. Move your configuration to the new standard location (`~/.mmrelay/config.yaml`)
|
|
11
|
-
3. See [ANNOUNCEMENT.md](ANNOUNCEMENT.md) for all the exciting new features
|
|
9
|
+
Visit our [Wiki](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki) for comprehensive guides and information.
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
A powerful and easy-to-use relay between Meshtastic devices and Matrix chat rooms, allowing seamless communication across platforms. This opens the door for bridging Meshtastic devices to [many other platforms](https://matrix.org/bridges/).
|
|
11
|
+
- [Installation Instructions](docs/INSTRUCTIONS.md) - Setup and configuration guide
|
|
12
|
+
- [v1.0 Release Announcement](docs/ANNOUNCEMENT.md) - New changes in v1.0
|
|
13
|
+
- [Upgrade Guide](docs/UPGRADE_TO_V1.md) - Migration guidance for existing users
|
|
18
14
|
|
|
19
15
|
---
|
|
20
16
|
|
|
21
|
-
##
|
|
17
|
+
## Quick Start
|
|
22
18
|
|
|
23
19
|
MMRelay runs on Linux, macOS, and Windows.
|
|
24
20
|
|
|
25
|
-
### Quick Installation
|
|
26
|
-
|
|
27
21
|
```bash
|
|
28
22
|
# Install using pipx for isolated installation (recommended)
|
|
29
23
|
pipx install mmrelay
|
|
30
24
|
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
For pipx installation instructions, see: [pipx installation guide](https://pipx.pypa.io/stable/installation/#on-linux)
|
|
25
|
+
# Generate a sample configuration file & then edit it
|
|
26
|
+
mmrelay --generate-config
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- **New Users**: See [INSTRUCTIONS.md](INSTRUCTIONS.md) for setup and configuration
|
|
40
|
-
- **Existing Users**: See [UPGRADE_TO_V1.md](UPGRADE_TO_V1.md) for migration guidance
|
|
41
|
-
- **Configuration**: Review [sample_config.yaml](src/mmrelay/tools/sample_config.yaml) for examples
|
|
42
|
-
|
|
43
|
-
### Command-Line Options
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
usage: mmrelay [-h] [--config CONFIG] [--data-dir DATA_DIR] [--log-level {error,warning,info,debug}] [--logfile LOGFILE] [--version] [--generate-config] [--install-service] [--check-config]
|
|
47
|
-
|
|
48
|
-
Options:
|
|
49
|
-
-h, --help Show this help message and exit
|
|
50
|
-
--config CONFIG Path to config file
|
|
51
|
-
--data-dir DATA_DIR Base directory for all data (logs, database, plugins)
|
|
52
|
-
--log-level {error,warning,info,debug}
|
|
53
|
-
Set logging level
|
|
54
|
-
--logfile LOGFILE Path to log file (can be overridden by --data-dir)
|
|
55
|
-
--version Show version and exit
|
|
56
|
-
--generate-config Generate a sample config.yaml file
|
|
57
|
-
--install-service Install or update the systemd user service
|
|
58
|
-
--check-config Check if the configuration file is valid
|
|
28
|
+
# Start the relay (without --install-service to run manually)
|
|
29
|
+
mmrelay --install-service
|
|
59
30
|
```
|
|
60
31
|
|
|
32
|
+
For detailed installation and configuration instructions, see the [Installation Guide](docs/INSTRUCTIONS.md).
|
|
33
|
+
|
|
61
34
|
---
|
|
62
35
|
|
|
63
36
|
## Features
|
|
@@ -103,7 +76,12 @@ See the full list of core plugins [here](https://github.com/geoffwhittington/mes
|
|
|
103
76
|
|
|
104
77
|
### Community & Custom Plugins
|
|
105
78
|
|
|
106
|
-
|
|
79
|
+
MMRelay's plugin system allows you to extend functionality in two ways:
|
|
80
|
+
|
|
81
|
+
- **Custom Plugins**: Create personal plugins for your own use, stored in `~/.mmrelay/plugins/custom/`
|
|
82
|
+
- **Community Plugins**: Share your creations with others or use plugins developed by the community
|
|
83
|
+
|
|
84
|
+
Check the [Community Plugins Development Guide](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki/Community-Plugin-Development-Guide) in our wiki to get started.
|
|
107
85
|
|
|
108
86
|
✨️ Visit the [Community Plugins List](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki/Community-Plugin-List)!
|
|
109
87
|
|
|
@@ -121,14 +99,12 @@ community-plugins:
|
|
|
121
99
|
|
|
122
100
|
### Plugin System
|
|
123
101
|
|
|
124
|
-
MMRelay features a powerful plugin system with standardized locations:
|
|
102
|
+
Plugins make it easy to extend functionality without modifying the core program. MMRelay features a powerful plugin system with standardized locations:
|
|
125
103
|
|
|
126
104
|
- **Core Plugins**: Pre-installed with the package
|
|
127
105
|
- **Custom Plugins**: Your own plugins in `~/.mmrelay/plugins/custom/`
|
|
128
106
|
- **Community Plugins**: Third-party plugins in `~/.mmrelay/plugins/community/`
|
|
129
107
|
|
|
130
|
-
Plugins make it easy to extend functionality without modifying the core code.
|
|
131
|
-
|
|
132
108
|
---
|
|
133
109
|
|
|
134
110
|
## Getting Started with Matrix
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = mmrelay
|
|
3
|
-
version = 1.0.
|
|
3
|
+
version = 1.0.8
|
|
4
4
|
author = Geoff Whittington, Jeremiah K., and contributors
|
|
5
5
|
author_email = jeremiahk@gmx.com
|
|
6
6
|
description = Bridge between Meshtastic mesh networks and Matrix chat rooms
|
|
@@ -30,10 +30,10 @@ install_requires =
|
|
|
30
30
|
markdown==3.8
|
|
31
31
|
haversine==2.9.0
|
|
32
32
|
schedule==1.2.2
|
|
33
|
-
platformdirs==4.3.
|
|
33
|
+
platformdirs==4.3.8
|
|
34
34
|
py-staticmaps>=0.4.0
|
|
35
35
|
rich==14.0.0
|
|
36
|
-
setuptools==80.
|
|
36
|
+
setuptools==80.8.0
|
|
37
37
|
include_package_data = True
|
|
38
38
|
|
|
39
39
|
[options.packages.find]
|
|
@@ -9,6 +9,7 @@ import signal
|
|
|
9
9
|
import sys
|
|
10
10
|
|
|
11
11
|
from nio import ReactionEvent, RoomMessageEmote, RoomMessageNotice, RoomMessageText
|
|
12
|
+
from nio.events.room_events import RoomMemberEvent
|
|
12
13
|
|
|
13
14
|
# Import version from package
|
|
14
15
|
# Import meshtastic_utils as a module to set event_loop
|
|
@@ -22,7 +23,7 @@ from mmrelay.db_utils import (
|
|
|
22
23
|
from mmrelay.log_utils import get_logger
|
|
23
24
|
from mmrelay.matrix_utils import connect_matrix, join_matrix_room
|
|
24
25
|
from mmrelay.matrix_utils import logger as matrix_logger
|
|
25
|
-
from mmrelay.matrix_utils import on_room_message
|
|
26
|
+
from mmrelay.matrix_utils import on_room_message, on_room_member
|
|
26
27
|
from mmrelay.meshtastic_utils import connect_meshtastic
|
|
27
28
|
from mmrelay.meshtastic_utils import logger as meshtastic_logger
|
|
28
29
|
from mmrelay.plugin_loader import load_plugins
|
|
@@ -109,6 +110,8 @@ async def main(config):
|
|
|
109
110
|
)
|
|
110
111
|
# Add ReactionEvent callback so we can handle matrix reactions
|
|
111
112
|
matrix_client.add_event_callback(on_room_message, ReactionEvent)
|
|
113
|
+
# Add RoomMemberEvent callback to track room-specific display name changes
|
|
114
|
+
matrix_client.add_event_callback(on_room_member, RoomMemberEvent)
|
|
112
115
|
|
|
113
116
|
# Set up shutdown event
|
|
114
117
|
shutdown_event = asyncio.Event()
|
|
@@ -18,6 +18,7 @@ from nio import (
|
|
|
18
18
|
UploadResponse,
|
|
19
19
|
WhoamiError,
|
|
20
20
|
)
|
|
21
|
+
from nio.events.room_events import RoomMemberEvent
|
|
21
22
|
from PIL import Image
|
|
22
23
|
|
|
23
24
|
from mmrelay.db_utils import (
|
|
@@ -517,8 +518,14 @@ async def on_room_message(
|
|
|
517
518
|
meshtastic_id, matrix_room_id, meshtastic_text_db, meshtastic_meshnet_db = (
|
|
518
519
|
orig
|
|
519
520
|
)
|
|
520
|
-
|
|
521
|
-
|
|
521
|
+
# Get room-specific display name if available, fallback to global display name
|
|
522
|
+
room_display_name = room.user_name(event.sender)
|
|
523
|
+
if room_display_name:
|
|
524
|
+
full_display_name = room_display_name
|
|
525
|
+
else:
|
|
526
|
+
# Fallback to global display name if room-specific name is not available
|
|
527
|
+
display_name_response = await matrix_client.get_displayname(event.sender)
|
|
528
|
+
full_display_name = display_name_response.displayname or event.sender
|
|
522
529
|
|
|
523
530
|
# If not from a remote meshnet, proceed as normal to relay back to the originating meshnet
|
|
524
531
|
short_display_name = full_display_name[:5]
|
|
@@ -578,8 +585,14 @@ async def on_room_message(
|
|
|
578
585
|
return
|
|
579
586
|
else:
|
|
580
587
|
# Normal Matrix message from a Matrix user
|
|
581
|
-
|
|
582
|
-
|
|
588
|
+
# Get room-specific display name if available, fallback to global display name
|
|
589
|
+
room_display_name = room.user_name(event.sender)
|
|
590
|
+
if room_display_name:
|
|
591
|
+
full_display_name = room_display_name
|
|
592
|
+
else:
|
|
593
|
+
# Fallback to global display name if room-specific name is not available
|
|
594
|
+
display_name_response = await matrix_client.get_displayname(event.sender)
|
|
595
|
+
full_display_name = display_name_response.displayname or event.sender
|
|
583
596
|
short_display_name = full_display_name[:5]
|
|
584
597
|
prefix = f"{short_display_name}[M]: "
|
|
585
598
|
logger.debug(f"Processing matrix message from [{full_display_name}]: {text}")
|
|
@@ -752,3 +765,38 @@ async def send_room_image(
|
|
|
752
765
|
message_type="m.room.message",
|
|
753
766
|
content={"msgtype": "m.image", "url": upload_response.content_uri, "body": ""},
|
|
754
767
|
)
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
async def on_room_member(room: MatrixRoom, event: RoomMemberEvent) -> None:
|
|
771
|
+
"""
|
|
772
|
+
Callback to handle room member events, specifically tracking room-specific display name changes.
|
|
773
|
+
This ensures we detect when users update their display names in specific rooms.
|
|
774
|
+
"""
|
|
775
|
+
# Only track updates from active members
|
|
776
|
+
if event.membership != "join":
|
|
777
|
+
return
|
|
778
|
+
|
|
779
|
+
new_displayname = event.content.get("displayname")
|
|
780
|
+
old_displayname = event.prev_content.get("displayname") if event.prev_content else None
|
|
781
|
+
user_id = event.state_key
|
|
782
|
+
room_id = room.room_id
|
|
783
|
+
|
|
784
|
+
# Log display name changes for debugging
|
|
785
|
+
if new_displayname != old_displayname:
|
|
786
|
+
if new_displayname and old_displayname:
|
|
787
|
+
logger.info(
|
|
788
|
+
f"[Matrix] {user_id} updated room display name in {room_id}: "
|
|
789
|
+
f"'{old_displayname}' → '{new_displayname}'"
|
|
790
|
+
)
|
|
791
|
+
elif new_displayname and not old_displayname:
|
|
792
|
+
logger.info(
|
|
793
|
+
f"[Matrix] {user_id} set room display name in {room_id}: '{new_displayname}'"
|
|
794
|
+
)
|
|
795
|
+
elif not new_displayname and old_displayname:
|
|
796
|
+
logger.info(
|
|
797
|
+
f"[Matrix] {user_id} removed room display name in {room_id}: '{old_displayname}' → (global name)"
|
|
798
|
+
)
|
|
799
|
+
|
|
800
|
+
# Note: We don't need to maintain a separate cache here since matrix-nio
|
|
801
|
+
# automatically updates the room state and room.user_name() will return
|
|
802
|
+
# the updated room-specific display name immediately after this event.
|
|
@@ -29,25 +29,28 @@ class BasePlugin(ABC):
|
|
|
29
29
|
def description(self):
|
|
30
30
|
return ""
|
|
31
31
|
|
|
32
|
-
def __init__(self) -> None:
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
# self.plugin_name in your __init__ method BEFORE calling super().__init__()
|
|
36
|
-
# Example:
|
|
37
|
-
# def __init__(self):
|
|
38
|
-
# self.plugin_name = "your_plugin_name" # Set this FIRST
|
|
39
|
-
# super().__init__() # Then call parent
|
|
40
|
-
#
|
|
41
|
-
# Failure to do this will cause command recognition issues and other problems.
|
|
42
|
-
|
|
32
|
+
def __init__(self, plugin_name=None) -> None:
|
|
33
|
+
# Allow plugin_name to be passed as a parameter for simpler initialization
|
|
34
|
+
# This maintains backward compatibility while providing a cleaner API
|
|
43
35
|
super().__init__()
|
|
44
36
|
|
|
45
|
-
#
|
|
37
|
+
# If plugin_name is provided as a parameter, use it
|
|
38
|
+
if plugin_name is not None:
|
|
39
|
+
self.plugin_name = plugin_name
|
|
40
|
+
|
|
41
|
+
# For backward compatibility: if plugin_name is not provided as a parameter,
|
|
42
|
+
# check if it's set as an instance attribute (old way) or use the class attribute
|
|
46
43
|
if not hasattr(self, "plugin_name") or self.plugin_name is None:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
# Try to get the class-level plugin_name
|
|
45
|
+
class_plugin_name = getattr(self.__class__, "plugin_name", None)
|
|
46
|
+
if class_plugin_name is not None:
|
|
47
|
+
self.plugin_name = class_plugin_name
|
|
48
|
+
else:
|
|
49
|
+
raise ValueError(
|
|
50
|
+
f"{self.__class__.__name__} is missing plugin_name definition. "
|
|
51
|
+
f"Either set class.plugin_name, pass plugin_name to __init__, "
|
|
52
|
+
f"or set self.plugin_name before calling super().__init__()"
|
|
53
|
+
)
|
|
51
54
|
|
|
52
55
|
self.logger = get_logger(f"Plugin:{self.plugin_name}")
|
|
53
56
|
self.config = {"active": False}
|
|
@@ -66,6 +69,8 @@ class BasePlugin(ABC):
|
|
|
66
69
|
room.get("meshtastic_channel")
|
|
67
70
|
for room in config.get("matrix_rooms", [])
|
|
68
71
|
]
|
|
72
|
+
else:
|
|
73
|
+
self.mapped_channels = []
|
|
69
74
|
|
|
70
75
|
# Get the channels specified for this plugin, or default to all mapped channels
|
|
71
76
|
self.channels = self.config.get("channels", self.mapped_channels)
|
|
@@ -10,9 +10,8 @@ class Plugin(BasePlugin):
|
|
|
10
10
|
plugin_name = "drop"
|
|
11
11
|
special_node = "!NODE_MSGS!"
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
super().__init__()
|
|
13
|
+
# No __init__ method needed with the simplified plugin system
|
|
14
|
+
# The BasePlugin will automatically use the class-level plugin_name
|
|
16
15
|
|
|
17
16
|
def get_position(self, meshtastic_client, node_id):
|
|
18
17
|
for _node, info in meshtastic_client.nodes.items():
|
|
@@ -7,9 +7,8 @@ from mmrelay.plugins.base_plugin import BasePlugin
|
|
|
7
7
|
class Plugin(BasePlugin):
|
|
8
8
|
plugin_name = "help"
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
super().__init__()
|
|
10
|
+
# No __init__ method needed with the simplified plugin system
|
|
11
|
+
# The BasePlugin will automatically use the class-level plugin_name
|
|
13
12
|
|
|
14
13
|
@property
|
|
15
14
|
def description(self):
|
|
@@ -235,9 +235,8 @@ async def send_image(client: AsyncClient, room_id: str, image: Image.Image):
|
|
|
235
235
|
class Plugin(BasePlugin):
|
|
236
236
|
plugin_name = "map"
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
super().__init__()
|
|
238
|
+
# No __init__ method needed with the simplified plugin system
|
|
239
|
+
# The BasePlugin will automatically use the class-level plugin_name
|
|
241
240
|
|
|
242
241
|
@property
|
|
243
242
|
def description(self):
|
|
@@ -17,9 +17,8 @@ class Plugin(BasePlugin):
|
|
|
17
17
|
plugin_name = "ping"
|
|
18
18
|
punctuation = string.punctuation
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
super().__init__()
|
|
20
|
+
# No __init__ method needed with the simplified plugin system
|
|
21
|
+
# The BasePlugin will automatically use the class-level plugin_name
|
|
23
22
|
|
|
24
23
|
@property
|
|
25
24
|
def description(self):
|
|
@@ -9,9 +9,8 @@ from mmrelay.plugins.base_plugin import BasePlugin
|
|
|
9
9
|
class Plugin(BasePlugin):
|
|
10
10
|
plugin_name = "weather"
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
super().__init__()
|
|
12
|
+
# No __init__ method needed with the simplified plugin system
|
|
13
|
+
# The BasePlugin will automatically use the class-level plugin_name
|
|
15
14
|
|
|
16
15
|
@property
|
|
17
16
|
def description(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mmrelay
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: Bridge between Meshtastic mesh networks and Matrix chat rooms
|
|
5
5
|
Home-page: https://github.com/geoffwhittington/meshtastic-matrix-relay
|
|
6
6
|
Author: Geoff Whittington, Jeremiah K., and contributors
|
|
@@ -22,72 +22,45 @@ Requires-Dist: requests==2.32.3
|
|
|
22
22
|
Requires-Dist: markdown==3.8
|
|
23
23
|
Requires-Dist: haversine==2.9.0
|
|
24
24
|
Requires-Dist: schedule==1.2.2
|
|
25
|
-
Requires-Dist: platformdirs==4.3.
|
|
25
|
+
Requires-Dist: platformdirs==4.3.8
|
|
26
26
|
Requires-Dist: py-staticmaps>=0.4.0
|
|
27
27
|
Requires-Dist: rich==14.0.0
|
|
28
|
-
Requires-Dist: setuptools==80.
|
|
28
|
+
Requires-Dist: setuptools==80.8.0
|
|
29
29
|
Dynamic: license-file
|
|
30
30
|
|
|
31
31
|
# M<>M Relay
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## (Meshtastic <=> Matrix Relay)
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
A powerful and easy-to-use relay between Meshtastic devices and Matrix chat rooms, allowing seamless communication across platforms. This opens the door for bridging Meshtastic devices to [many other platforms](https://matrix.org/bridges/).
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
## Documentation
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
2. Move your configuration to the new standard location (`~/.mmrelay/config.yaml`)
|
|
41
|
-
3. See [ANNOUNCEMENT.md](ANNOUNCEMENT.md) for all the exciting new features
|
|
39
|
+
Visit our [Wiki](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki) for comprehensive guides and information.
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
A powerful and easy-to-use relay between Meshtastic devices and Matrix chat rooms, allowing seamless communication across platforms. This opens the door for bridging Meshtastic devices to [many other platforms](https://matrix.org/bridges/).
|
|
41
|
+
- [Installation Instructions](docs/INSTRUCTIONS.md) - Setup and configuration guide
|
|
42
|
+
- [v1.0 Release Announcement](docs/ANNOUNCEMENT.md) - New changes in v1.0
|
|
43
|
+
- [Upgrade Guide](docs/UPGRADE_TO_V1.md) - Migration guidance for existing users
|
|
48
44
|
|
|
49
45
|
---
|
|
50
46
|
|
|
51
|
-
##
|
|
47
|
+
## Quick Start
|
|
52
48
|
|
|
53
49
|
MMRelay runs on Linux, macOS, and Windows.
|
|
54
50
|
|
|
55
|
-
### Quick Installation
|
|
56
|
-
|
|
57
51
|
```bash
|
|
58
52
|
# Install using pipx for isolated installation (recommended)
|
|
59
53
|
pipx install mmrelay
|
|
60
54
|
|
|
61
|
-
#
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
For pipx installation instructions, see: [pipx installation guide](https://pipx.pypa.io/stable/installation/#on-linux)
|
|
55
|
+
# Generate a sample configuration file & then edit it
|
|
56
|
+
mmrelay --generate-config
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- **New Users**: See [INSTRUCTIONS.md](INSTRUCTIONS.md) for setup and configuration
|
|
70
|
-
- **Existing Users**: See [UPGRADE_TO_V1.md](UPGRADE_TO_V1.md) for migration guidance
|
|
71
|
-
- **Configuration**: Review [sample_config.yaml](src/mmrelay/tools/sample_config.yaml) for examples
|
|
72
|
-
|
|
73
|
-
### Command-Line Options
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
usage: mmrelay [-h] [--config CONFIG] [--data-dir DATA_DIR] [--log-level {error,warning,info,debug}] [--logfile LOGFILE] [--version] [--generate-config] [--install-service] [--check-config]
|
|
77
|
-
|
|
78
|
-
Options:
|
|
79
|
-
-h, --help Show this help message and exit
|
|
80
|
-
--config CONFIG Path to config file
|
|
81
|
-
--data-dir DATA_DIR Base directory for all data (logs, database, plugins)
|
|
82
|
-
--log-level {error,warning,info,debug}
|
|
83
|
-
Set logging level
|
|
84
|
-
--logfile LOGFILE Path to log file (can be overridden by --data-dir)
|
|
85
|
-
--version Show version and exit
|
|
86
|
-
--generate-config Generate a sample config.yaml file
|
|
87
|
-
--install-service Install or update the systemd user service
|
|
88
|
-
--check-config Check if the configuration file is valid
|
|
58
|
+
# Start the relay (without --install-service to run manually)
|
|
59
|
+
mmrelay --install-service
|
|
89
60
|
```
|
|
90
61
|
|
|
62
|
+
For detailed installation and configuration instructions, see the [Installation Guide](docs/INSTRUCTIONS.md).
|
|
63
|
+
|
|
91
64
|
---
|
|
92
65
|
|
|
93
66
|
## Features
|
|
@@ -133,7 +106,12 @@ See the full list of core plugins [here](https://github.com/geoffwhittington/mes
|
|
|
133
106
|
|
|
134
107
|
### Community & Custom Plugins
|
|
135
108
|
|
|
136
|
-
|
|
109
|
+
MMRelay's plugin system allows you to extend functionality in two ways:
|
|
110
|
+
|
|
111
|
+
- **Custom Plugins**: Create personal plugins for your own use, stored in `~/.mmrelay/plugins/custom/`
|
|
112
|
+
- **Community Plugins**: Share your creations with others or use plugins developed by the community
|
|
113
|
+
|
|
114
|
+
Check the [Community Plugins Development Guide](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki/Community-Plugin-Development-Guide) in our wiki to get started.
|
|
137
115
|
|
|
138
116
|
✨️ Visit the [Community Plugins List](https://github.com/geoffwhittington/meshtastic-matrix-relay/wiki/Community-Plugin-List)!
|
|
139
117
|
|
|
@@ -151,14 +129,12 @@ community-plugins:
|
|
|
151
129
|
|
|
152
130
|
### Plugin System
|
|
153
131
|
|
|
154
|
-
MMRelay features a powerful plugin system with standardized locations:
|
|
132
|
+
Plugins make it easy to extend functionality without modifying the core program. MMRelay features a powerful plugin system with standardized locations:
|
|
155
133
|
|
|
156
134
|
- **Core Plugins**: Pre-installed with the package
|
|
157
135
|
- **Custom Plugins**: Your own plugins in `~/.mmrelay/plugins/custom/`
|
|
158
136
|
- **Community Plugins**: Third-party plugins in `~/.mmrelay/plugins/community/`
|
|
159
137
|
|
|
160
|
-
Plugins make it easy to extend functionality without modifying the core code.
|
|
161
|
-
|
|
162
138
|
---
|
|
163
139
|
|
|
164
140
|
## Getting Started with Matrix
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|