summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2013-04-30 20:10:12 (GMT)
committerSwift Review <review@swift.im>2013-10-01 14:48:44 (GMT)
commitfd47dd7d5cec5155b9985959d2f0e0f3b386cd98 (patch)
treed4da57ce3f1c90f56701cab8757d75e089473c9e /Swift/Controllers/UIInterfaces/ChatListWindow.h
parenta3781c5b770c03ff32c5cf8f1280b21c2a8e2626 (diff)
downloadswift-fd47dd7d5cec5155b9985959d2f0e0f3b386cd98.zip
swift-fd47dd7d5cec5155b9985959d2f0e0f3b386cd98.tar.bz2
Adding support for impromptu MUCs.
Change-Id: I363e9d740bbec311454827645f4ea6df8bb60bed License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/Controllers/UIInterfaces/ChatListWindow.h')
-rw-r--r--Swift/Controllers/UIInterfaces/ChatListWindow.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/Swift/Controllers/UIInterfaces/ChatListWindow.h b/Swift/Controllers/UIInterfaces/ChatListWindow.h
index 6eb932f..b189e72 100644
--- a/Swift/Controllers/UIInterfaces/ChatListWindow.h
+++ b/Swift/Controllers/UIInterfaces/ChatListWindow.h
@@ -7,11 +7,13 @@
#pragma once
#include <list>
+#include <set>
+#include <map>
#include <boost/shared_ptr.hpp>
#include <Swiften/MUC/MUCBookmark.h>
#include <Swiften/Elements/StatusShow.h>
#include <boost/filesystem/path.hpp>
-
+#include <Swiften/Base/foreach.h>
#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
@@ -19,6 +21,7 @@ namespace Swift {
public:
class Chat {
public:
+ Chat() : statusType(StatusShow::None), isMUC(false), unreadCount(0) {}
Chat(const JID& jid, const std::string& chatName, const std::string& activity, int unreadCount, StatusShow::Type statusType, const boost::filesystem::path& avatarPath, bool isMUC, const std::string& nick = "")
: jid(jid), chatName(chatName), activity(activity), statusType(statusType), isMUC(isMUC), nick(nick), unreadCount(unreadCount), avatarPath(avatarPath) {}
/** Assume that nicks and other transient features aren't important for equality */
@@ -35,6 +38,18 @@ namespace Swift {
void setAvatarPath(const boost::filesystem::path& path) {
avatarPath = path;
}
+ std::string getImpromptuTitle() const {
+ typedef std::pair<std::string, JID> StringJIDPair;
+ std::string title;
+ foreach(StringJIDPair pair, impromptuJIDs) {
+ if (title.empty()) {
+ title += pair.first;
+ } else {
+ title += ", " + pair.first;
+ }
+ }
+ return title;
+ }
JID jid;
std::string chatName;
std::string activity;
@@ -43,6 +58,7 @@ namespace Swift {
std::string nick;
int unreadCount;
boost::filesystem::path avatarPath;
+ std::map<std::string, JID> impromptuJIDs;
};
virtual ~ChatListWindow();