mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 00:07:09 -05:00
removed some debug output in distant chat
This commit is contained in:
parent
a80a6669b6
commit
71b3638c36
@ -97,8 +97,9 @@ bool DistantChatService::handleOutgoingItem(RsChatItem *item)
|
|||||||
std::cerr << "(EE) serialisation error. Something's really wrong!" << std::endl;
|
std::cerr << "(EE) serialisation error. Something's really wrong!" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG_DISTANT_CHAT
|
||||||
std::cerr << " sending: " << RsUtil::BinToHex(mem,size) << std::endl;
|
std::cerr << " sending: " << RsUtil::BinToHex(mem,size) << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
mGxsTunnels->sendData( RsGxsTunnelId(item->PeerId()),DISTANT_CHAT_GXS_TUNNEL_SERVICE_ID,mem,size);
|
mGxsTunnels->sendData( RsGxsTunnelId(item->PeerId()),DISTANT_CHAT_GXS_TUNNEL_SERVICE_ID,mem,size);
|
||||||
return true;
|
return true;
|
||||||
@ -108,7 +109,9 @@ void DistantChatService::handleRecvChatStatusItem(RsChatStatusItem *cs)
|
|||||||
{
|
{
|
||||||
if(cs->flags & RS_CHAT_FLAG_CONNEXION_REFUSED)
|
if(cs->flags & RS_CHAT_FLAG_CONNEXION_REFUSED)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_DISTANT_CHAT
|
||||||
std::cerr << "(II) Distant chat: received notification that peer refuses conversation." << std::endl;
|
std::cerr << "(II) Distant chat: received notification that peer refuses conversation." << std::endl;
|
||||||
|
#endif
|
||||||
RsServer::notify()->notifyChatStatus(ChatId(DistantChatPeerId(cs->PeerId())),"Connexion refused by distant peer!") ;
|
RsServer::notify()->notifyChatStatus(ChatId(DistantChatPeerId(cs->PeerId())),"Connexion refused by distant peer!") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +136,9 @@ bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTun
|
|||||||
|
|
||||||
if(!res)
|
if(!res)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_DISTANT_CHAT
|
||||||
std::cerr << "(II) refusing distant chat from peer " << gxs_id << ". Sending a notification back to tunnel " << tunnel_id << std::endl;
|
std::cerr << "(II) refusing distant chat from peer " << gxs_id << ". Sending a notification back to tunnel " << tunnel_id << std::endl;
|
||||||
|
#endif
|
||||||
RsChatStatusItem *item = new RsChatStatusItem ;
|
RsChatStatusItem *item = new RsChatStatusItem ;
|
||||||
item->flags = RS_CHAT_FLAG_CONNEXION_REFUSED ;
|
item->flags = RS_CHAT_FLAG_CONNEXION_REFUSED ;
|
||||||
item->status_string.clear() ; // is not used yet! But could be set in GUI to some message (??).
|
item->status_string.clear() ; // is not used yet! But could be set in GUI to some message (??).
|
||||||
@ -160,7 +165,9 @@ bool DistantChatService::acceptDataFromPeer(const RsGxsId& gxs_id,const RsGxsTun
|
|||||||
|
|
||||||
void DistantChatService::notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunnelId &tunnel_id, uint32_t tunnel_status)
|
void DistantChatService::notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunnelId &tunnel_id, uint32_t tunnel_status)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_DISTANT_CHAT
|
||||||
std::cerr << "DistantChatService::notifyTunnelStatus(): got notification " << std::hex << tunnel_status << std::dec << " for tunnel " << tunnel_id << std::endl;
|
std::cerr << "DistantChatService::notifyTunnelStatus(): got notification " << std::hex << tunnel_status << std::dec << " for tunnel " << tunnel_id << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(tunnel_status)
|
switch(tunnel_status)
|
||||||
{
|
{
|
||||||
@ -184,9 +191,11 @@ void DistantChatService::notifyTunnelStatus(const RsGxsTunnelService::RsGxsTunne
|
|||||||
|
|
||||||
void DistantChatService::receiveData(const RsGxsTunnelService::RsGxsTunnelId &tunnel_id, unsigned char *data, uint32_t data_size)
|
void DistantChatService::receiveData(const RsGxsTunnelService::RsGxsTunnelId &tunnel_id, unsigned char *data, uint32_t data_size)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_DISTANT_CHAT
|
||||||
std::cerr << "DistantChatService::receiveData(): got data of size " << data_size << " for tunnel " << tunnel_id << std::endl;
|
std::cerr << "DistantChatService::receiveData(): got data of size " << data_size << " for tunnel " << tunnel_id << std::endl;
|
||||||
std::cerr << " received: " << RsUtil::BinToHex(data,data_size) << std::endl;
|
std::cerr << " received: " << RsUtil::BinToHex(data,data_size) << std::endl;
|
||||||
std::cerr << " deserialising..." << std::endl;
|
std::cerr << " deserialising..." << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
// always make the contact up to date. This is useful for server side, which doesn't know about the chat until it
|
// always make the contact up to date. This is useful for server side, which doesn't know about the chat until it
|
||||||
// receives the first item.
|
// receives the first item.
|
||||||
@ -305,7 +314,9 @@ bool DistantChatService::setDistantChatPermissionFlags(uint32_t flags)
|
|||||||
if(mDistantChatPermissions != flags)
|
if(mDistantChatPermissions != flags)
|
||||||
{
|
{
|
||||||
mDistantChatPermissions = flags ;
|
mDistantChatPermissions = flags ;
|
||||||
|
#ifdef DEBUG_DISTANT_CHAT
|
||||||
std::cerr << "(II) Changing distant chat permissions to " << flags << ". Existing openned chats will however remain active until closed" << std::endl;
|
std::cerr << "(II) Changing distant chat permissions to " << flags << ". Existing openned chats will however remain active until closed" << std::endl;
|
||||||
|
#endif
|
||||||
triggerConfigSave() ;
|
triggerConfigSave() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user