improvements messages:

- save msgId in configuration file
- enable previous improvements read/unread state and tags

new function for creating backups of a file
bool createBackup (std::string sFilename, unsigned int nCount = 5);

currently its only available for windows compile. maybe there is a linux developer who change it for linux.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3064 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-06-04 23:39:33 +00:00
parent fe98568329
commit 342768e626
8 changed files with 123 additions and 111 deletions

View file

@ -428,6 +428,11 @@ uint32_t RsMsgSerialiser::sizeItem(RsMsgItem *item)
s += item->msgbcc.TlvSize();
s += item->attachment.TlvSize();
if (m_bConfiguration) {
// serialise msgId too
s += 4;
}
return s;
}
@ -467,6 +472,12 @@ bool RsMsgSerialiser::serialiseItem(RsMsgItem *item, void *data, uint32_t *p
ok &= item->msgbcc.SetTlv(data, tlvsize, &offset);
ok &= item->attachment.SetTlv(data, tlvsize, &offset);
if (m_bConfiguration) {
// serialise msgId too
ok &= setRawUInt32(data, tlvsize, &offset, item->msgId);
}
if (offset != tlvsize)
{
ok = false;
@ -521,6 +532,12 @@ RsMsgItem *RsMsgSerialiser::deserialiseItem(void *data, uint32_t *pktsize)
ok &= item->msgbcc.GetTlv(data, rssize, &offset);
ok &= item->attachment.GetTlv(data, rssize, &offset);
if (m_bConfiguration) {
// deserialise msgId too
// ok &= getRawUInt32(data, rssize, &offset, &(item->msgId));
getRawUInt32(data, rssize, &offset, &(item->msgId)); //use this line for backward compatibility
}
if (offset != rssize)
{
/* error */