MCPcopy Create free account
hub / github.com/msgbyte/tailchat / removeMessage

Method removeMessage

server/services/core/chat/inbox.service.ts:169–197  ·  view source on GitHub ↗
(
    ctx: TcContext<{
      userId?: string;
      groupId?: string;
      converseId: string;
      messageId: string;
    }>
  )

Source from the content-addressed store, hash-verified

167 }
168
169 async removeMessage(
170 ctx: TcContext<{
171 userId?: string;
172 groupId?: string;
173 converseId: string;
174 messageId: string;
175 }>
176 ) {
177 const {
178 userId = ctx.meta.userId,
179 groupId,
180 converseId,
181 messageId,
182 } = ctx.params;
183
184 await this.adapter.model.remove({
185 userId,
186 type: 'message',
187 payload: {
188 groupId,
189 converseId,
190 messageId,
191 },
192 });
193
194 await this.notifyUsersInboxUpdate(ctx, [userId]); // not good, 后面最好修改为发送删除的项而不是所有
195
196 return true;
197 }
198
199 /**
200 * 获取用户收件箱中所有内容

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected