Skip to content

Add chat lobby history retrieval protocol#274

Open
jolavillette wants to merge 1 commit intoRetroShare:masterfrom
jolavillette:RetrieveChatHistoryFromFriends
Open

Add chat lobby history retrieval protocol#274
jolavillette wants to merge 1 commit intoRetroShare:masterfrom
jolavillette:RetrieveChatHistoryFromFriends

Conversation

@jolavillette
Copy link
Contributor

Add chat lobby history retrieval protocol

Implement a 4-step pull protocol allowing users to fetch chat history from friends participating in the same lobby:

  • Probe: ask connected friends if they have history available
  • ProbeResponse: peer replies with message count and oldest timestamp
  • Request: request messages from a specific peer (with max count/age)
  • Data: peer sends historical messages, chunked to stay under 128KB

New serialization items (0x20–0x23) in rschatitems.

Handlers in distributedchat.cc route, validate, and process each step.

Received history is deduplicated against local DB before merging via

p3HistoryMgr::addMessage(). Nickname fallback added for null GXS IDs.

New public API: requestLobbyHistory(), requestLobbyHistoryFromPeer()

New events: CHAT_LOBBY_EVENT_HISTORY_PROBE_RESPONSE, CHAT_LOBBY_EVENT_HISTORY_DATA

@jolavillette jolavillette force-pushed the RetrieveChatHistoryFromFriends branch from 3193a14 to b91cfab Compare March 9, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant