/* * Copyright (c) 2017 Tarun Gupta * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include #include #include namespace Swift { MIXParticipantSerializer::MIXParticipantSerializer() : GenericPayloadSerializer() { } std::string MIXParticipantSerializer::serializePayload(std::shared_ptr payload) const { XMLElement participantElement("participant", "urn:xmpp:mix:0"); if (payload->getNick()) { std::shared_ptr nickElement = std::make_shared("nick"); nickElement->addNode(std::make_shared(*payload->getNick())); participantElement.addNode(nickElement); } if (payload->getJID()) { std::shared_ptr jidElement = std::make_shared("jid"); jidElement->addNode(std::make_shared(*payload->getJID())); participantElement.addNode(jidElement); } return participantElement.serialize(); } }