diff --git a/src/chatroom-info.cpp b/src/chatroom-info.cpp
index 2b23719..f6b81e3 100644
--- a/src/chatroom-info.cpp
+++ b/src/chatroom-info.cpp
@@ -27,27 +27,62 @@
 {
   size_t totalLength = 0;
 
-  //Chatroom := CHATROOM-TYPE TLV-LENGTH
-  //              TrustModel
-  //              Participant+
+  // ChatroomInfo := CHATROOM-INFO-TYPE TLV-LENGTH
+  //                   ChatroomName
+  //                   TrustModel
+  //                   ChatroomPrefix
+  //                   ManagerPrefix
+  //                   Participants
+  //
+  // ChatroomName := CHATROOM-NAME-TYPE TLV-LENGTH
+  //                   NameComponent
+  //
+  // TrustModel := TRUST-MODEL-TYPE TLV-LENGTH
+  //                 nonNegativeInteger
+  //
+  // ChatroomPrefix := CHATROOM-PREFIX-TYPE TLV-LENGTH
+  //                     Name
+  //
+  // ManagerPrefix := MANAGER-PREFIX-TYPE TLV-LENGTH
+  //                    Name
+  //
+  // Participants := PARTICIPANTS-TYPE TLV-LENGTH
+  //                   Name+
 
-  //Participants
-  for (std::vector<Name>::const_reverse_iterator it = m_participants.rbegin();
+  // Participants
+  size_t participantsLength = 0;
+  for (std::list<Name>::const_reverse_iterator it = m_participants.rbegin();
        it != m_participants.rend(); ++it) {
-    size_t entryLength = 0;
-
-    entryLength += it->wireEncode(block);
-    entryLength += block.prependVarNumber(entryLength);
-    entryLength += block.prependVarNumber(tlv::PARTICIPANT);
-    totalLength += entryLength;
+    participantsLength += it->wireEncode(block);
   }
+  participantsLength += block.prependVarNumber(participantsLength);
+  participantsLength += block.prependVarNumber(tlv::Participants);
+  totalLength += participantsLength;
 
-  //TrustModel
-  totalLength += prependNonNegativeIntegerBlock(block, tlv::TRUSTMODEL, m_trustModel);
+  // Manager Prefix
+  size_t managerLength = m_manager.wireEncode(block);
+  totalLength += managerLength;
+  totalLength += block.prependVarNumber(managerLength);
+  totalLength += block.prependVarNumber(tlv::ManagerPrefix);
 
-  //type = TYPE_CHATROOM;
+  // Chatroom Sync Prefix
+  size_t chatroomSyncPrefixLength = m_syncPrefix.wireEncode(block);
+  totalLength += chatroomSyncPrefixLength;
+  totalLength += block.prependVarNumber(chatroomSyncPrefixLength);
+  totalLength += block.prependVarNumber(tlv::ChatroomPrefix);
+
+  // Trust Model
+  totalLength += prependNonNegativeIntegerBlock(block, tlv::TrustModel, m_trustModel);
+
+  // Chatroom Name
+  size_t chatroomNameLength = m_chatroomName.wireEncode(block);
+  totalLength += chatroomNameLength;
+  totalLength += block.prependVarNumber(chatroomNameLength);
+  totalLength += block.prependVarNumber(tlv::ChatroomName);
+
+  // Chatroom Info
   totalLength += block.prependVarNumber(totalLength);
-  totalLength += block.prependVarNumber(tlv::CHATROOM);
+  totalLength += block.prependVarNumber(tlv::ChatroomInfo);
 
   return totalLength;
 }
@@ -75,37 +110,102 @@
 
   m_participants.clear();
 
-  //Chatroom := CHATROOM-TYPE TLV-LENGTH
-  //              TrustModel
-  //              Participant+
+  // ChatroomInfo := CHATROOM-INFO-TYPE TLV-LENGTH
+  //                   ChatroomName
+  //                   TrustModel
+  //                   ChatroomPrefix
+  //                   ManagerPrefix
+  //                   Participants
+  //
+  // ChatroomName := CHATROOM-NAME-TYPE TLV-LENGTH
+  //                   NameComponent
+  //
+  // TrustModel := TRUST-MODEL-TYPE TLV-LENGTH
+  //                 nonNegativeInteger
+  //
+  // ChatroomPrefix := CHATROOM-PREFIX-TYPE TLV-LENGTH
+  //                     Name
+  //
+  // ManagerPrefix := MANAGER-PREFIX-TYPE TLV-LENGTH
+  //                    Name
+  //
+  // Participants := PARTICIPANTS-TYPE TLV-LENGTH
+  //                   Name+
 
-  if (m_wire.type() != tlv::CHATROOM)
+  if (m_wire.type() != tlv::ChatroomInfo)
     throw Error("Unexpected TLV number when decoding chatroom packet");
 
+  // Chatroom Info
   Block::element_const_iterator i = m_wire.elements_begin();
 
-  //TrustModel
-  if (i == m_wire.elements_end() || i->type() != tlv::TRUSTMODEL)
+  if (i == m_wire.elements_end() || i->type() != tlv::ChatroomName)
+    throw Error("Missing Chatroom Name Info");
+  m_chatroomName.wireDecode(i->blockFromValue());
+
+  ++i;
+
+  // Trust Model
+  if (i == m_wire.elements_end() || i->type() != tlv::TrustModel)
     throw Error("Missing TrustModel");
   m_trustModel =
       static_cast<TrustModel>(readNonNegativeInteger(*i));
 
   ++i;
 
-  //Participants
-  for (; i != m_wire.elements_end() && i->type() == tlv::PARTICIPANT; ++i) {
-    Name name;
-    name.wireDecode(i->blockFromValue());
-    m_participants.push_back(name);
+  // Chatroom Sync Prefix
+  if (i == m_wire.elements_end() || i->type() != tlv::ChatroomPrefix)
+    throw Error("Missing Chatroom Prefix");
+  m_syncPrefix.wireDecode(i->blockFromValue());
+
+  ++i;
+
+  // Manager Prefix
+  if (i == m_wire.elements_end() || i->type() != tlv::ManagerPrefix)
+    throw Error("Missing Manager Prefix");
+  m_manager.wireDecode(i->blockFromValue());
+  ++i;
+
+  // Participants
+  if (i == m_wire.elements_end() || i->type() != tlv::Participants)
+    throw Error("Missing Participant");
+
+  Block temp = *i;
+  temp.parse();
+
+  Block::element_const_iterator j = temp.elements_begin();
+
+  while (j != temp.elements_end() && j->type() == tlv::Name) {
+    m_participants.push_back(Name(*j));
+    ++j;
   }
+  if (j != temp.elements_end())
+    throw Error("Unexpected element");
+
   if (m_participants.empty())
     throw Error("Missing Participant");
+
+  ++i;
+
   if (i != m_wire.elements_end()) {
     throw Error("Unexpected element");
   }
 }
 
 void
+ChatroomInfo::setName(const Name::Component& name)
+{
+  m_wire.reset();
+  m_chatroomName = name;
+}
+
+void
+ChatroomInfo::setTrustModel(const TrustModel trustModel)
+{
+  m_wire.reset();
+  m_trustModel = trustModel;
+}
+
+void
 ChatroomInfo::addParticipant(const Name& participant)
 {
   m_wire.reset();
@@ -113,24 +213,24 @@
 }
 
 void
-ChatroomInfo::addContact(const Name& contact)
+ChatroomInfo::removeParticipant(const Name& participant)
 {
   m_wire.reset();
-  m_contacts.push_back(contact);
+  m_participants.remove(participant);
 }
 
 void
-ChatroomInfo::setName(const Name::Component& name)
+ChatroomInfo::setSyncPrefix(const Name& prefix)
 {
   m_wire.reset();
-  m_name = name;
+  m_syncPrefix = prefix;
 }
 
 void
-ChatroomInfo::setTrustModel(const TrustModel trustModel)
+ChatroomInfo::setManager(const Name& manager)
 {
   m_wire.reset();
-  m_trustModel = trustModel;
+  m_manager = manager;
 }
 
-} //namespace chronos
+} // namespace chronos
