Skip to content

Commit

Permalink
Merge pull request #372 from permaweb/twilson63/feat-patch-reply
Browse files Browse the repository at this point in the history
chg: add patch-legacy-reply to enable older aos processes to work wit…
  • Loading branch information
twilson63 authored Oct 17, 2024
2 parents 3e4e173 + 1bf81e9 commit c883591
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions blueprints/patch-legacy-reply.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local function patchReply(msg)
if not msg.reply then
msg.reply = function (replyMsg)
replyMsg.Target = msg["Reply-To"] or (replyMsg.Target or msg.From)
replyMsg["X-Reference"] = msg["X-Reference"] or msg.Reference or ""
replyMsg["X-Origin"] = msg["X-Origin"] or ""

return ao.send(replyMsg)
end
end
end

Handlers.prepend("_patch_reply", function (msg) return "continue" end, patchReply)
4 changes: 4 additions & 0 deletions src/commands/os.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ _G.package.loaded[".${mod}"] = load_${mod.replace("-", "_")}()
`
}

function patch3() {

}

function patch2() {
return `
Handlers.prepend("Assignment-Check", function (msg)
Expand Down

0 comments on commit c883591

Please sign in to comment.