summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-06 08:00:44 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-06 10:49:49 (GMT)
commit081fc03556708447610e9697a57235fa191a4f0d (patch)
tree505c8cc9129d2b44968d183a180f0ccddaa08810 /Swiften/Roster/SetPresence.h
parent8c53236875d2ca77f1b463449918458f6b424ab1 (diff)
downloadswift-081fc03556708447610e9697a57235fa191a4f0d.zip
swift-081fc03556708447610e9697a57235fa191a4f0d.tar.bz2
Rewrite of large amounts of roster code.
Now keeps widgets out of Swiften, keeps sorting inside Swiften, and keeps track of presences to show the correct presence per roster item. Resolves: #316 Resolves: #81 Resolves: #239
Diffstat (limited to 'Swiften/Roster/SetPresence.h')
-rw-r--r--Swiften/Roster/SetPresence.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/Swiften/Roster/SetPresence.h b/Swiften/Roster/SetPresence.h
index 9cc3ba9..134a63d 100644
--- a/Swiften/Roster/SetPresence.h
+++ b/Swiften/Roster/SetPresence.h
@@ -4,8 +4,7 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef SWIFTEN_SetPresence_H
-#define SWIFTEN_SetPresence_H
+#pragma once
#include "Swiften/Elements/Presence.h"
#include "Swiften/JID/JID.h"
@@ -24,13 +23,7 @@ class SetPresence : public RosterItemOperation {
virtual void operator() (RosterItem* item) const {
ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item);
if (contact && contact->getJID().equals(presence_->getFrom(), compareType_)) {
- if (presence_->getType() != Presence::Available) {
- contact->setStatusShow(StatusShow::None);
- contact->setStatusText(presence_->getStatus());
- } else {
- contact->setStatusShow(presence_->getShow());
- contact->setStatusText(presence_->getStatus());
- }
+ contact->applyPresence(presence_->getFrom().getResource(), presence_);
}
}
@@ -40,5 +33,4 @@ class SetPresence : public RosterItemOperation {
};
}
-#endif