Added version to RsPrivateChatMsgConfigItem for better extensibility.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3518 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-09-21 12:18:57 +00:00
parent 37fe5ff3a3
commit 1352b27e7a

View File

@ -158,6 +158,7 @@ uint32_t RsChatMsgItem::serial_size()
uint32_t RsPrivateChatMsgConfigItem::serial_size()
{
uint32_t s = 8; /* header */
s += 4; /* version */
s += GetTlvStringSize(configPeerId);
s += 4; /* chatFlags */
s += 4; /* configFlags */
@ -260,6 +261,7 @@ bool RsPrivateChatMsgConfigItem::serialise(void *data, uint32_t& pktsize)
offset += 8;
/* add mandatory parts first */
ok &= setRawUInt32(data, tlvsize, &offset, 0);
ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_PEERID, configPeerId);
ok &= setRawUInt32(data, tlvsize, &offset, chatFlags);
ok &= setRawUInt32(data, tlvsize, &offset, configFlags);
@ -390,6 +392,8 @@ RsPrivateChatMsgConfigItem::RsPrivateChatMsgConfigItem(void *data,uint32_t size)
bool ok = true ;
/* get mandatory parts first */
uint32_t version = 0;
ok &= getRawUInt32(data, rssize, &offset, &version);
ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_PEERID, configPeerId);
ok &= getRawUInt32(data, rssize, &offset, &chatFlags);
ok &= getRawUInt32(data, rssize, &offset, &configFlags);