summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2018-04-17 16:35:00 (GMT)
committerKevin Smith <git@kismith.co.uk>2018-04-27 13:12:23 (GMT)
commit1b66a33c5fdacca2200e367c647b9a40768c569b (patch)
tree1b6f470b6a06460b640c79065358118b7b944908 /Swift/Controllers/Chat/ChatsManager.h
parent8fe63ff4b47cfa3b1e988f348b34ac7d36ce7b9b (diff)
downloadswift-1b66a33c5fdacca2200e367c647b9a40768c569b.zip
swift-1b66a33c5fdacca2200e367c647b9a40768c569b.tar.bz2
Add a new merged roster/chats/MUCs view
This is hidden behind the FUTURE flag, and is not ready for release yet, but is pretty usable. The three top filters (all/people/rooms) aren't plumbed in yet, recents need to be reinstated, and a favourites system would be very desirable. The code for the existing roster/chatlist is largely unchanged and with FUTURE disabled behaviour should not have changed. Lots of this code has now been put inside #ifndef NOT_YET blocks, to make it easy to find and remove later. When making this default later, all instances of NOT_YET should be inspected, unit tests should be added, and use of RECENT should be inspected - those related to this patch should be removed. Not all code is behind NOT_YET, so references to the old recents and chat lists will need to be manually checked and removed. Test-Information: Existing unit tests pass. New unit tests have not been added yet, and need to be before it's removed from FUTURE guards. Firing up Swift with future enabled shows the new view, and disabled doesn't. In both cases clicking around various things in the rosters opens the expected chats. Change-Id: I0e1ce98e4c644fa5b09ef65986cc826b6b564a7b
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.h')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.h72
1 files changed, 45 insertions, 27 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.h b/Swift/Controllers/Chat/ChatsManager.h
index 6004347..0b85840 100644
--- a/Swift/Controllers/Chat/ChatsManager.h
+++ b/Swift/Controllers/Chat/ChatsManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2016 Isode Limited.
+ * Copyright (c) 2010-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -27,49 +27,52 @@
#include <Swift/Controllers/UIInterfaces/ChatWindowFactory.h>
namespace Swift {
- class EventController;
+ class AutoAcceptMUCInviteDecider;
+ class AvatarManager;
class ChatController;
class ChatControllerBase;
- class MUCController;
- class MUCManager;
+ class ChatListWindowFactory;
+ class ChatMessageParser;
+ class Chattables;
+ class ClientBlockListManager;
+ class DirectedPresenceSender;
+ class DiscoServiceWalker;
+ class EntityCapsProvider;
+ class EventController;
+ class FileTransferController;
+ class FileTransferOverview;
+ class HighlightManager;
+ class HistoryController;
+ class IQRouter;
class JoinMUCWindow;
class JoinMUCWindowFactory;
+ class MUCBookmarkManager;
+ class MUCController;
+ class MUCManager;
+ class MUCSearchController;
+ class MUCSearchWindowFactory;
class NickResolver;
class PresenceOracle;
- class AvatarManager;
- class StanzaChannel;
- class IQRouter;
class PresenceSender;
- class MUCBookmarkManager;
- class ChatListWindowFactory;
- class TimerFactory;
- class EntityCapsProvider;
- class DirectedPresenceSender;
- class MUCSearchWindowFactory;
class ProfileSettingsProvider;
- class MUCSearchController;
- class FileTransferOverview;
- class FileTransferController;
- class XMPPRoster;
class SettingsProvider;
- class WhiteboardManager;
- class HistoryController;
- class HighlightManager;
- class ClientBlockListManager;
- class ChatMessageParser;
- class DiscoServiceWalker;
- class AutoAcceptMUCInviteDecider;
+ class StanzaChannel;
+ class TimerFactory;
class VCardManager;
+ class WhiteboardManager;
+ class XMPPRoster;
class ChatsManager : public ContactProvider {
public:
- ChatsManager(JID jid, StanzaChannel* stanzaChannel, IQRouter* iqRouter, EventController* eventController, ChatWindowFactory* chatWindowFactory, JoinMUCWindowFactory* joinMUCWindowFactory, NickResolver* nickResolver, PresenceOracle* presenceOracle, PresenceSender* presenceSender, UIEventStream* uiEventStream, ChatListWindowFactory* chatListWindowFactory, bool useDelayForLatency, TimerFactory* timerFactory, MUCRegistry* mucRegistry, EntityCapsProvider* entityCapsProvider, MUCManager* mucManager, MUCSearchWindowFactory* mucSearchWindowFactory, ProfileSettingsProvider* profileSettings, FileTransferOverview* ftOverview, XMPPRoster* roster, bool eagleMode, SettingsProvider* settings, HistoryController* historyController_, WhiteboardManager* whiteboardManager, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, const std::map<std::string, std::string>& emoticons, VCardManager* vcardManager);
+ ChatsManager(JID jid, StanzaChannel* stanzaChannel, IQRouter* iqRouter, EventController* eventController, ChatWindowFactory* chatWindowFactory, JoinMUCWindowFactory* joinMUCWindowFactory, NickResolver* nickResolver, PresenceOracle* presenceOracle, PresenceSender* presenceSender, UIEventStream* uiEventStream, ChatListWindowFactory* chatListWindowFactory, bool useDelayForLatency, TimerFactory* timerFactory, MUCRegistry* mucRegistry, EntityCapsProvider* entityCapsProvider, MUCManager* mucManager, MUCSearchWindowFactory* mucSearchWindowFactory, ProfileSettingsProvider* profileSettings, FileTransferOverview* ftOverview, XMPPRoster* roster, bool eagleMode, SettingsProvider* settings, HistoryController* historyController_, WhiteboardManager* whiteboardManager, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, const std::map<std::string, std::string>& emoticons, VCardManager* vcardManager, Chattables& chattables);
virtual ~ChatsManager();
void setAvatarManager(AvatarManager* avatarManager);
void setOnline(bool enabled);
void setServerDiscoInfo(std::shared_ptr<DiscoInfo> info);
void handleIncomingMessage(std::shared_ptr<Message> incomingMessage);
+#ifndef NOT_YET
std::vector<ChatListWindow::Chat> getRecentChats() const;
+#endif
virtual std::vector<Contact::ref> getContacts(bool withMUCNicks);
boost::signals2::signal<void (bool supportsImpromptu)> onImpromptuMUCServiceDiscovered;
@@ -86,7 +89,9 @@ namespace Swift {
};
private:
+#ifndef NOT_YET
ChatListWindow::Chat createChatListChatItem(const JID& jid, const std::string& activity, bool privateMessage);
+#endif
void handleChatRequest(const std::string& contact);
void finalizeImpromptuJoin(MUC::ref muc, const std::vector<JID>& jidsToInvite, const std::string& reason, const boost::optional<JID>& reuseChatJID = boost::optional<JID>());
MUC::ref handleJoinMUCRequest(const JID& muc, const boost::optional<std::string>& password, const boost::optional<std::string>& nick, bool addAutoJoin, bool createAsReservedIfNew, bool isImpromptu, ChatWindow* reuseChatwindow = nullptr);
@@ -105,18 +110,25 @@ namespace Swift {
void handleNewFileTransferController(FileTransferController*);
void handleWhiteboardSessionRequest(const JID& contact, bool senderIsSelf);
void handleWhiteboardStateChange(const JID& contact, const ChatWindow::WhiteboardSessionState state);
+#ifndef NOT_YET
boost::optional<ChatListWindow::Chat> removeExistingChat(const ChatListWindow::Chat& chat);
+#endif
bool messageCausesSessionBinding(std::shared_ptr<Message> message);
void cleanupPrivateMessageRecents();
+#ifndef NOT_YET
void appendRecent(const ChatListWindow::Chat& chat);
void prependRecent(const ChatListWindow::Chat& chat);
+#endif
void setupBookmarks();
+#ifndef NOT_YET
void loadRecents();
void saveRecents();
void handleChatMadeRecent();
void handleMUCBookmarkActivated(const MUCBookmark&);
void handleRecentActivated(const ChatListWindow::Chat&);
void handleUnreadCountChanged(ChatControllerBase* controller);
+#endif
+ void handleChattableActivated(const JID& jid);
void handleAvatarChanged(const JID& jid);
void handleClearRecentsRequested();
void handleJIDAddedToRoster(const JID&);
@@ -126,12 +138,13 @@ namespace Swift {
void handleSettingChanged(const std::string& settingPath);
void markAllRecentsOffline();
void handleTransformChatToMUC(ChatController* chatController, ChatWindow* chatWindow, const std::vector<JID>& jidsToInvite, const std::string& reason);
-
void handleLocalServiceFound(const JID& service, std::shared_ptr<DiscoInfo> info);
void handleLocalServiceWalkFinished();
-
void updatePresenceReceivingStateOnChatController(const JID&);
+#ifndef NOT_YET
ChatListWindow::Chat updateChatStatusAndAvatarHelper(const ChatListWindow::Chat& chat) const;
+#endif
+
ChatController* getChatControllerOrFindAnother(const JID &contact);
@@ -156,7 +169,9 @@ namespace Swift {
UIEventStream* uiEventStream_;
MUCBookmarkManager* mucBookmarkManager_;
std::shared_ptr<DiscoInfo> serverDiscoInfo_;
+#ifndef NOT_YET
ChatListWindow* chatListWindow_;
+#endif
JoinMUCWindow* joinMUCWindow_;
boost::signals2::scoped_connection uiEventConnection_;
bool useDelayForLatency_;
@@ -165,7 +180,9 @@ namespace Swift {
EntityCapsProvider* entityCapsProvider_;
MUCManager* mucManager;
MUCSearchController* mucSearchController_;
+#ifndef NOT_YET
std::list<ChatListWindow::Chat> recentChats_;
+#endif
ProfileSettingsProvider* profileSettings_;
FileTransferOverview* ftOverview_;
XMPPRoster* roster_;
@@ -182,6 +199,7 @@ namespace Swift {
AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider_;
IDGenerator idGenerator_;
VCardManager* vcardManager_;
+ Chattables& chattables_;
std::map<JID, std::set<JID>> invitees_;
};