Skip to content

Commit

Permalink
Merge pull request #110 from jeremiah-k/ignore-reactions
Browse files Browse the repository at this point in the history
Filter out TEXT_MESSAGE_APP packets with emoji or replyId
  • Loading branch information
jeremiah-k authored Dec 6, 2024
2 parents b894e58 + 792fc05 commit 4a71c88
Showing 1 changed file with 7 additions and 1 deletion.
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()

0 comments on commit 4a71c88

Please sign in to comment.