diff --git a/backend/src/api/import-from-matrix.js b/backend/src/api/import-from-matrix.js index 979369c..569acf7 100644 --- a/backend/src/api/import-from-matrix.js +++ b/backend/src/api/import-from-matrix.js @@ -4,6 +4,10 @@ const { matrixUserToAuthorAddress } = require('../util/db'); const write = require('./write'); const { dao } = require('../util/contracts'); +const { + ETH_NETWORK, +} = process.env; + const addPostWithRetry = async (authors, hash, citations, retryDelay = 5000) => { try { await dao.addPost(authors, hash, citations); @@ -76,6 +80,8 @@ module.exports = async (req, res) => { console.log(`Post already added for matrix event ${eventUri}`); } else { console.log(`Added post to blockchain for matrix event ${eventUri}`); + // Send matrix event reply to the targeted event, notifying of this blockchain post + await client.replyNotice(roomId, event, `Added to ${ETH_NETWORK} blockchain as post ${hash}`); } res.json({ postId: hash, alreadyAdded });