(chatId string, messageId string)
| 112 | } |
| 113 | |
| 114 | func (cs *ChatStore) RemoveMessage(chatId string, messageId string) bool { |
| 115 | cs.lock.Lock() |
| 116 | defer cs.lock.Unlock() |
| 117 | |
| 118 | chat := cs.chats[chatId] |
| 119 | if chat == nil { |
| 120 | return false |
| 121 | } |
| 122 | |
| 123 | initialLen := len(chat.NativeMessages) |
| 124 | chat.NativeMessages = slices.DeleteFunc(chat.NativeMessages, func(msg uctypes.GenAIMessage) bool { |
| 125 | return msg.GetMessageId() == messageId |
| 126 | }) |
| 127 | |
| 128 | return len(chat.NativeMessages) < initialLen |
| 129 | } |
no test coverage detected