根本原因:PKI 私聊需要接收方的公钥,但 !72d17be4 这个节点从未广播过节点信息,nodeinfo 表中没有它的公钥。这傻x豆包ai突然发什么神经,蠢死了

This commit is contained in:
2026-06-18 00:49:42 +08:00
parent ce07792c4b
commit dfb3fdd3e5
16 changed files with 757 additions and 31 deletions
+4 -8
View File
@@ -88,14 +88,10 @@ func (s *Store) Get(id string) (*message.Conversation, error) {
func (s *Store) GetOrCreateForBot(botID uint64, botNodeID string, peerNodeID string) (*message.Conversation, error) {
// Try to find an existing conversation with this peer
convs, err := s.ListForBot(botID)
if err == nil {
for _, conv := range convs {
// Simple matching: use peer node ID in the future if needed
// For now, just use the most recent conversation
if conv.BotID == botID && len(conv.Messages) > 0 {
return s.Get(conv.ID)
}
}
if err == nil && len(convs) > 0 {
// Use the most recent conversation (List already sorts by UpdatedAt desc)
// Note: List returns convs with Messages = nil, so we need to reload
return s.Get(convs[0].ID)
}
// Create a new conversation
return s.Create(botID, botNodeID)