mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-28 08:54:13 -04:00
Fix JSON API event handler registering behavior
As a bonus the behaviour is now homogeneous between C++ API and JSON API Fix a bunch of compiler warning RsEvents implementation is now safer mHandlerMaps size is known at compile time, so use an std::array instead of vector
This commit is contained in:
parent
ce5f5faa97
commit
4c0baa1ec3
17 changed files with 165 additions and 139 deletions
|
@ -108,14 +108,6 @@ p3discovery2::p3discovery2(
|
|||
|
||||
// Add self into PGP FriendList.
|
||||
mFriendList[AuthGPG::getAuthGPG()->getGPGOwnId()] = DiscPgpInfo();
|
||||
|
||||
if(rsEvents)
|
||||
rsEvents->registerEventsHandler(
|
||||
RsEventType::GOSSIP_DISCOVERY,
|
||||
[this](std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
rsEventsHandler(*event);
|
||||
}, mRsEventsHandle ); // mRsEventsHandle is zeroed in initializer list
|
||||
}
|
||||
|
||||
|
||||
|
@ -1280,11 +1272,6 @@ bool p3discovery2::setPeerVersion(const RsPeerId &peerId, const std::string &ver
|
|||
return true;
|
||||
}
|
||||
|
||||
void p3discovery2::rsEventsHandler(const RsEvent& event)
|
||||
{
|
||||
Dbg3() << __PRETTY_FUNCTION__ << " " << static_cast<uint32_t>(event.mType) << std::endl;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************************/
|
||||
/* AuthGPGService */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue