summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Presence/PayloadAddingPresenceSender.cpp')
-rw-r--r--Swiften/Presence/PayloadAddingPresenceSender.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/Swiften/Presence/PayloadAddingPresenceSender.cpp b/Swiften/Presence/PayloadAddingPresenceSender.cpp
index 750e364..e5d2688 100644
--- a/Swiften/Presence/PayloadAddingPresenceSender.cpp
+++ b/Swiften/Presence/PayloadAddingPresenceSender.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -12,37 +12,37 @@ PayloadAddingPresenceSender::PayloadAddingPresenceSender(PresenceSender* sender)
}
void PayloadAddingPresenceSender::sendPresence(Presence::ref presence) {
- if (presence->isAvailable()) {
- if (!presence->getTo().isValid()) {
- lastSentPresence = presence;
- }
- }
- else {
- lastSentPresence.reset();
- }
- if (payload) {
- Presence::ref sentPresence = Presence::create(presence);
- sentPresence->updatePayload(payload);
- sender->sendPresence(sentPresence);
- }
- else {
- sender->sendPresence(presence);
- }
+ if (presence->isAvailable()) {
+ if (!presence->getTo().isValid()) {
+ lastSentPresence = presence;
+ }
+ }
+ else {
+ lastSentPresence.reset();
+ }
+ if (payload) {
+ Presence::ref sentPresence = Presence::create(presence);
+ sentPresence->updatePayload(payload);
+ sender->sendPresence(sentPresence);
+ }
+ else {
+ sender->sendPresence(presence);
+ }
}
bool PayloadAddingPresenceSender::isAvailable() const {
- return sender->isAvailable();
+ return sender->isAvailable();
}
-void PayloadAddingPresenceSender::setPayload(boost::shared_ptr<Payload> payload) {
- this->payload = payload;
- if (lastSentPresence) {
- sendPresence(lastSentPresence);
- }
+void PayloadAddingPresenceSender::setPayload(std::shared_ptr<Payload> payload) {
+ this->payload = payload;
+ if (lastSentPresence) {
+ sendPresence(lastSentPresence);
+ }
}
void PayloadAddingPresenceSender::reset() {
- lastSentPresence.reset();
+ lastSentPresence.reset();
}
}