From 84095c879fd74d0d47f16496f09fe187d99bf33b Mon Sep 17 00:00:00 2001 From: Lyncoln Date: Wed, 21 Oct 2026 00:46:02 -0400 Subject: [PATCH] Synapse Notify polished and included in rmassmessagepush responsePolicy --- plugins/rmass/actions/rmassmessagepush.py | 12 ++++++++++-- plugins/rmass/actions/synapsenotify.py | 4 +--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/rmass/actions/rmassmessagepush.py b/plugins/rmass/actions/rmassmessagepush.py index 50a6009..21d4901 100644 --- a/plugins/rmass/actions/rmassmessagepush.py +++ b/plugins/rmass/actions/rmassmessagepush.py @@ -1,3 +1,5 @@ +from . import synapsenotify + name = "RMASS Message Push" kind = "action" @@ -10,7 +12,7 @@ resolve = { "sender": ["room_name"], "event_id": ["outmessageitem", "event_id"], "message_body": ["outmessageitem", "content", "body"], - #"room_id": ["outmessageitem", "room_id"], + "room_id": ["outmessageitem", "room_id"], "timestamp": ["outmessageitem", "origin_server_ts"], }, "deconstruct": { @@ -49,4 +51,10 @@ headers = { }, } - +responsepolicy = [ + { + "statuscode": 400, + "print": "Message is too short. Notifying...", + "execute": synapsenotify, + } +] diff --git a/plugins/rmass/actions/synapsenotify.py b/plugins/rmass/actions/synapsenotify.py index eb54aac..b4d1a11 100644 --- a/plugins/rmass/actions/synapsenotify.py +++ b/plugins/rmass/actions/synapsenotify.py @@ -12,9 +12,7 @@ resolve = { "get": { "sender": ["room_name"], "event_id": ["outmessageitem", "event_id"], - #"message_body": ["messageitem", "text"], "room_id": ["outmessageitem", "room_id"], - #"timestamp": ["messageitem", "createdAt"], }, "deconstruct": { "sender" : [ @@ -31,7 +29,7 @@ keys = [ }, { "keytitle": "body", - "keyvalue": "Message too short. should be more than 5 chars", + "keyvalue": "Message must have between 5 and 2000 characters", }, ]