summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Presence/PayloadAddingPresenceSender.cpp')
-rw-r--r--Swiften/Presence/PayloadAddingPresenceSender.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/Swiften/Presence/PayloadAddingPresenceSender.cpp b/Swiften/Presence/PayloadAddingPresenceSender.cpp
index 750e364..2f55374 100644
--- a/Swiften/Presence/PayloadAddingPresenceSender.cpp
+++ b/Swiften/Presence/PayloadAddingPresenceSender.cpp
@@ -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);
- }
+ this->payload = payload;
+ if (lastSentPresence) {
+ sendPresence(lastSentPresence);
+ }
}
void PayloadAddingPresenceSender::reset() {
- lastSentPresence.reset();
+ lastSentPresence.reset();
}
}