diff options
Diffstat (limited to 'Swift/Controllers/Roster/ContactRosterItem.cpp')
-rw-r--r-- | Swift/Controllers/Roster/ContactRosterItem.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp index 3258fb5..89053e6 100644 --- a/Swift/Controllers/Roster/ContactRosterItem.cpp +++ b/Swift/Controllers/Roster/ContactRosterItem.cpp @@ -27,149 +27,149 @@ ContactRosterItem::~ContactRosterItem() { } StatusShow::Type ContactRosterItem::getStatusShow() const { - return presence_ ? presence_->getShow() : StatusShow::None; + return presence_ ? presence_->getShow() : StatusShow::None; } StatusShow::Type ContactRosterItem::getSimplifiedStatusShow() const { - switch (presence_ ? presence_->getShow() : StatusShow::None) { - case StatusShow::Online: return StatusShow::Online; - case StatusShow::Away: return StatusShow::Away; - case StatusShow::XA: return StatusShow::Away; - case StatusShow::FFC: return StatusShow::Online; - case StatusShow::DND: return StatusShow::DND; - case StatusShow::None: return StatusShow::None; - } - assert(false); - return StatusShow::None; + switch (presence_ ? presence_->getShow() : StatusShow::None) { + case StatusShow::Online: return StatusShow::Online; + case StatusShow::Away: return StatusShow::Away; + case StatusShow::XA: return StatusShow::Away; + case StatusShow::FFC: return StatusShow::Online; + case StatusShow::DND: return StatusShow::DND; + case StatusShow::None: return StatusShow::None; + } + assert(false); + return StatusShow::None; } std::string ContactRosterItem::getStatusText() const { - return presence_ ? presence_->getStatus() : ""; + return presence_ ? presence_->getStatus() : ""; } std::string ContactRosterItem::getIdleText() const { - Idle::ref idle = presence_ ? presence_->getPayload<Idle>() : Idle::ref(); - if (!idle || idle->getSince().is_not_a_date_time()) { - return ""; - } else { - return dateTimeToLocalString(idle->getSince()); - } + Idle::ref idle = presence_ ? presence_->getPayload<Idle>() : Idle::ref(); + if (!idle || idle->getSince().is_not_a_date_time()) { + return ""; + } else { + return dateTimeToLocalString(idle->getSince()); + } } std::string ContactRosterItem::getOfflineSinceText() const { - if (presence_ && presence_->getType() == Presence::Unavailable) { - boost::optional<boost::posix_time::ptime> delay = presence_->getTimestamp(); - if (delay) { - return dateTimeToLocalString(*delay); - } - } - return ""; + if (presence_ && presence_->getType() == Presence::Unavailable) { + boost::optional<boost::posix_time::ptime> delay = presence_->getTimestamp(); + if (delay) { + return dateTimeToLocalString(*delay); + } + } + return ""; } void ContactRosterItem::setAvatarPath(const boost::filesystem::path& path) { - avatarPath_ = path; - onDataChanged(); + avatarPath_ = path; + onDataChanged(); } const boost::filesystem::path& ContactRosterItem::getAvatarPath() const { - return avatarPath_; + return avatarPath_; } const JID& ContactRosterItem::getJID() const { - return jid_; + return jid_; } void ContactRosterItem::setDisplayJID(const JID& jid) { - displayJID_ = jid; + displayJID_ = jid; } const JID& ContactRosterItem::getDisplayJID() const { - return displayJID_; + return displayJID_; } typedef std::pair<std::string, boost::shared_ptr<Presence> > StringPresencePair; void ContactRosterItem::clearPresence() { - presence_.reset(); - onDataChanged(); + presence_.reset(); + onDataChanged(); } void ContactRosterItem::applyPresence(boost::shared_ptr<Presence> presence) { - presence_ = presence; - onDataChanged(); + presence_ = presence; + onDataChanged(); } const std::vector<std::string>& ContactRosterItem::getGroups() const { - return groups_; + return groups_; } /** Only used so a contact can know about the groups it's in*/ void ContactRosterItem::addGroup(const std::string& group) { - groups_.push_back(group); + groups_.push_back(group); } void ContactRosterItem::removeGroup(const std::string& group) { - groups_.erase(std::remove(groups_.begin(), groups_.end(), group), groups_.end()); + groups_.erase(std::remove(groups_.begin(), groups_.end(), group), groups_.end()); } MUCOccupant::Role ContactRosterItem::getMUCRole() const { - return mucRole_; + return mucRole_; } void ContactRosterItem::setMUCRole(const MUCOccupant::Role& role) { - mucRole_ = role; + mucRole_ = role; } MUCOccupant::Affiliation ContactRosterItem::getMUCAffiliation() const { - return mucAffiliation_; + return mucAffiliation_; } void ContactRosterItem::setMUCAffiliation(const MUCOccupant::Affiliation& affiliation) { - mucAffiliation_ = affiliation; + mucAffiliation_ = affiliation; } std::string ContactRosterItem::getMUCAffiliationText() const { - std::string affiliationString; - switch (mucAffiliation_) { - case MUCOccupant::Owner: affiliationString = QT_TRANSLATE_NOOP("", "Owner"); break; - case MUCOccupant::Admin: affiliationString = QT_TRANSLATE_NOOP("", "Admin"); break; - case MUCOccupant::Member: affiliationString = QT_TRANSLATE_NOOP("", "Member"); break; - case MUCOccupant::Outcast: affiliationString = QT_TRANSLATE_NOOP("", "Outcast"); break; - case MUCOccupant::NoAffiliation: affiliationString = ""; break; - } + std::string affiliationString; + switch (mucAffiliation_) { + case MUCOccupant::Owner: affiliationString = QT_TRANSLATE_NOOP("", "Owner"); break; + case MUCOccupant::Admin: affiliationString = QT_TRANSLATE_NOOP("", "Admin"); break; + case MUCOccupant::Member: affiliationString = QT_TRANSLATE_NOOP("", "Member"); break; + case MUCOccupant::Outcast: affiliationString = QT_TRANSLATE_NOOP("", "Outcast"); break; + case MUCOccupant::NoAffiliation: affiliationString = ""; break; + } - return affiliationString; + return affiliationString; } void ContactRosterItem::setSupportedFeatures(const std::set<Feature>& features) { - features_ = features; - onDataChanged(); + features_ = features; + onDataChanged(); } bool ContactRosterItem::supportsFeature(const Feature feature) const { - return features_.find(feature) != features_.end(); + return features_.find(feature) != features_.end(); } void ContactRosterItem::setBlockState(BlockState state) { - blockState_ = state; - onDataChanged(); + blockState_ = state; + onDataChanged(); } ContactRosterItem::BlockState ContactRosterItem::blockState() const { - return blockState_; + return blockState_; } VCard::ref ContactRosterItem::getVCard() const { - return vcard_; + return vcard_; } void ContactRosterItem::setVCard(VCard::ref vcard) { - vcard_ = vcard; - onDataChanged(); + vcard_ = vcard; + onDataChanged(); } } |