diff options
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/MUCOccupant.cpp | 12 | ||||
-rw-r--r-- | Swiften/Elements/MUCOccupant.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/Swiften/Elements/MUCOccupant.cpp b/Swiften/Elements/MUCOccupant.cpp index edd6eb6..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,6 +20,14 @@ 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_; } diff --git a/Swiften/Elements/MUCOccupant.h b/Swiften/Elements/MUCOccupant.h index eb7df2c..c345a49 100644 --- a/Swiften/Elements/MUCOccupant.h +++ b/Swiften/Elements/MUCOccupant.h @@ -25,6 +25,8 @@ namespace Swift { MUCOccupant(const MUCOccupant& other); ~MUCOccupant(); + MUCOccupant& operator=(MUCOccupant other); + std::string getNick() const; Role getRole() const; Affiliation getAffiliation() const; |