mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 07:16:11 -05:00
changed enum to enum class and made names globally more consistent for RsEvents
This commit is contained in:
parent
d7504c59b5
commit
3d7ae59df7
@ -1222,7 +1222,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
|
||||
ev->mSslId = sslId;
|
||||
ev->mPgpId = pgpId;
|
||||
ev->mErrorMsg = errMsg;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;
|
||||
|
||||
rsEvents->postEvent(std::move(ev));
|
||||
}
|
||||
@ -1242,7 +1242,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
|
||||
ev->mSslId = sslId;
|
||||
ev->mSslCn = sslCn;
|
||||
ev->mErrorMsg = errMsg;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;
|
||||
|
||||
rsEvents->postEvent(std::move(ev));
|
||||
}
|
||||
@ -1273,7 +1273,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
|
||||
ev->mSslCn = sslCn;
|
||||
ev->mPgpId = pgpId;
|
||||
ev->mErrorMsg = errorMsg;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISMATCHED_PGP_ID;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISMATCHED_PGP_ID;
|
||||
rsEvents->postEvent(std::move(ev));
|
||||
}
|
||||
|
||||
@ -1301,10 +1301,10 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
|
||||
|
||||
switch(auth_diagnostic)
|
||||
{
|
||||
case RS_SSL_HANDSHAKE_DIAGNOSTIC_ISSUER_UNKNOWN: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::NOT_A_FRIEND; break;
|
||||
case RS_SSL_HANDSHAKE_DIAGNOSTIC_WRONG_SIGNATURE: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::PGP_SIGNATURE_VALIDATION_FAILED;break;
|
||||
case RS_SSL_HANDSHAKE_DIAGNOSTIC_ISSUER_UNKNOWN: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::NOT_A_FRIEND; break;
|
||||
case RS_SSL_HANDSHAKE_DIAGNOSTIC_WRONG_SIGNATURE: ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::PGP_SIGNATURE_VALIDATION_FAILED;break;
|
||||
default:
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;break;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;break;
|
||||
}
|
||||
|
||||
ev->mErrorMsg = errMsg;
|
||||
@ -1331,7 +1331,7 @@ int AuthSSLimpl::VerifyX509Callback(int /*preverify_ok*/, X509_STORE_CTX* ctx)
|
||||
ev->mSslCn = sslCn;
|
||||
ev->mPgpId = pgpId;
|
||||
ev->mErrorMsg = errMsg;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::NOT_A_FRIEND;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::NOT_A_FRIEND;
|
||||
rsEvents->postEvent(std::move(ev));
|
||||
}
|
||||
|
||||
|
@ -477,7 +477,7 @@ void p3LinkMgrIMPL::tickMonitors()
|
||||
{
|
||||
auto e = std::make_shared<RsConnectionEvent>() ;
|
||||
|
||||
e->mConnectionInfoCode = RsConnectionEvent::PEER_CONNECTED;
|
||||
e->mConnectionInfoCode = RsConnectionEvent::ConnectionEventCode::PEER_CONNECTED;
|
||||
e->mSslId = peer.id;
|
||||
|
||||
rsEvents->postEvent(e);
|
||||
@ -486,7 +486,7 @@ void p3LinkMgrIMPL::tickMonitors()
|
||||
{
|
||||
auto e = std::make_shared<RsConnectionEvent>() ;
|
||||
|
||||
e->mConnectionInfoCode = RsConnectionEvent::PEER_DISCONNECTED;
|
||||
e->mConnectionInfoCode = RsConnectionEvent::ConnectionEventCode::PEER_DISCONNECTED;
|
||||
e->mSslId = peer.id;
|
||||
|
||||
rsEvents->postEvent(e);
|
||||
|
@ -1814,7 +1814,7 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons
|
||||
ev->mSslId = from;
|
||||
ev->mStrInfo1 = sockaddr_storage_iptostring(addr);
|
||||
ev->mStrInfo2 = sockaddr_storage_iptostring(own_addr);
|
||||
ev->mConnectionInfoCode = RsConnectionEvent::PEER_REPORTS_WRONG_IP;
|
||||
ev->mConnectionInfoCode = RsConnectionEvent::ConnectionEventCode::PEER_REPORTS_WRONG_IP;
|
||||
|
||||
rsEvents->postEvent(ev);
|
||||
}
|
||||
|
@ -1114,7 +1114,7 @@ int pqissl::SSL_Connection_Complete()
|
||||
X509 *x509 = SSL_get_peer_certificate(ssl_connection) ;
|
||||
|
||||
ev->mSslId = RsX509Cert::getCertSslId(*x509);
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::PEER_REFUSED_CONNECTION;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::PEER_REFUSED_CONNECTION;
|
||||
rsEvents->postEvent(ev);
|
||||
}
|
||||
|
||||
@ -1283,7 +1283,7 @@ int pqissl::accept_locked( SSL *ssl, int fd,
|
||||
|
||||
ev->mSslId = RsX509Cert::getCertSslId(*x509);
|
||||
ev->mLocator = RsUrl(foreign_addr);
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::IP_IS_BLACKLISTED;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::IP_IS_BLACKLISTED;
|
||||
|
||||
rsEvents->postEvent(ev);
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ int pqissllistenbase::continueSSL(IncomingSSLInfo& incoming_connexion_info, bool
|
||||
auto ev = std::unique_ptr<RsAuthSslConnectionAutenticationEvent>(new RsAuthSslConnectionAutenticationEvent);
|
||||
|
||||
ev->mLocator = RsUrl(incoming_connexion_info.addr);
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO;
|
||||
ev->mErrorCode = RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO;
|
||||
|
||||
rsEvents->postEvent(std::move(ev));
|
||||
}
|
||||
|
@ -184,79 +184,3 @@ public:
|
||||
virtual ~RsEvents();
|
||||
};
|
||||
|
||||
//===================================================================================================//
|
||||
// Connexion and security events //
|
||||
//===================================================================================================//
|
||||
|
||||
/**
|
||||
* Event triggered by AuthSSL when authentication of a connection attempt either
|
||||
* fail or success
|
||||
*/
|
||||
struct RsAuthSslConnectionAutenticationEvent : RsEvent
|
||||
{
|
||||
RsAuthSslConnectionAutenticationEvent() : RsEvent(RsEventType::AUTHSSL_CONNECTION_AUTENTICATION) {}
|
||||
|
||||
enum ConnectionErrorCode: uint8_t {
|
||||
NO_CONNECTION_ERROR = 0x00,
|
||||
MISSING_AUTHENTICATION_INFO = 0x01,
|
||||
PGP_SIGNATURE_VALIDATION_FAILED = 0x02,
|
||||
MISMATCHED_PGP_ID = 0x03,
|
||||
NO_CERTIFICATE_SUPPLIED = 0x04,
|
||||
NOT_A_FRIEND = 0x05,
|
||||
MISSING_CERTIFICATE = 0x06,
|
||||
IP_IS_BLACKLISTED = 0x07,
|
||||
PEER_REFUSED_CONNECTION = 0x08,
|
||||
UNKNOWN_ERROR = 0x09,
|
||||
};
|
||||
|
||||
RsPeerId mSslId;
|
||||
std::string mSslCn;
|
||||
RsPgpId mPgpId;
|
||||
RsUrl mLocator;
|
||||
std::string mErrorMsg;
|
||||
ConnectionErrorCode mErrorCode;
|
||||
|
||||
///* @see RsEvent @see RsSerializable
|
||||
void serial_process( RsGenericSerializer::SerializeJob j,
|
||||
RsGenericSerializer::SerializeContext& ctx) override
|
||||
{
|
||||
RsEvent::serial_process(j, ctx);
|
||||
RS_SERIAL_PROCESS(mSslId);
|
||||
RS_SERIAL_PROCESS(mSslCn);
|
||||
RS_SERIAL_PROCESS(mPgpId);
|
||||
RS_SERIAL_PROCESS(mLocator);
|
||||
RS_SERIAL_PROCESS(mErrorMsg);
|
||||
RS_SERIAL_PROCESS(mErrorCode);
|
||||
}
|
||||
};
|
||||
|
||||
struct RsConnectionEvent : RsEvent
|
||||
{
|
||||
RsConnectionEvent()
|
||||
: RsEvent(RsEventType::PEER_CONNECTION),
|
||||
mConnectionInfoCode(UNKNOWN) {}
|
||||
|
||||
enum ConnectionType: uint8_t {
|
||||
UNKNOWN = 0x00,
|
||||
PEER_CONNECTED = 0x01,
|
||||
PEER_DISCONNECTED = 0x02,
|
||||
PEER_TIME_SHIFT = 0x03, // mStrInfo1 = time shift in seconds
|
||||
PEER_REPORTS_WRONG_IP = 0x04, // mStrInfo1 = address reported, mStrInfo2 = own address
|
||||
};
|
||||
|
||||
ConnectionType mConnectionInfoCode;
|
||||
RsPeerId mSslId;
|
||||
std::string mStrInfo1;
|
||||
std::string mStrInfo2;
|
||||
|
||||
///* @see RsEvent @see RsSerializable
|
||||
void serial_process( RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) override
|
||||
{
|
||||
RsEvent::serial_process(j, ctx);
|
||||
RS_SERIAL_PROCESS(mConnectionInfoCode);
|
||||
RS_SERIAL_PROCESS(mSslId);
|
||||
RS_SERIAL_PROCESS(mStrInfo1);
|
||||
RS_SERIAL_PROCESS(mStrInfo2);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -105,12 +105,12 @@ struct RsGxsChannelPost : RsSerializable
|
||||
struct RsGxsChannelEvent: RsEvent
|
||||
{
|
||||
RsGxsChannelEvent()
|
||||
: RsEvent(RsEventType::GXS_CHANNELS), mChannelEventCode(UNKNOWN) {}
|
||||
: RsEvent(RsEventType::GXS_CHANNELS), mChannelEventCode(ChannelEventCode::UNKNOWN) {}
|
||||
|
||||
enum ChannelEventCode: uint8_t {
|
||||
enum class ChannelEventCode: uint8_t {
|
||||
UNKNOWN = 0x00,
|
||||
NEW_CHANNEL = 0x01, // emitted when new channel is received
|
||||
UPDATED_CHANNEL = 0x02, // emitted when existing channel is updated
|
||||
UPDATED_CHANNEL = 0x02, // emitted when existing channel is updated
|
||||
NEW_MESSAGE = 0x03, // new message reeived in a particular channel (group and msg id)
|
||||
UPDATED_MESSAGE = 0x04, // existing message has been updated in a particular channel (group and msg id)
|
||||
RECEIVED_PUBLISH_KEY = 0x05, // publish key for this channel has been received.
|
||||
|
@ -165,9 +165,9 @@ struct RsGxsCircleDetails : RsSerializable
|
||||
struct RsGxsCircleEvent: RsEvent
|
||||
{
|
||||
RsGxsCircleEvent()
|
||||
: RsEvent(RsEventType::GXS_CIRCLES), mCircleEventType(UNKNOWN) {}
|
||||
: RsEvent(RsEventType::GXS_CIRCLES), mCircleEventType(CircleEventCode::UNKNOWN) {}
|
||||
|
||||
enum CircleEventType: uint8_t {
|
||||
enum class CircleEventCode: uint8_t {
|
||||
UNKNOWN = 0x00,
|
||||
CIRCLE_MEMBERSHIP_REQUEST = 0x01, // mCircleId contains the circle id and mGxsId is the id requesting membership
|
||||
CIRCLE_MEMBERSHIP_INVITE = 0x02, // mCircleId is the circle that invites me, and mGxsId is my own Id that is invited
|
||||
@ -176,7 +176,7 @@ struct RsGxsCircleEvent: RsEvent
|
||||
CIRCLE_MEMBERSHIP_REVOQUED= 0x05, // mCircleId contains the circle id and mGxsId is the id that was revoqued by admin
|
||||
};
|
||||
|
||||
CircleEventType mCircleEventType;
|
||||
CircleEventCode mCircleEventType;
|
||||
RsGxsCircleId mCircleId;
|
||||
RsGxsId mGxsId;
|
||||
|
||||
|
@ -107,9 +107,9 @@ struct RsGxsForumMsg : RsSerializable
|
||||
struct RsGxsForumEvent: RsEvent
|
||||
{
|
||||
RsGxsForumEvent()
|
||||
: RsEvent(RsEventType::GXS_FORUMS), mForumEventCode(UNKNOWN) {}
|
||||
: RsEvent(RsEventType::GXS_FORUMS), mForumEventCode(ForumEventCode::UNKNOWN) {}
|
||||
|
||||
enum ForumEventCode: uint8_t {
|
||||
enum class ForumEventCode: uint8_t {
|
||||
UNKNOWN = 0x00,
|
||||
NEW_FORUM = 0x01, // emitted when new forum is received
|
||||
UPDATED_FORUM = 0x02, // emitted when existing forum is updated
|
||||
|
@ -206,6 +206,85 @@ std::string RsPeerTrustString(uint32_t trustLvl);
|
||||
std::string RsPeerNetModeString(uint32_t netModel);
|
||||
std::string RsPeerLastConnectString(uint32_t lastConnect);
|
||||
|
||||
//===================================================================================================//
|
||||
// Connexion and security events //
|
||||
//===================================================================================================//
|
||||
|
||||
/**
|
||||
* Event triggered by AuthSSL when authentication of a connection attempt either
|
||||
* fail or success
|
||||
*/
|
||||
struct RsAuthSslConnectionAutenticationEvent : RsEvent
|
||||
{
|
||||
RsAuthSslConnectionAutenticationEvent() : RsEvent(RsEventType::AUTHSSL_CONNECTION_AUTENTICATION) {}
|
||||
|
||||
enum class AuthenticationCode: uint8_t {
|
||||
NO_CONNECTION_ERROR = 0x00,
|
||||
MISSING_AUTHENTICATION_INFO = 0x01,
|
||||
PGP_SIGNATURE_VALIDATION_FAILED = 0x02,
|
||||
MISMATCHED_PGP_ID = 0x03,
|
||||
NO_CERTIFICATE_SUPPLIED = 0x04,
|
||||
NOT_A_FRIEND = 0x05,
|
||||
MISSING_CERTIFICATE = 0x06,
|
||||
IP_IS_BLACKLISTED = 0x07,
|
||||
PEER_REFUSED_CONNECTION = 0x08,
|
||||
UNKNOWN_ERROR = 0x09,
|
||||
};
|
||||
|
||||
RsPeerId mSslId;
|
||||
std::string mSslCn;
|
||||
RsPgpId mPgpId;
|
||||
RsUrl mLocator;
|
||||
std::string mErrorMsg;
|
||||
AuthenticationCode mErrorCode;
|
||||
|
||||
///* @see RsEvent @see RsSerializable
|
||||
void serial_process( RsGenericSerializer::SerializeJob j,
|
||||
RsGenericSerializer::SerializeContext& ctx) override
|
||||
{
|
||||
RsEvent::serial_process(j, ctx);
|
||||
RS_SERIAL_PROCESS(mSslId);
|
||||
RS_SERIAL_PROCESS(mSslCn);
|
||||
RS_SERIAL_PROCESS(mPgpId);
|
||||
RS_SERIAL_PROCESS(mLocator);
|
||||
RS_SERIAL_PROCESS(mErrorMsg);
|
||||
RS_SERIAL_PROCESS(mErrorCode);
|
||||
}
|
||||
};
|
||||
|
||||
struct RsConnectionEvent : RsEvent
|
||||
{
|
||||
RsConnectionEvent()
|
||||
: RsEvent(RsEventType::PEER_CONNECTION),
|
||||
mConnectionInfoCode(ConnectionEventCode::UNKNOWN) {}
|
||||
|
||||
enum class ConnectionEventCode: uint8_t {
|
||||
UNKNOWN = 0x00,
|
||||
PEER_CONNECTED = 0x01,
|
||||
PEER_DISCONNECTED = 0x02,
|
||||
PEER_TIME_SHIFT = 0x03, // mStrInfo1 = time shift in seconds
|
||||
PEER_REPORTS_WRONG_IP = 0x04, // mStrInfo1 = address reported, mStrInfo2 = own address
|
||||
};
|
||||
|
||||
ConnectionEventCode mConnectionInfoCode;
|
||||
RsPeerId mSslId;
|
||||
std::string mStrInfo1;
|
||||
std::string mStrInfo2;
|
||||
|
||||
///* @see RsEvent @see RsSerializable
|
||||
void serial_process( RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx) override
|
||||
{
|
||||
RsEvent::serial_process(j, ctx);
|
||||
RS_SERIAL_PROCESS(mConnectionInfoCode);
|
||||
RS_SERIAL_PROCESS(mSslId);
|
||||
RS_SERIAL_PROCESS(mStrInfo1);
|
||||
RS_SERIAL_PROCESS(mStrInfo2);
|
||||
}
|
||||
};
|
||||
|
||||
//===================================================================================================//
|
||||
// Peer Details //
|
||||
//===================================================================================================//
|
||||
|
||||
/* We should definitely split this into 2 sub-structures:
|
||||
* PGP info (or profile info) with all info related to PGP keys
|
||||
|
@ -71,9 +71,9 @@ std::ostream &operator<<(std::ostream &out, const RsPostedPost &post);
|
||||
struct RsGxsPostedEvent: RsEvent
|
||||
{
|
||||
RsGxsPostedEvent()
|
||||
: RsEvent(RsEventType::GXS_POSTED), mPostedEventCode(UNKNOWN) {}
|
||||
: RsEvent(RsEventType::GXS_POSTED), mPostedEventCode(PostedEventCode::UNKNOWN) {}
|
||||
|
||||
enum PostedEventCode: uint8_t {
|
||||
enum class PostedEventCode: uint8_t {
|
||||
UNKNOWN = 0x00,
|
||||
NEW_POSTED_GROUP = 0x01,
|
||||
NEW_MESSAGE = 0x02
|
||||
|
@ -260,7 +260,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
|
||||
ev->mChannelMsgId = *mit1;
|
||||
ev->mChannelGroupId = mit->first;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::NEW_MESSAGE;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::ChannelEventCode::NEW_MESSAGE;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
@ -315,7 +315,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
auto ev = std::make_shared<RsGxsChannelEvent>();
|
||||
|
||||
ev->mChannelGroupId = *git;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::SUBSCRIBE_STATUS_CHANGED;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::ChannelEventCode::SUBSCRIBE_STATUS_CHANGED;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
@ -340,7 +340,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
auto ev = std::make_shared<RsGxsChannelEvent>();
|
||||
|
||||
ev->mChannelGroupId = *git;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::NEW_CHANNEL;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::ChannelEventCode::NEW_CHANNEL;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
@ -360,7 +360,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
auto ev = std::make_shared<RsGxsChannelEvent>();
|
||||
|
||||
ev->mChannelGroupId = *git;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::RECEIVED_PUBLISH_KEY;
|
||||
ev->mChannelEventCode = RsGxsChannelEvent::ChannelEventCode::RECEIVED_PUBLISH_KEY;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
|
@ -514,11 +514,11 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
ev->mGxsId = msg.mMeta.mAuthorId;
|
||||
|
||||
if (msg.stuff == "SUBSCRIPTION_REQUEST_UNSUBSCRIBE")
|
||||
ev->mCircleEventType = RsGxsCircleEvent::CIRCLE_MEMBERSHIP_LEAVE;
|
||||
ev->mCircleEventType = RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_LEAVE;
|
||||
else if(details.mAllowedGxsIds.find(msg.mMeta.mAuthorId) != details.mAllowedGxsIds.end())
|
||||
ev->mCircleEventType = RsGxsCircleEvent::CIRCLE_MEMBERSHIP_JOIN;
|
||||
ev->mCircleEventType = RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_JOIN;
|
||||
else
|
||||
ev->mCircleEventType = RsGxsCircleEvent::CIRCLE_MEMBERSHIP_REQUEST;
|
||||
ev->mCircleEventType = RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_REQUEST;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ void p3GxsForums::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
|
||||
ev->mForumMsgId = *mit1;
|
||||
ev->mForumGroupId = mit->first;
|
||||
ev->mForumEventCode = RsGxsForumEvent::NEW_MESSAGE;
|
||||
ev->mForumEventCode = RsGxsForumEvent::ForumEventCode::NEW_MESSAGE;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
@ -258,7 +258,7 @@ void p3GxsForums::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
auto ev = std::make_shared<RsGxsForumEvent>();
|
||||
|
||||
ev->mForumGroupId = *git;
|
||||
ev->mForumEventCode = RsGxsForumEvent::SUBSCRIBE_STATUS_CHANGED;
|
||||
ev->mForumEventCode = RsGxsForumEvent::ForumEventCode::SUBSCRIBE_STATUS_CHANGED;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
@ -284,7 +284,7 @@ void p3GxsForums::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
auto ev = std::make_shared<RsGxsForumEvent>();
|
||||
|
||||
ev->mForumGroupId = *git;
|
||||
ev->mForumEventCode = RsGxsForumEvent::NEW_FORUM;
|
||||
ev->mForumEventCode = RsGxsForumEvent::ForumEventCode::NEW_FORUM;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
|
||||
ev->mPostedMsgId = *mit1;
|
||||
ev->mPostedGroupId = mit->first;
|
||||
ev->mPostedEventCode = RsGxsPostedEvent::NEW_MESSAGE;
|
||||
ev->mPostedEventCode = RsGxsPostedEvent::PostedEventCode::NEW_MESSAGE;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
@ -148,7 +148,7 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
auto ev = std::make_shared<RsGxsPostedEvent>();
|
||||
|
||||
ev->mPostedGroupId = *git;
|
||||
ev->mPostedEventCode = RsGxsPostedEvent::NEW_POSTED_GROUP;
|
||||
ev->mPostedEventCode = RsGxsPostedEvent::PostedEventCode::NEW_POSTED_GROUP;
|
||||
|
||||
rsEvents->sendEvent(ev);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "util/rsdir.h"
|
||||
#include "retroshare/rsiface.h"
|
||||
#include "retroshare/rspeers.h"
|
||||
#include "pqi/pqibin.h"
|
||||
#include "pqi/pqistore.h"
|
||||
#include "pqi/p3linkmgr.h"
|
||||
@ -373,7 +374,7 @@ int p3rtt::storePongResult(const RsPeerId& id, uint32_t counter, double recv_ts,
|
||||
|
||||
ev->mSslId = peerInfo->mId;
|
||||
ev->mStrInfo1 = RsUtil::NumberToString(peerInfo->mCurrentMeanOffset,false);
|
||||
ev->mConnectionInfoCode = RsConnectionEvent::PEER_TIME_SHIFT;
|
||||
ev->mConnectionInfoCode = RsConnectionEvent::ConnectionEventCode::PEER_TIME_SHIFT;
|
||||
|
||||
rsEvents->postEvent(ev);
|
||||
}
|
||||
|
@ -220,10 +220,10 @@ void NewsFeed::handlePostedEvent(std::shared_ptr<const RsEvent> event)
|
||||
|
||||
switch(pe->mPostedEventCode)
|
||||
{
|
||||
case RsGxsPostedEvent::NEW_POSTED_GROUP: addFeedItem( new PostedGroupItem(this, NEWSFEED_POSTEDNEWLIST, pe->mPostedGroupId, false, true));
|
||||
case RsGxsPostedEvent::PostedEventCode::NEW_POSTED_GROUP: addFeedItem( new PostedGroupItem(this, NEWSFEED_POSTEDNEWLIST, pe->mPostedGroupId, false, true));
|
||||
break;
|
||||
|
||||
case RsGxsPostedEvent::NEW_MESSAGE: addFeedItem( new PostedItem(this, NEWSFEED_POSTEDMSGLIST, pe->mPostedGroupId, pe->mPostedMsgId, false, true));
|
||||
case RsGxsPostedEvent::PostedEventCode::NEW_MESSAGE: addFeedItem( new PostedItem(this, NEWSFEED_POSTEDMSGLIST, pe->mPostedGroupId, pe->mPostedMsgId, false, true));
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -239,12 +239,12 @@ void NewsFeed::handleForumEvent(std::shared_ptr<const RsEvent> event)
|
||||
|
||||
switch(pe->mForumEventCode)
|
||||
{
|
||||
case RsGxsForumEvent::UPDATED_FORUM:
|
||||
case RsGxsForumEvent::NEW_FORUM: addFeedItem(new GxsForumGroupItem(this, NEWSFEED_FORUMNEWLIST, pe->mForumGroupId, false, true));
|
||||
case RsGxsForumEvent::ForumEventCode::UPDATED_FORUM:
|
||||
case RsGxsForumEvent::ForumEventCode::NEW_FORUM: addFeedItem(new GxsForumGroupItem(this, NEWSFEED_FORUMNEWLIST, pe->mForumGroupId, false, true));
|
||||
break;
|
||||
|
||||
case RsGxsForumEvent::UPDATED_MESSAGE:
|
||||
case RsGxsForumEvent::NEW_MESSAGE: addFeedItem(new GxsForumMsgItem(this, NEWSFEED_FORUMNEWLIST, pe->mForumGroupId, pe->mForumMsgId, false, true));
|
||||
case RsGxsForumEvent::ForumEventCode::UPDATED_MESSAGE:
|
||||
case RsGxsForumEvent::ForumEventCode::NEW_MESSAGE: addFeedItem(new GxsForumMsgItem(this, NEWSFEED_FORUMNEWLIST, pe->mForumGroupId, pe->mForumMsgId, false, true));
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -260,15 +260,15 @@ void NewsFeed::handleChannelEvent(std::shared_ptr<const RsEvent> event)
|
||||
|
||||
switch(pe->mChannelEventCode)
|
||||
{
|
||||
case RsGxsChannelEvent::UPDATED_CHANNEL:
|
||||
case RsGxsChannelEvent::NEW_CHANNEL: addFeedItem(new GxsChannelGroupItem(this, NEWSFEED_CHANNELNEWLIST, pe->mChannelGroupId, false, true));
|
||||
case RsGxsChannelEvent::ChannelEventCode::UPDATED_CHANNEL:
|
||||
case RsGxsChannelEvent::ChannelEventCode::NEW_CHANNEL: addFeedItem(new GxsChannelGroupItem(this, NEWSFEED_CHANNELNEWLIST, pe->mChannelGroupId, false, true));
|
||||
break;
|
||||
|
||||
case RsGxsChannelEvent::UPDATED_MESSAGE:
|
||||
case RsGxsChannelEvent::NEW_MESSAGE: addFeedItem(new GxsChannelPostItem(this, NEWSFEED_CHANNELNEWLIST, pe->mChannelGroupId, pe->mChannelMsgId, false, true));
|
||||
case RsGxsChannelEvent::ChannelEventCode::UPDATED_MESSAGE:
|
||||
case RsGxsChannelEvent::ChannelEventCode::NEW_MESSAGE: addFeedItem(new GxsChannelPostItem(this, NEWSFEED_CHANNELNEWLIST, pe->mChannelGroupId, pe->mChannelMsgId, false, true));
|
||||
break;
|
||||
|
||||
case RsGxsChannelEvent::RECEIVED_PUBLISH_KEY: addFeedItem(new GxsChannelGroupItem(this, NEWSFEED_CHANNELPUBKEYLIST, pe->mChannelGroupId, false, true));
|
||||
case RsGxsChannelEvent::ChannelEventCode::RECEIVED_PUBLISH_KEY: addFeedItem(new GxsChannelGroupItem(this, NEWSFEED_CHANNELPUBKEYLIST, pe->mChannelGroupId, false, true));
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -296,24 +296,24 @@ void NewsFeed::handleCircleEvent(std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
switch(pe->mCircleEventType)
|
||||
{
|
||||
case RsGxsCircleEvent::CIRCLE_MEMBERSHIP_REQUEST: // only show membership requests if we're an admin of that circle
|
||||
case RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_REQUEST: // only show membership requests if we're an admin of that circle
|
||||
if(details.mAmIAdmin)
|
||||
addFeedItemIfUnique(new GxsCircleItem(this, NEWSFEED_CIRCLELIST, pe->mCircleId, pe->mGxsId, RS_FEED_ITEM_CIRCLE_MEMB_REQ),true);
|
||||
break;
|
||||
|
||||
case RsGxsCircleEvent::CIRCLE_MEMBERSHIP_JOIN:
|
||||
case RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_JOIN:
|
||||
addFeedItemIfUnique(new GxsCircleItem(this, NEWSFEED_CIRCLELIST, pe->mCircleId, pe->mGxsId, RS_FEED_ITEM_CIRCLE_MEMB_JOIN),true);
|
||||
break;
|
||||
|
||||
case RsGxsCircleEvent::CIRCLE_MEMBERSHIP_LEAVE:
|
||||
case RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_LEAVE:
|
||||
addFeedItemIfUnique(new GxsCircleItem(this, NEWSFEED_CIRCLELIST, pe->mCircleId, pe->mGxsId, RS_FEED_ITEM_CIRCLE_MEMB_LEAVE),true);
|
||||
break;
|
||||
|
||||
case RsGxsCircleEvent::CIRCLE_MEMBERSHIP_INVITE:
|
||||
case RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_INVITE:
|
||||
addFeedItemIfUnique(new GxsCircleItem(this, NEWSFEED_CIRCLELIST, pe->mCircleId, pe->mGxsId, RS_FEED_ITEM_CIRCLE_INVIT_REC),true);
|
||||
break;
|
||||
|
||||
case RsGxsCircleEvent::CIRCLE_MEMBERSHIP_REVOQUED:
|
||||
case RsGxsCircleEvent::CircleEventCode::CIRCLE_MEMBERSHIP_REVOQUED:
|
||||
addFeedItemIfUnique(new GxsCircleItem(this, NEWSFEED_CIRCLELIST, pe->mCircleId, pe->mGxsId, RS_FEED_ITEM_CIRCLE_MEMB_REVOQUED),true);
|
||||
break;
|
||||
|
||||
@ -335,13 +335,13 @@ void NewsFeed::handleConnectionEvent(std::shared_ptr<const RsEvent> event)
|
||||
|
||||
switch(e.mConnectionInfoCode)
|
||||
{
|
||||
case RsConnectionEvent::PEER_CONNECTED: addFeedItemIfUnique(new PeerItem(this, NEWSFEED_PEERLIST, e.mSslId, PEER_TYPE_CONNECT, false), true);
|
||||
case RsConnectionEvent::ConnectionEventCode::PEER_CONNECTED: addFeedItemIfUnique(new PeerItem(this, NEWSFEED_PEERLIST, e.mSslId, PEER_TYPE_CONNECT, false), true);
|
||||
break;
|
||||
case RsConnectionEvent::PEER_DISCONNECTED: // not handled yet
|
||||
case RsConnectionEvent::ConnectionEventCode::PEER_DISCONNECTED: // not handled yet
|
||||
break;
|
||||
case RsConnectionEvent::PEER_TIME_SHIFT:addFeedItemIfUnique(new PeerItem(this, NEWSFEED_PEERLIST, e.mSslId, PEER_TYPE_OFFSET, false),false);
|
||||
case RsConnectionEvent::ConnectionEventCode::PEER_TIME_SHIFT:addFeedItemIfUnique(new PeerItem(this, NEWSFEED_PEERLIST, e.mSslId, PEER_TYPE_OFFSET, false),false);
|
||||
break;
|
||||
case RsConnectionEvent::PEER_REPORTS_WRONG_IP: addFeedItemIfUnique(new SecurityIpItem(this, e.mSslId, e.mStrInfo2, e.mStrInfo1, RS_FEED_ITEM_SEC_IP_WRONG_EXTERNAL_IP_REPORTED, false), false);
|
||||
case RsConnectionEvent::ConnectionEventCode::PEER_REPORTS_WRONG_IP: addFeedItemIfUnique(new SecurityIpItem(this, e.mSslId, e.mStrInfo2, e.mStrInfo1, RS_FEED_ITEM_SEC_IP_WRONG_EXTERNAL_IP_REPORTED, false), false);
|
||||
break;
|
||||
|
||||
default: break;
|
||||
@ -357,10 +357,10 @@ void NewsFeed::handleSecurityEvent(std::shared_ptr<const RsEvent> event)
|
||||
|
||||
auto& e(*pe);
|
||||
|
||||
std::cerr << "NotifyQt: handling security event from (" << e.mSslId << "," << e.mPgpId << ") error code: " << e.mErrorCode << std::endl;
|
||||
std::cerr << "NotifyQt: handling security event from (" << e.mSslId << "," << e.mPgpId << ") error code: " << (int)e.mErrorCode << std::endl;
|
||||
uint flags = Settings->getNewsFeedFlags();
|
||||
|
||||
if(e.mErrorCode == RsAuthSslConnectionAutenticationEvent::PEER_REFUSED_CONNECTION)
|
||||
if(e.mErrorCode == RsAuthSslConnectionAutenticationEvent::AuthenticationCode::PEER_REFUSED_CONNECTION)
|
||||
{
|
||||
addFeedItemIfUnique(new PeerItem(this, NEWSFEED_PEERLIST, e.mSslId, PEER_TYPE_HELLO, false), true );
|
||||
return;
|
||||
@ -370,13 +370,13 @@ void NewsFeed::handleSecurityEvent(std::shared_ptr<const RsEvent> event)
|
||||
|
||||
switch(e.mErrorCode)
|
||||
{
|
||||
case RsAuthSslConnectionAutenticationEvent::NO_CERTIFICATE_SUPPLIED:
|
||||
case RsAuthSslConnectionAutenticationEvent::MISMATCHED_PGP_ID: // fallthrough
|
||||
case RsAuthSslConnectionAutenticationEvent::MISSING_AUTHENTICATION_INFO: FeedItemType = RS_FEED_ITEM_SEC_BAD_CERTIFICATE; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::PGP_SIGNATURE_VALIDATION_FAILED: FeedItemType = RS_FEED_ITEM_SEC_WRONG_SIGNATURE; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::NOT_A_FRIEND: FeedItemType = RS_FEED_ITEM_SEC_CONNECT_ATTEMPT; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::IP_IS_BLACKLISTED: FeedItemType = RS_FEED_ITEM_SEC_IP_BLACKLISTED; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::MISSING_CERTIFICATE: FeedItemType = RS_FEED_ITEM_SEC_MISSING_CERTIFICATE; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::AuthenticationCode::NO_CERTIFICATE_SUPPLIED:
|
||||
case RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISMATCHED_PGP_ID: // fallthrough
|
||||
case RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_AUTHENTICATION_INFO: FeedItemType = RS_FEED_ITEM_SEC_BAD_CERTIFICATE; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::AuthenticationCode::PGP_SIGNATURE_VALIDATION_FAILED: FeedItemType = RS_FEED_ITEM_SEC_WRONG_SIGNATURE; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::AuthenticationCode::NOT_A_FRIEND: FeedItemType = RS_FEED_ITEM_SEC_CONNECT_ATTEMPT; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::AuthenticationCode::IP_IS_BLACKLISTED: FeedItemType = RS_FEED_ITEM_SEC_IP_BLACKLISTED; break;
|
||||
case RsAuthSslConnectionAutenticationEvent::AuthenticationCode::MISSING_CERTIFICATE: FeedItemType = RS_FEED_ITEM_SEC_MISSING_CERTIFICATE; break;
|
||||
|
||||
default:
|
||||
return; // display nothing
|
||||
|
@ -66,7 +66,7 @@ void GxsChannelDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> ev
|
||||
|
||||
switch(e->mChannelEventCode)
|
||||
{
|
||||
case RsGxsChannelEvent::SUBSCRIBE_STATUS_CHANGED: updateDisplay(true);
|
||||
case RsGxsChannelEvent::ChannelEventCode::SUBSCRIBE_STATUS_CHANGED: updateDisplay(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -146,10 +146,10 @@ void GxsChannelPostsWidget::handleEvent_main_thread(std::shared_ptr<const RsEven
|
||||
|
||||
switch(e->mChannelEventCode)
|
||||
{
|
||||
case RsGxsChannelEvent::UPDATED_CHANNEL:
|
||||
case RsGxsChannelEvent::NEW_CHANNEL:
|
||||
case RsGxsChannelEvent::UPDATED_MESSAGE:
|
||||
case RsGxsChannelEvent::NEW_MESSAGE:
|
||||
case RsGxsChannelEvent::ChannelEventCode::UPDATED_CHANNEL:
|
||||
case RsGxsChannelEvent::ChannelEventCode::NEW_CHANNEL:
|
||||
case RsGxsChannelEvent::ChannelEventCode::UPDATED_MESSAGE:
|
||||
case RsGxsChannelEvent::ChannelEventCode::NEW_MESSAGE:
|
||||
if(e->mChannelGroupId == mChannelGroupId)
|
||||
updateDisplay(true);
|
||||
break;
|
||||
|
@ -450,10 +450,10 @@ void GxsForumThreadWidget::handleEvent_main_thread(std::shared_ptr<const RsEvent
|
||||
|
||||
switch(e->mForumEventCode)
|
||||
{
|
||||
case RsGxsForumEvent::UPDATED_FORUM:
|
||||
case RsGxsForumEvent::NEW_FORUM:
|
||||
case RsGxsForumEvent::UPDATED_MESSAGE:
|
||||
case RsGxsForumEvent::NEW_MESSAGE:
|
||||
case RsGxsForumEvent::ForumEventCode::UPDATED_FORUM:
|
||||
case RsGxsForumEvent::ForumEventCode::NEW_FORUM:
|
||||
case RsGxsForumEvent::ForumEventCode::UPDATED_MESSAGE:
|
||||
case RsGxsForumEvent::ForumEventCode::NEW_MESSAGE:
|
||||
if(e->mForumGroupId == mForumGroup.mMeta.mGroupId)
|
||||
updateDisplay(true);
|
||||
break;
|
||||
|
@ -59,7 +59,7 @@ void GxsForumsDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> eve
|
||||
|
||||
switch(e->mForumEventCode)
|
||||
{
|
||||
case RsGxsForumEvent::SUBSCRIBE_STATUS_CHANGED: updateDisplay(true);
|
||||
case RsGxsForumEvent::ForumEventCode::SUBSCRIBE_STATUS_CHANGED: updateDisplay(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user