Add friend-request backend service (rsFriendRequest)#306
Open
64johnlee wants to merge 5 commits into
Open
Conversation
Add rsfriendrequest.h, p3friendrequest.{h,cc} to RS_SOURCES/HEADERS
(CMakeLists.txt) and the qmake HEADERS/SOURCES/PUBLIC_HEADERS lists so
the friend-request backend is actually compiled and linked.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Previously the friend-request backend compiled but was never instantiated and the global rsFriendRequest pointer (declared extern in retroshare/rsfriendrequest.h) was defined nowhere, causing an undefined- reference link error in any consumer (e.g. the GUI Friend Requests page). - Define RsFriendRequest* rsFriendRequest (mirrors rsPeers in p3peers.cc) - Instantiate p3FriendRequest in rsinit.cc, assign the global pointer, and register it with p3ConfigMgr (friend_requests.cfg) for persistence - Call onUnknownPeerConnectionAttempt() from AuthSSL::VerifyX509Callback on the ISSUER_UNKNOWN (not-a-friend) path so attempts populate the UI Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
p3Config only declares a no-arg constructor (p3cfgmgr.h), so ': p3Config(CONFIG_TYPE_FRIEND_REQUESTS)' failed to compile (no matching constructor). RS identifies a config by its filename + RsItem subtype, not a constructor arg, so drop the bogus argument and the now-dead CONFIG_TYPE_FRIEND_REQUESTS macro. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Heads-up on a few follow-up commits that make this build and function end-to-end (the backend was previously additive-only):
This is the backend companion to the GUI PR RetroShare/RetroShare#3216 (closes RetroShare/RetroShare#1794); the two are meant to merge together. One thing worth a maintainer's eye: |
Contributor
|
Thx for contributing.
Overall this will be much less code. (And just in case, don't simply copy-paste these suggestions into an AI without thinking 8-) ) |
The service did not build. Corrected against the actual API: - include pqi/p3cfgmgr.h so the p3Config base resolves (this cascade also caused the spurious override / "not a direct base" errors) - fix include path rsserver/p3peermgr.h -> pqi/p3peermgr.h - RS_PKT_VERSION2 -> RS_PKT_VERSION_SERVICE (the former does not exist) - RsPeerId/RsPgpId: getId() -> toByteArray(), .init(buf) -> ctor-from-bytes - call inherited IndicateConfigChanged() without the p3Config:: qualifier - implement the RsSerializable serial_process() pure virtual (stub) so the item is no longer abstract Persistence is not yet wired (setupSerialiser() returns a bare RsSerialiser), so entries are in-memory only; serial_process carries a TODO describing how to finish it via an RsServiceSerializer (cf. p3BanList). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the libretroshare backend service for the Friend Requests feature:
retroshare/rsfriendrequest.h— publicRsFriendRequestinterfacersserver/p3friendrequest.{h,cc}—p3FriendRequestservice implementationsrc/CMakeLists.txtandsrc/libretroshare.pro) so the service is compiled and linked.Why
This is the backend companion to the GUI pull request RetroShare/RetroShare#3216 (gui: add Friend Requests page, closes RetroShare/RetroShare#1794). The GUI page links against
rsFriendRequest, so this service must land for that PR to build.The two PRs are intended to be merged together — the superproject PR's
libretrosharesubmodule pointer references the head of this branch.Notes
master; backend sources are additive (no changes to existing files beyond the two build-list entries).🤖 Generated with Claude Code