Skip to content

Commit

Permalink
tweak thread control
Browse files Browse the repository at this point in the history
  • Loading branch information
Leask committed Aug 17, 2024
1 parent b66520a commit 25e549d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions skills/-8845_thread.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const action = async (ctx, next) => {
createdAt: now, touchedAt: now, context: {},
});
ctx.carry.threadInfo.push(CREATED
+ getLabel(findSession(ctx.session.sessionId)));
+ `\`${getLabel(findSession(ctx.session.sessionId))}\``);
await ctx.clear();
}
ctx.carry.sessionId = ctx.session.sessionId;
Expand Down Expand Up @@ -106,17 +106,19 @@ const action = async (ctx, next) => {
});
return await ok(message, { lastMessageId: lastMsgId, buttons });
};
const switched = async (preTitle, newThread) => await ok(`${preTitle
? `${END} Thread ended: \`${preTitle}\`\n\n` : ''}`
const switched = async (preTitle, newThread) => await ok(
`${preTitle ? `${END} Thread ended: \`${preTitle}\`\n\n` : ''}`
+ (newThread ? CREATED : SWITCHED)
+ getLabel(findSession(ctx.session.sessionId)), { pageBreak: true });
+ `\`${getLabel(findSession(ctx.session.sessionId))}\``,
{ pageBreak: true }
);
// handle commands
switch (ctx.cmd?.cmd) {
case 'clearkb':
return await ok(EMIJI_FINISH, { keyboards: [] });
case 'clear':
ctx.carry.threadInfo.push(`${CLR} Thread cleared: `
+ getLabel(findSession(ctx.session.sessionId)));
ctx.carry.threadInfo.push(`${CLR} Thread cleared: \``
+ `${getLabel(findSession(ctx.session.sessionId))}\``);
await ctx.clear();
break;
case 'clearall':
Expand Down

0 comments on commit 25e549d

Please sign in to comment.