indicate if a user was already registered
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 38s
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 38s
Details
This commit is contained in:
parent
260de4e724
commit
6a644097fe
|
@ -126,10 +126,20 @@ const start = async () => {
|
|||
console.log('error: failed to recover signature:', e.message);
|
||||
}
|
||||
if (account) {
|
||||
try {
|
||||
const authorAddress = await matrixUserToAuthorAddress.get(event.sender);
|
||||
if (account === authorAddress) {
|
||||
await client.sendNotice(roomId, `Matrix user ${event.sender} already linked to author address ${account}`);
|
||||
} else {
|
||||
await client.sendNotice(roomId, `Matrix user ${event.sender} was linked to author address ${authorAddress}, now linked to ${account}`);
|
||||
}
|
||||
} catch (e) {
|
||||
// Not found
|
||||
await client.sendNotice(roomId, `Registered matrix user ${event.sender} to author address ${account}`);
|
||||
}
|
||||
await matrixUserToAuthorAddress.put(event.sender, account);
|
||||
await authorAddressToMatrixUser.put(account, event.sender);
|
||||
}
|
||||
await client.sendNotice(roomId, `Registered matrix user ${event.sender} to author address ${account}`);
|
||||
};
|
||||
|
||||
// Before we start the bot, register our command handler
|
||||
|
|
Loading…
Reference in New Issue