summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Elements/MUCOccupant.cpp')
-rw-r--r--Swiften/Elements/MUCOccupant.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/Swiften/Elements/MUCOccupant.cpp b/Swiften/Elements/MUCOccupant.cpp
index c2d2f3d..65fb8c2 100644
--- a/Swiften/Elements/MUCOccupant.cpp
+++ b/Swiften/Elements/MUCOccupant.cpp
@@ -1,11 +1,13 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Elements/MUCOccupant.h>
+#include <utility>
+
namespace Swift {
MUCOccupant::MUCOccupant(const std::string &nick, Role role, Affiliation affiliation) : nick_(nick), role_(role), affiliation_(affiliation) {
@@ -18,29 +20,37 @@ MUCOccupant::MUCOccupant(const MUCOccupant& other) : nick_(other.getNick()), rol
}
+MUCOccupant& MUCOccupant::operator=(MUCOccupant other) {
+ std::swap(nick_, other.nick_);
+ std::swap(role_, other.role_);
+ std::swap(affiliation_, other.affiliation_);
+ std::swap(realJID_, other.realJID_);
+ return *this;
+}
+
std::string MUCOccupant::getNick() const {
- return nick_;
+ return nick_;
}
MUCOccupant::Role MUCOccupant::getRole() const {
- return role_;
+ return role_;
}
MUCOccupant::Affiliation MUCOccupant::getAffiliation() const {
- return affiliation_;
+ return affiliation_;
}
void MUCOccupant::setRealJID(const JID& realJID) {
- realJID_ = realJID;
+ realJID_ = realJID;
}
void MUCOccupant::setNick(const std::string& nick) {
- nick_ = nick;
+ nick_ = nick;
}
boost::optional<JID> MUCOccupant::getRealJID() const {
- return realJID_;
+ return realJID_;
}
}