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 | |||
| @@ -92,11 +92,11 @@ typedef std::pair<std::string, boost::shared_ptr<Presence> > StringPresencePair; | |||
| 92 | void ContactRosterItem::clearPresence() { | 92 | void ContactRosterItem::clearPresence() { |
| 93 | presence_.reset(); | 93 | presence_.reset(); |
| 94 | onDataChanged(); | 94 | onDataChanged(); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | void ContactRosterItem::applyPresence(const std::string& resource, boost::shared_ptr<Presence> presence) { | 97 | void ContactRosterItem::applyPresence(boost::shared_ptr<Presence> presence) { |
| 98 | presence_ = presence; | 98 | presence_ = presence; |
| 99 | onDataChanged(); | 99 | onDataChanged(); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | const std::vector<std::string>& ContactRosterItem::getGroups() const { | 102 | const std::vector<std::string>& ContactRosterItem::getGroups() const { |
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 | |||
| @@ -53,11 +53,11 @@ class ContactRosterItem : public RosterItem { | |||
| 53 | void setAvatarPath(const boost::filesystem::path& path); | 53 | void setAvatarPath(const boost::filesystem::path& path); |
| 54 | const boost::filesystem::path& getAvatarPath() const; | 54 | const boost::filesystem::path& getAvatarPath() const; |
| 55 | const JID& getJID() const; | 55 | const JID& getJID() const; |
| 56 | void setDisplayJID(const JID& jid); | 56 | void setDisplayJID(const JID& jid); |
| 57 | const JID& getDisplayJID() const; | 57 | const JID& getDisplayJID() const; |
| 58 | void applyPresence(const std::string& resource, boost::shared_ptr<Presence> presence); | 58 | void applyPresence(boost::shared_ptr<Presence> presence); |
| 59 | const std::vector<std::string>& getGroups() const; | 59 | const std::vector<std::string>& getGroups() const; |
| 60 | /** Only used so a contact can know about the groups it's in*/ | 60 | /** Only used so a contact can know about the groups it's in*/ |
| 61 | void addGroup(const std::string& group); | 61 | void addGroup(const std::string& group); |
| 62 | void removeGroup(const std::string& group); | 62 | void removeGroup(const std::string& group); |
| 63 | void clearPresence(); | 63 | void clearPresence(); |
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,18 +1,18 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010 Isode Limited. | 2 | * Copyright (c) 2010-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #pragma once | 7 | #pragma once |
| 8 | 8 | ||
| 9 | #include <Swiften/Elements/Presence.h> | 9 | #include <Swiften/Elements/Presence.h> |
| 10 | #include <Swiften/JID/JID.h> | 10 | #include <Swiften/JID/JID.h> |
| 11 | 11 | ||
| 12 | #include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> | ||
| 13 | #include <Swift/Controllers/Roster/ContactRosterItem.h> | 12 | #include <Swift/Controllers/Roster/ContactRosterItem.h> |
| 13 | #include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> | ||
| 14 | 14 | ||
| 15 | namespace Swift { | 15 | namespace Swift { |
| 16 | 16 | ||
| 17 | class RosterItem; | 17 | class RosterItem; |
| 18 | 18 | ||
| @@ -22,11 +22,11 @@ class SetPresence : public RosterItemOperation { | |||
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | virtual void operator() (RosterItem* item) const { | 24 | virtual void operator() (RosterItem* item) const { |
| 25 | ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item); | 25 | ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item); |
| 26 | if (contact && contact->getJID().equals(presence_->getFrom(), compareType_)) { | 26 | if (contact && contact->getJID().equals(presence_->getFrom(), compareType_)) { |
| 27 | contact->applyPresence(presence_->getFrom().getResource(), presence_); | 27 | contact->applyPresence(presence_); |
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | private: | 31 | private: |
| 32 | Presence::ref presence_; | 32 | Presence::ref presence_; |
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 | |||
| @@ -375,11 +375,11 @@ void RosterController::handleAvatarChanged(const JID& jid) { | |||
| 375 | } | 375 | } |
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | void RosterController::handlePresenceChanged(Presence::ref presence) { | 378 | void RosterController::handlePresenceChanged(Presence::ref presence) { |
| 379 | if (presence->getFrom().equals(myJID_, JID::WithResource)) { | 379 | if (presence->getFrom().equals(myJID_, JID::WithResource)) { |
| 380 | ownContact_->applyPresence(std::string(), presence); | 380 | ownContact_->applyPresence(presence); |
| 381 | mainWindow_->setMyContactRosterItem(ownContact_); | 381 | mainWindow_->setMyContactRosterItem(ownContact_); |
| 382 | } | 382 | } |
| 383 | else { | 383 | else { |
| 384 | handleIncomingPresence(presence); | 384 | handleIncomingPresence(presence); |
| 385 | } | 385 | } |
Swift