diff options
Diffstat (limited to 'Swift/Controllers/ContactsFromXMPPRoster.cpp')
| -rw-r--r-- | Swift/Controllers/ContactsFromXMPPRoster.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Swift/Controllers/ContactsFromXMPPRoster.cpp b/Swift/Controllers/ContactsFromXMPPRoster.cpp index d3d7364..1cab9b1 100644 --- a/Swift/Controllers/ContactsFromXMPPRoster.cpp +++ b/Swift/Controllers/ContactsFromXMPPRoster.cpp | |||
| @@ -3,20 +3,19 @@ | |||
| 3 | * Licensed under the simplified BSD license. | 3 | * Licensed under the simplified BSD license. |
| 4 | * See Documentation/Licenses/BSD-simplified.txt for more information. | 4 | * See Documentation/Licenses/BSD-simplified.txt for more information. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | /* | 7 | /* |
| 8 | * Copyright (c) 2014 Isode Limited. | 8 | * Copyright (c) 2014-2015 Isode Limited. |
| 9 | * All rights reserved. | 9 | * All rights reserved. |
| 10 | * See the COPYING file for more information. | 10 | * See the COPYING file for more information. |
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <Swift/Controllers/ContactsFromXMPPRoster.h> | 13 | #include <Swift/Controllers/ContactsFromXMPPRoster.h> |
| 14 | 14 | ||
| 15 | #include <Swiften/Base/foreach.h> | ||
| 16 | |||
| 17 | #include <Swiften/Avatars/AvatarManager.h> | 15 | #include <Swiften/Avatars/AvatarManager.h> |
| 16 | #include <Swiften/Base/foreach.h> | ||
| 18 | #include <Swiften/Presence/PresenceOracle.h> | 17 | #include <Swiften/Presence/PresenceOracle.h> |
| 19 | #include <Swiften/Roster/XMPPRoster.h> | 18 | #include <Swiften/Roster/XMPPRoster.h> |
| 20 | #include <Swiften/Roster/XMPPRosterItem.h> | 19 | #include <Swiften/Roster/XMPPRosterItem.h> |
| 21 | 20 | ||
| 22 | namespace Swift { | 21 | namespace Swift { |
| @@ -30,11 +29,11 @@ ContactsFromXMPPRoster::~ContactsFromXMPPRoster() { | |||
| 30 | std::vector<Contact::ref> ContactsFromXMPPRoster::getContacts(bool /*withMUCNicks*/) { | 29 | std::vector<Contact::ref> ContactsFromXMPPRoster::getContacts(bool /*withMUCNicks*/) { |
| 31 | std::vector<Contact::ref> results; | 30 | std::vector<Contact::ref> results; |
| 32 | std::vector<XMPPRosterItem> rosterItems = roster_->getItems(); | 31 | std::vector<XMPPRosterItem> rosterItems = roster_->getItems(); |
| 33 | foreach(const XMPPRosterItem& rosterItem, rosterItems) { | 32 | foreach(const XMPPRosterItem& rosterItem, rosterItems) { |
| 34 | Contact::ref contact = boost::make_shared<Contact>(rosterItem.getName().empty() ? rosterItem.getJID().toString() : rosterItem.getName(), rosterItem.getJID(), StatusShow::None,""); | 33 | Contact::ref contact = boost::make_shared<Contact>(rosterItem.getName().empty() ? rosterItem.getJID().toString() : rosterItem.getName(), rosterItem.getJID(), StatusShow::None,""); |
| 35 | contact->statusType = presenceOracle_->getHighestPriorityPresence(contact->jid) ? presenceOracle_->getHighestPriorityPresence(contact->jid)->getShow() : StatusShow::None; | 34 | contact->statusType = presenceOracle_->getAccountPresence(contact->jid) ? presenceOracle_->getAccountPresence(contact->jid)->getShow() : StatusShow::None; |
| 36 | contact->avatarPath = avatarManager_->getAvatarPath(contact->jid); | 35 | contact->avatarPath = avatarManager_->getAvatarPath(contact->jid); |
| 37 | results.push_back(contact); | 36 | results.push_back(contact); |
| 38 | } | 37 | } |
| 39 | return results; | 38 | return results; |
| 40 | } | 39 | } |
Swift