archive post by posting text with quote

This commit is contained in:
Juni 2024-12-11 19:29:15 -06:00
parent cbb076fa1c
commit f6c3a7eef2

View File

@ -41,12 +41,23 @@ let handlers = {
// @ts-ignore // @ts-ignore
[ActionTakenByUserValidator.make(<string>Bun.env.USER_DID)], [ActionTakenByUserValidator.make(<string>Bun.env.USER_DID)],
[ [
CreateSkeetAction.make("Aaron posted:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject =>{ CreateSkeetAction.make(
(handler: HandlerAgent, commit: JetstreamEventCommit): string => {
// @ts-ignore
let text = "\"" + commit.commit.record?.text + "\"";
if(text.length > 300){
text = text.substring(1, 301)
}
return text;
},
undefined,
(handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => {
return { return {
cid: MessageHandler.getCidFromMessage(handler, commit), cid: MessageHandler.getCidFromMessage(handler, commit),
uri: MessageHandler.getUriFromMessage(handler, commit) uri: MessageHandler.getUriFromMessage(handler, commit)
} }
}), }),
LogInputTextAction.make("Post") LogInputTextAction.make("Post")
], ],
testAgent testAgent
@ -104,7 +115,6 @@ let handlers = {
} }
async function initialize() { async function initialize() {
await testAgent.authenticate() await testAgent.authenticate()
jetstreamSubscription = new JetstreamSubscription( jetstreamSubscription = new JetstreamSubscription(