summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-07-14 13:10:43 (GMT)
committerRichard Maudsley <richard.maudsley@isode.com>2014-07-14 13:25:11 (GMT)
commit4386fa0e6fa8c361d51ec085aefa2d15a61d399a (patch)
treec21ba329bd28610eda23f2d2cc023d08d0c7b4e0 /Swiften
parentd949d1638c0778a6262c3afa13b55059a85b0499 (diff)
downloadswift-4386fa0e6fa8c361d51ec085aefa2d15a61d399a.zip
swift-4386fa0e6fa8c361d51ec085aefa2d15a61d399a.tar.bz2
Show status message instead of empty VCard dialog when receiving VCard or when an empty VCard is received.
Test-Information: Request VCard from a user in a MUC that is configured to NOT allow VCards from anonymous users and observe that "empty vcard" status message is displayed instead of an empty dialog. Check that VCard is displayed properly when a VCard is available and that the throbber is still functioning as before. Change-Id: I098b3ad9495b06b4efbca1547021311f5205cbf2
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Elements/VCard.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/Elements/VCard.h b/Swiften/Elements/VCard.h
index 84b6cfe..409a8ab 100644
--- a/Swiften/Elements/VCard.h
+++ b/Swiften/Elements/VCard.h
@@ -263,6 +263,16 @@ namespace Swift {
urls_.clear();
}
+ bool isEmpty() const {
+ bool empty = version_.empty() && fullName_.empty() && familyName_.empty() && givenName_.empty() && middleName_.empty() && prefix_.empty() && suffix_.empty();
+ empty &= photo_.empty() && photoType_.empty() && nick_.empty();
+ empty &= birthday_.is_not_a_date_time();
+ empty &= unknownContent_.empty();
+ empty &= emailAddresses_.empty() && telephones_.empty() && addresses_.empty() && addressLabels_.empty() && jids_.empty();
+ empty &= description_.empty() && organizations_.empty() && titles_.empty() && roles_.empty() && urls_.empty();
+ return empty;
+ }
+
private:
std::string version_;
std::string fullName_;