Last active
September 8, 2024 14:59
-
-
Save wuast94/6df6eec865082f35d99c0b058811555b to your computer and use it in GitHub Desktop.
Revisions
-
wuast94 revised this gist
Sep 8, 2024 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,8 @@ This is a Test Change file - junk - some junk - This line is now edited - some other junk we also edited - some more junk we will see -
wuast94 revised this gist
Sep 8, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ This is a Test Change file - junk - some junk - This line will be edited - some other junk - this line will get removed - some more junk we will see -
wuast94 revised this gist
Sep 8, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ This is a Test Change file - added - NOW ADDED - some junk - added wiffll be edited - some other junk - some more junk we will see -
wuast94 revised this gist
Sep 8, 2024 . 1 changed file with 8 additions and 36 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,38 +1,10 @@ This is a Test Change file - added - some junk - added will be edited - some other junk - added will be removed - some more junk we will see -
wuast94 created this gist
May 25, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ let matrixClient = global.get("matrixClient['@wuast94:3ddruckbremen.de']"); let matrixOnline = global.get("matrixClientOnline['@wuast94:3ddruckbremen.de']"); if (!matrixOnline) { msg.error = 'Matrix client not connected.'; return [null, msg]; } async function getMessageContentWithReaction(roomId, reactionEventId) { try { const reactionEvent = await matrixClient.fetchRoomEvent(roomId, reactionEventId); if (reactionEvent.type === "m.reaction") { const relatesTo = reactionEvent.content["m.relates_to"]; if (relatesTo && relatesTo["event_id"]) { const originalEventId = relatesTo["event_id"]; const originalEvent = await matrixClient.fetchRoomEvent(roomId, originalEventId); return originalEvent.content; } else { throw new Error("Invalid reaction event: missing 'm.relates_to' or 'event_id'."); } } else { throw new Error("Provided event is not a reaction."); } } catch (error) { throw error; } } getMessageContentWithReaction(msg.topic, msg.eventId) .then(content => { msg.originalContent = content; node.send([msg, null]); }) .catch(error => { node.warn("Error fetching message content: " + error); msg.error = error; node.send([null, msg]); });