Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/chat/distributedchat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,13 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *
#endif
rstime_t now = time(nullptr);

bool banned = false;
if( rsReputations->overallReputationLevel(item->signature.keyId) ==
RsReputationLevel::LOCALLY_NEGATIVE )
{
std::cerr << "(WW) Received lobby msg/item from banned identity " << item->signature.keyId << ". Dropping it." << std::endl;
return ;
//return ; // need to go all checks to keep pings passing to gui
banned = true;
}
if(!checkSignature(item,item->PeerId())) // check the object's signature and possibly request missing keys
{
Expand Down Expand Up @@ -744,11 +746,14 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *
std::cerr << std::endl;
return ;
}
// add a routing clue for this peer/GXSid combination. This is quite reliable since the lobby transport is almost instantaneous
rsGRouter->addRoutingClue(GRouterKeyId(item->signature.keyId),item->PeerId()) ;
if(!banned)
{
// add a routing clue for this peer/GXSid combination. This is quite reliable since the lobby transport is almost instantaneous
rsGRouter->addRoutingClue(GRouterKeyId(item->signature.keyId),item->PeerId()) ;

if(! bounceLobbyObject(item,item->PeerId()))
if(! bounceLobbyObject(item,item->PeerId()))
return ;
}

#ifdef DEBUG_CHAT_LOBBIES
std::cerr << " doing specific job for this status item." << std::endl;
Expand Down Expand Up @@ -819,7 +824,7 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *
#endif
}
}

if(!banned || item->event_type == RS_CHAT_LOBBY_EVENT_KEEP_ALIVE)
RsServer::notify()->notifyChatLobbyEvent(item->lobby_id,item->event_type,item->signature.keyId,item->string1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/services/p3gxsreputation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static const uint32_t UPPER_LIMIT = 2; // used to
static const int kMaximumSetSize = 100; // max set of updates to send at once.
static const int CLEANUP_PERIOD = 600 ; // 10 minutes
//static const int ACTIVE_FRIENDS_ONLINE_DELAY = 86400*7 ; // 1 week.
static const int kReputationRequestPeriod = 600; // 10 mins
static const int kReputationRequestPeriod = 63; // 10 mins
static const int kReputationStoreWait = 180; // 3 minutes.
//static const float REPUTATION_ASSESSMENT_THRESHOLD_X1 = 0.5f ; // reputation under which the peer gets killed. Warning there's a 1 shift with what's shown in GUI. Be careful.
//static const uint32_t PGP_AUTO_BAN_THRESHOLD_DEFAULT = 2 ; // above this, auto ban any GXS id signed by this node
Expand Down