Mostly connectivity code additions

* implementation of p3config, cache functionality to p3Qblog
* added peerid (pid) attribute to rsQblog item and its serialisation
* TODO: logical updating for p3Qblog
* TODO: implement tick() so can add to server 
* TODO: test p3Qblog after addition of tick with some peers



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@571 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2008-06-04 10:59:24 +00:00
parent e83a76c38a
commit d8bfc6d8b3
15 changed files with 886 additions and 139 deletions

View file

@ -53,7 +53,7 @@ std::ostream &RsChatItem::print(std::ostream &out, uint16_t indent)
printRsItemBase(out, "RsChatItem", indent);
uint16_t int_Indent = indent + 2;
printIndent(out, int_Indent);
out << "chatFlags: " << chatFlags << std::endl;
out << "QblogMs " << chatFlags << std::endl;
printIndent(out, int_Indent);
out << "sendTime: " << sendTime << std::endl;

View file

@ -57,7 +57,8 @@ std::ostream &RsQblogItem::print(std::ostream &out, uint16_t indent)
out << "blogMsg(message): " << blogMsg.second << std::endl;
printIndent(out, int_Indent);
out << "status " << status << std::endl;
printIndent(out, int_Indent);
out << "pid " << pid << std::endl;
printRsItemEnd(out, "RsQblogItem", indent);
return out;
}
@ -71,7 +72,8 @@ uint32_t RsQblogSerialiser::sizeItem(RsQblogItem *item)
s += GetTlvStringSize(item->blogMsg.second); // string part of blog
s += GetTlvStringSize(item->status);
s += GetTlvStringSize(item->favSong);
s += GetTlvStringSize(item->pid);
return s;
}
@ -103,6 +105,7 @@ bool RsQblogSerialiser::serialiseItem(RsQblogItem* item, void* data, uint32_t *s
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_MSG, item->blogMsg.second);
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_MSG, item->status);
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_MSG, item->favSong);
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_MSG, item->favSong);
if (offset != tlvsize)
{
@ -154,6 +157,7 @@ RsQblogItem* RsQblogSerialiser::deserialiseItem(void * data, uint32_t *size)
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_MSG, item->blogMsg.second);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_MSG, item->status);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_MSG, item->favSong);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_MSG, item->pid);
if (offset != rssize)
{

View file

@ -55,9 +55,14 @@ std::ostream &print(std::ostream &out, uint16_t indent = 0);
/* everything below is serialised */
std::pair<uint32_t, std::string> blogMsg; /// contain blog mesgs and their blogged times (client time)
std::string status; /// to be serialised: status of a requested user
std::string favSong; /// the users favorite song
/// contain blog mesgs and their blog time stamp (client time)
std::pair<uint32_t, std::string> blogMsg;
/// to be serialised: status of a requested user
std::string status;
/// the users favorite song
std::string favSong;
/// peer id TODO: serialise this
std::string pid;
};
/*! to serialise rsQblogItems: method names are self explanatory */