Change ChatroomInfo to contain more information
Change-Id: Ie91ced5dd9be51c8d59a0c5d881967658a58fd15
diff --git a/src/chatroom-discovery-logic.cpp b/src/chatroom-discovery-logic.cpp
index 048d121..8d8590b 100644
--- a/src/chatroom-discovery-logic.cpp
+++ b/src/chatroom-discovery-logic.cpp
@@ -151,18 +151,18 @@
const ndn::Data& data,
const bool isRefreshing)
{
- Name::Component chatroomName = data.getName().get(OFFSET_CHATROOM_NAME);
+ // Name::Component chatroomName = data.getName().get(OFFSET_CHATROOM_NAME);
ChatroomInfo chatroom;
chatroom.wireDecode(data.getContent().blockFromValue());
- chatroom.setName(chatroomName);
+ // chatroom.setName(chatroomName);
// Tmp Disabled
// if (chatroom.getTrustModel() == ChatroomInfo::TRUST_MODEL_WEBOFTRUST)
// addContacts(chatroom);
- m_chatrooms[chatroomName] = chatroom;
+ m_chatrooms[chatroom.getName()] = chatroom;
m_onUpdate(chatroom, true); //add
time::milliseconds refreshingTime;
@@ -172,7 +172,8 @@
refreshingTime = DEFAULT_REFRESHING_TIMER;
m_scheduler.scheduleEvent(refreshingTime,
- bind(&ChatroomDiscoveryLogic::refreshChatroom, this, chatroomName));
+ bind(&ChatroomDiscoveryLogic::refreshChatroom, this,
+ chatroom.getName()));
if (!isRefreshing)
sendDiscoveryInterest();
@@ -218,4 +219,4 @@
}
-} //namespace chronos
+} // namespace chronos