Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out TEXT_MESSAGE_APP packets with emoji or replyId #110

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion meshtastic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ async def reconnect():


def on_meshtastic_message(packet, interface):
# Filter out TEXT_MESSAGE_APP packets with emoji or replyId
if packet.get('decoded', {}).get('portnum') == 'TEXT_MESSAGE_APP':
decoded = packet.get('decoded', {})
if 'emoji' in decoded or 'replyId' in decoded:
logger.debug('Filtered out reaction/tapback packet.')
return
"""
Handle incoming Meshtastic messages and relay them to Matrix.
"""
Expand Down Expand Up @@ -423,4 +429,4 @@ async def check_connection():
loop = asyncio.get_event_loop()
event_loop = loop # Set the event loop
loop.create_task(check_connection())
loop.run_forever()
loop.run_forever()