From 4f4240d570ae6982e2ae475559ab0b026d31d0a9 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 3 May 2017 22:43:16 +0200 Subject: [PATCH] fixed bug in history serializer --- libretroshare/src/rsitems/rshistoryitems.cc | 6 +++--- libretroshare/src/rsitems/rshistoryitems.h | 2 +- libretroshare/src/serialiser/rsserializer.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/rsitems/rshistoryitems.cc b/libretroshare/src/rsitems/rshistoryitems.cc index 23aa9e38f..a66299b51 100644 --- a/libretroshare/src/rsitems/rshistoryitems.cc +++ b/libretroshare/src/rsitems/rshistoryitems.cc @@ -51,12 +51,12 @@ void RsHistoryMsgItem::serial_process(RsGenericSerializer::SerializeJob j,RsGene RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_MSG,message,"message") ; } -RsItem *RsHistorySerialiser::create_item(uint8_t serial_class,uint8_t serial_type) const +RsItem *RsHistorySerialiser::create_item(uint8_t item_type,uint8_t item_subtype) const { - if(serial_class != RS_PKT_CLASS_CONFIG) + if(item_type != RS_PKT_TYPE_HISTORY_CONFIG) return NULL ; - if(serial_type == RS_PKT_SUBTYPE_DEFAULT) + if(item_subtype == RS_PKT_SUBTYPE_DEFAULT) return new RsHistoryMsgItem(); return NULL ; diff --git a/libretroshare/src/rsitems/rshistoryitems.h b/libretroshare/src/rsitems/rshistoryitems.h index 04d3e9ca7..802754e91 100644 --- a/libretroshare/src/rsitems/rshistoryitems.h +++ b/libretroshare/src/rsitems/rshistoryitems.h @@ -63,7 +63,7 @@ public: RsHistorySerialiser() : RsConfigSerializer(RS_PKT_CLASS_CONFIG, RS_PKT_TYPE_HISTORY_CONFIG) {} virtual ~RsHistorySerialiser() {} - virtual RsItem *create_item(uint8_t service,uint8_t type) const ; + virtual RsItem *create_item(uint8_t item_type,uint8_t item_subtype) const ; }; /**************************************************************************/ diff --git a/libretroshare/src/serialiser/rsserializer.h b/libretroshare/src/serialiser/rsserializer.h index c9f1f6403..2cae93ab7 100644 --- a/libretroshare/src/serialiser/rsserializer.h +++ b/libretroshare/src/serialiser/rsserializer.h @@ -289,7 +289,7 @@ public: /*! create_item * should be overloaded to create the correct type of item depending on the data */ - virtual RsItem *create_item(uint8_t /* class */, uint8_t /* item_type */) const=0; + virtual RsItem *create_item(uint8_t /* item_type */, uint8_t /* item_sub_type */) const=0; RsItem *deserialise(void *data,uint32_t *size) ; };