diff --git a/plugins/rmass/actions/getrmassconversation.py b/plugins/rmass/actions/getrmassconversation.py index af38a49..059f0af 100644 --- a/plugins/rmass/actions/getrmassconversation.py +++ b/plugins/rmass/actions/getrmassconversation.py @@ -1,4 +1,4 @@ -name = "Get messages" +name = "Save RMASS Message ID" kind = "action" @@ -13,6 +13,7 @@ method = "GET" #Used to resolve path for recursive handling. Path location must match the location of the recursiveset data from pullmessage operation resolve = { "get": { + "event_id": ["outmessageitem", "event_id"], "path": ["lastmessage", 0, "content", "com.loxthelion.rmass_message_id"], }, } @@ -34,7 +35,13 @@ outputs = { "rmasslastmessages": "messages", } -#outputs["rmasslastmessage"][0]["id"] is where we get our messageid +extract = { + "get": { + "rmass_message_id": ["rmasslastmessages", 0, "id"], + }, +} + +#outputs["rmasslastmessages"][0]["id"] is where we get our messageid select = { "source": "rmasslastmessages", "include": { @@ -42,8 +49,20 @@ select = { "value": 238302, }, "exclude": { - "key": {"currentFolder"}, + "key": "currentFolder", "value": 1, } } +saverow = { + "table": "message_mapping", + "columns": [ + {"rmass_message_id": "INTEGER PRIMARY KEY"}, + {"matrix_event_id": "TEXT NOT NULL UNIQUE"}, + ], + + "rowitems": [ + {"resolved": "rmass_message_id"}, + {"resolved": "event_id"}, + ], +} \ No newline at end of file