MCPcopy Create free account
hub / github.com/experdot/pointer / cleanupMessageAttachments

Method cleanupMessageAttachments

src/main/attachmentHandler.ts:147–162  ·  view source on GitHub ↗

* 清理指定消息的所有附件 * @param pageId 页面ID * @param messageId 消息ID

(
    pageId: string,
    messageId: string
  )

Source from the content-addressed store, hash-verified

145 * @param messageId 消息ID
146 */
147 async cleanupMessageAttachments(
148 pageId: string,
149 messageId: string
150 ): Promise<{ success: boolean; error?: string }> {
151 try {
152 const targetDir = path.join(this.attachmentsDir, pageId, messageId)
153 await rm(targetDir, { recursive: true, force: true })
154 return { success: true }
155 } catch (error) {
156 console.error('清理消息附件失败:', error)
157 return {
158 success: false,
159 error: error instanceof Error ? error.message : '清理消息附件失败'
160 }
161 }
162 }
163
164 /**
165 * 清理指定页面的所有附件

Callers 1

setupAttachmentHandlersFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected