core modification for Qblog

*final modifications to qblog network messages: might need to consider 
wstring for profile kvsets tho
*update qblog core to hanldle messages
*updated interface with all methods we will ever need hopefully


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@614 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2008-06-19 21:34:13 +00:00
parent 18112f7116
commit 2a44784999
11 changed files with 489 additions and 378 deletions

View file

@ -28,8 +28,10 @@
#include "pqi/p3authmgr.h"
#include <iostream>
#include <fstream>
#include <sstream>
RsPeers *rsPeers = NULL;
/*******
@ -789,6 +791,32 @@ uint32_t RsPeerTranslateTrust(uint32_t trustLvl)
return RS_TRUST_LVL_UNKNOWN;
}
bool p3Peers::certToFile(void)
{
std::string invite = GetRetroshareInvite();
const int SIZE = 400;
char certStore[SIZE]; // enough store to reach certification part of string
std::ofstream cert_file; // to help with counting non cert part of string
std::istringstream certFind(invite); // tie invite to stream
/* find out how long it takes to reach certification part of string */
certFind.get(certStore, SIZE, '=');
invite.erase(0, certFind.gcount()); // delete all characters before certificate part
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::certToFile() : certificate" << invite;
#endif
std::string usrId = getPeerName(getOwnId()); // replace with actual textual id
usrId += ".pqi";
cert_file.open(usrId.c_str());
cert_file << invite; //store cert to file
cert_file.close();
return true;
}