diff options
Diffstat (limited to 'Swift/Controllers')
| -rw-r--r-- | Swift/Controllers/Roster/ContactRosterItem.cpp | 2 | ||||
| -rw-r--r-- | Swift/Controllers/Roster/ContactRosterItem.h | 2 | ||||
| -rw-r--r-- | Swift/Controllers/Roster/ItemOperations/SetPresence.h | 6 | ||||
| -rw-r--r-- | Swift/Controllers/Roster/RosterController.cpp | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp index ae05aee..3258fb5 100644 --- a/Swift/Controllers/Roster/ContactRosterItem.cpp +++ b/Swift/Controllers/Roster/ContactRosterItem.cpp @@ -88,19 +88,19 @@ const JID& ContactRosterItem::getDisplayJID() const { typedef std::pair<std::string, boost::shared_ptr<Presence> > StringPresencePair; void ContactRosterItem::clearPresence() { presence_.reset(); onDataChanged(); } -void ContactRosterItem::applyPresence(const std::string& resource, boost::shared_ptr<Presence> presence) { +void ContactRosterItem::applyPresence(boost::shared_ptr<Presence> presence) { presence_ = presence; onDataChanged(); } const std::vector<std::string>& ContactRosterItem::getGroups() const { return groups_; } /** Only used so a contact can know about the groups it's in*/ diff --git a/Swift/Controllers/Roster/ContactRosterItem.h b/Swift/Controllers/Roster/ContactRosterItem.h index ec04a8c..d21935c 100644 --- a/Swift/Controllers/Roster/ContactRosterItem.h +++ b/Swift/Controllers/Roster/ContactRosterItem.h @@ -49,19 +49,19 @@ class ContactRosterItem : public RosterItem { StatusShow::Type getSimplifiedStatusShow() const; std::string getStatusText() const; std::string getIdleText() const; std::string getOfflineSinceText() const; void setAvatarPath(const boost::filesystem::path& path); const boost::filesystem::path& getAvatarPath() const; const JID& getJID() const; void setDisplayJID(const JID& jid); const JID& getDisplayJID() const; - void applyPresence(const std::string& resource, boost::shared_ptr<Presence> presence); + void applyPresence(boost::shared_ptr<Presence> presence); const std::vector<std::string>& getGroups() const; /** Only used so a contact can know about the groups it's in*/ void addGroup(const std::string& group); void removeGroup(const std::string& group); void clearPresence(); MUCOccupant::Role getMUCRole() const; void setMUCRole(const MUCOccupant::Role& role); MUCOccupant::Affiliation getMUCAffiliation() const; diff --git a/Swift/Controllers/Roster/ItemOperations/SetPresence.h b/Swift/Controllers/Roster/ItemOperations/SetPresence.h index 0b54237..2b5bbbe 100644 --- a/Swift/Controllers/Roster/ItemOperations/SetPresence.h +++ b/Swift/Controllers/Roster/ItemOperations/SetPresence.h @@ -1,36 +1,36 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <Swiften/Elements/Presence.h> #include <Swiften/JID/JID.h> -#include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> #include <Swift/Controllers/Roster/ContactRosterItem.h> +#include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> namespace Swift { class RosterItem; class SetPresence : public RosterItemOperation { public: SetPresence(Presence::ref presence, JID::CompareType compareType = JID::WithoutResource) : RosterItemOperation(true, compareType == JID::WithoutResource ? presence->getFrom().toBare() : presence->getFrom()), presence_(presence), compareType_(compareType) { } virtual void operator() (RosterItem* item) const { ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item); if (contact && contact->getJID().equals(presence_->getFrom(), compareType_)) { - contact->applyPresence(presence_->getFrom().getResource(), presence_); + contact->applyPresence(presence_); } } private: Presence::ref presence_; JID::CompareType compareType_; }; } diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp index 751ca32..75acaa9 100644 --- a/Swift/Controllers/Roster/RosterController.cpp +++ b/Swift/Controllers/Roster/RosterController.cpp @@ -371,19 +371,19 @@ void RosterController::handleAvatarChanged(const JID& jid) { if (jid.equals(myJID_, JID::WithoutResource)) { mainWindow_->setMyAvatarPath(pathToString(path)); ownContact_->setAvatarPath(pathToString(path)); mainWindow_->setMyContactRosterItem(ownContact_); } } void RosterController::handlePresenceChanged(Presence::ref presence) { if (presence->getFrom().equals(myJID_, JID::WithResource)) { - ownContact_->applyPresence(std::string(), presence); + ownContact_->applyPresence(presence); mainWindow_->setMyContactRosterItem(ownContact_); } else { handleIncomingPresence(presence); } } boost::optional<XMPPRosterItem> RosterController::getItem(const JID& jid) const { return xmppRoster_->getItem(jid); |
Swift