new msg items to store srcid/from address for rs messages

also updated tests for new rsitems

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3594 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2010-10-03 11:56:53 +00:00
parent cfa10c6f80
commit 9bdf222418
4 changed files with 224 additions and 1 deletions

View file

@ -104,6 +104,14 @@ RsSerialType* init_item(RsMsgTags& mt)
return new RsMsgSerialiser();
}
RsSerialType* init_item(RsMsgSrcId& ms)
{
ms.msgId = rand()%434;
randString(SHORT_STR, ms.srcId);
return new RsMsgSerialiser();
}
bool operator ==(const RsChatMsgItem& cmiLeft,const RsChatMsgItem& cmiRight)
{
@ -182,6 +190,14 @@ bool operator ==(const RsMsgTags& mtLeft, const RsMsgTags& mtRight)
return true;
}
bool operator ==(const RsMsgSrcId& msLeft, const RsMsgSrcId& msRight)
{
if(msLeft.msgId != msRight.msgId) return false;
if(msLeft.srcId != msRight.srcId) return false;
return true;
}
int main()
{
test_RsItem<RsChatMsgItem >(); REPORT("Serialise/Deserialise RsChatMsgItem");
@ -190,6 +206,7 @@ int main()
test_RsItem<RsMsgItem >(); REPORT("Serialise/Deserialise RsMsgItem");
test_RsItem<RsMsgTagType>(); REPORT("Serialise/Deserialise RsMsgTagType");
test_RsItem<RsMsgTags>(); REPORT("Serialise/Deserialise RsMsgTags");
test_RsItem<RsMsgSrcId>(); REPORT("Serialise/Deserialise RsMsgSrcId");
std::cerr << std::endl;

View file

@ -37,6 +37,7 @@ RsSerialType* init_item(RsChatAvatarItem& );
RsSerialType* init_item(RsMsgItem& );
RsSerialType* init_item(RsMsgTagType& );
RsSerialType* init_item(RsMsgTags& );
RsSerialType* init_item(RsMsgSrcId& );
bool operator ==(const RsChatMsgItem& ,const RsChatMsgItem& );
bool operator ==(const RsChatStatusItem& , const RsChatStatusItem& );
@ -44,6 +45,6 @@ bool operator ==(const RsChatAvatarItem&, const RsChatAvatarItem& );
bool operator ==(const RsMsgTagType&, const RsMsgTagType& );
bool operator ==(const RsMsgTags&, const RsMsgTags& );
bool operator ==(const RsMsgItem&, const RsMsgItem& );
bool operator ==(const RsMsgSrcId&, const RsMsgSrcId& );
#endif /* MSGITEM_TEST_H_ */