diff options
| -rw-r--r-- | Swiften/MUC/MUCImpl.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Swiften/MUC/MUCImpl.cpp b/Swiften/MUC/MUCImpl.cpp index 99789c0..a1854e3 100644 --- a/Swiften/MUC/MUCImpl.cpp +++ b/Swiften/MUC/MUCImpl.cpp @@ -233,19 +233,19 @@ void MUCImpl::handleIncomingPresence(Presence::ref presence) { } if (createAsReservedIfNew) { unlocking = true; requestConfigurationForm(); } else { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); presenceSender->addDirectedPresenceReceiver(ownMUCJID, DirectedPresenceSender::DontSendPresence); mucPayload->setPayload(boost::make_shared<Form>(Form::SubmitType)); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr< GenericRequest<MUCOwnerPayload> > request = boost::make_shared< GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2)); request->send(); } } } if (!isLocked && !isUnlocked_ && (presence->getFrom() == ownMUCJID)) { isUnlocked_ = true; onUnlocked(); } @@ -279,50 +279,50 @@ void MUCImpl::kickOccupant(const JID& jid) { /** * Call with the room JID, not the real JID. */ void MUCImpl::changeOccupantRole(const JID& jid, MUCOccupant::Role role) { MUCAdminPayload::ref mucPayload = boost::make_shared<MUCAdminPayload>(); MUCItem item; item.role = role; item.nick = jid.getResource(); mucPayload->addItem(item); - GenericRequest<MUCAdminPayload>* request = new GenericRequest<MUCAdminPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleOccupantRoleChangeResponse, this, _1, _2, jid, role)); request->send(); } void MUCImpl::handleOccupantRoleChangeResponse(MUCAdminPayload::ref /*unused*/, ErrorPayload::ref error, const JID& jid, MUCOccupant::Role role) { if (error) { onRoleChangeFailed(error, jid, role); } } void MUCImpl::requestAffiliationList(MUCOccupant::Affiliation affiliation) { MUCAdminPayload::ref mucPayload = boost::make_shared<MUCAdminPayload>(); MUCItem item; item.affiliation = affiliation; mucPayload->addItem(item); - GenericRequest<MUCAdminPayload>* request = new GenericRequest<MUCAdminPayload>(IQ::Get, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared< GenericRequest<MUCAdminPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationListResponse, this, _1, _2, affiliation)); request->send(); } /** * Must be called with the real JID, not the room JID. */ void MUCImpl::changeAffiliation(const JID& jid, MUCOccupant::Affiliation affiliation) { MUCAdminPayload::ref mucPayload = boost::make_shared<MUCAdminPayload>(); MUCItem item; item.affiliation = affiliation; item.realJID = jid.toBare(); mucPayload->addItem(item); - GenericRequest<MUCAdminPayload>* request = new GenericRequest<MUCAdminPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCAdminPayload> > request = boost::make_shared<GenericRequest<MUCAdminPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleAffiliationChangeResponse, this, _1, _2, jid, affiliation)); request->send(); } void MUCImpl::handleAffiliationListResponse(MUCAdminPayload::ref payload, ErrorPayload::ref error, MUCOccupant::Affiliation affiliation) { if (error) { onAffiliationListFailed(error); } else { @@ -346,27 +346,27 @@ void MUCImpl::changeSubject(const std::string& subject) { Message::ref message = boost::make_shared<Message>(); message->setSubject(subject); message->setType(Message::Groupchat); message->setTo(ownMUCJID.toBare()); stanzaChannel->sendMessage(message); } void MUCImpl::requestConfigurationForm() { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Get, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Get, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationFormReceived, this, _1, _2)); request->send(); } void MUCImpl::cancelConfigureRoom() { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); mucPayload->setPayload(boost::make_shared<Form>(Form::CancelType)); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->send(); } void MUCImpl::handleConfigurationFormReceived(MUCOwnerPayload::ref payload, ErrorPayload::ref error) { Form::ref form; if (payload) { form = payload->getForm(); } if (error || !form) { @@ -379,33 +379,33 @@ void MUCImpl::handleConfigurationFormReceived(MUCOwnerPayload::ref payload, Erro void MUCImpl::handleConfigurationResultReceived(MUCOwnerPayload::ref /*payload*/, ErrorPayload::ref error) { if (error) { onConfigurationFailed(error); } } void MUCImpl::configureRoom(Form::ref form) { MUCOwnerPayload::ref mucPayload(new MUCOwnerPayload()); mucPayload->setPayload(form); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr<GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); if (unlocking) { request->onResponse.connect(boost::bind(&MUCImpl::handleCreationConfigResponse, this, _1, _2)); } else { request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationResultReceived, this, _1, _2)); } request->send(); } void MUCImpl::destroyRoom() { MUCOwnerPayload::ref mucPayload = boost::make_shared<MUCOwnerPayload>(); MUCDestroyPayload::ref mucDestroyPayload = boost::make_shared<MUCDestroyPayload>(); mucPayload->setPayload(mucDestroyPayload); - GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_); + boost::shared_ptr< GenericRequest<MUCOwnerPayload> > request = boost::make_shared<GenericRequest<MUCOwnerPayload> >(IQ::Set, getJID(), mucPayload, iqRouter_); request->onResponse.connect(boost::bind(&MUCImpl::handleConfigurationResultReceived, this, _1, _2)); request->send(); } void MUCImpl::invitePerson(const JID& person, const std::string& reason, bool isImpromptu, bool isReuseChat) { Message::ref message = boost::make_shared<Message>(); message->setTo(person); message->setType(Message::Normal); MUCInvitationPayload::ref invite = boost::make_shared<MUCInvitationPayload>(); |
Swift