send reply notice when importing matrix post
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 34s
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 34s
Details
This commit is contained in:
parent
0b6d147f9c
commit
d2d781aef3
|
@ -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 });
|
||||
|
|
Loading…
Reference in New Issue