summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BuildTools/SCons/SConscript.boot2
-rw-r--r--Swift/Controllers/Chat/ChatControllerBase.cpp2
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp7
-rw-r--r--Swift/Controllers/MainController.cpp10
-rw-r--r--Swift/Controllers/Storages/FileStorages.cpp8
-rw-r--r--Swift/QtUI/QtChatView.cpp4
-rw-r--r--Swift/QtUI/QtMainWindow.cpp2
-rw-r--r--Swiften/Client/MemoryStorages.cpp8
8 files changed, 35 insertions, 8 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index d6977fe..917935d 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -180,7 +180,7 @@ if not env["assertions"] :
env.Append(CPPDEFINES = ["NDEBUG"])
if env["experimental"] :
- env.Append(CPPDEFINES = ["SWIFT_EXPERIMENTAL_FT"])
+ env.Append(CPPDEFINES = ["SWIFT_EXPERIMENTAL_FT", "SWIFT_EXPERIMENTAL_HISTORY"])
# If we build shared libs on AMD64, we need -fPIC.
# This should have no performance impact om AMD64
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp
index 754401b..b5fe0c0 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.cpp
+++ b/Swift/Controllers/Chat/ChatControllerBase.cpp
@@ -146,7 +146,9 @@ void ChatControllerBase::handleSendMessageRequest(const std::string &body, bool
postSendMessage(message->getBody(), boost::dynamic_pointer_cast<Stanza>(message));
onActivity(message->getBody());
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
logMessage(body, selfJID_, toJID_, now, false);
+#endif
}
void ChatControllerBase::handleSecurityLabelsCatalogResponse(boost::shared_ptr<SecurityLabelsCatalog> catalog, ErrorPayload::ref error) {
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index b2ba871..fcd1f04 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -195,11 +195,14 @@ void MUCController::rejoin() {
muc_->setPassword(*password_);
}
//FIXME: check for received activity
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
if (lastActivity_ == boost::posix_time::not_a_date_time && historyController_) {
lastActivity_ = historyController_->getLastTimeStampFromMUC(selfJID_, toJID_);
}
-
muc_->joinWithContextSince(nick_, lastActivity_);
+#else
+ muc_->joinAs(nick_);
+#endif
}
}
@@ -276,7 +279,9 @@ void MUCController::handleJoinComplete(const std::string& nick) {
nick_ = nick;
chatWindow_->addSystemMessage(joinMessage);
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
addRecentLogs();
+#endif
clearPresenceQueue();
shouldJoinOnReconnect_ = true;
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 2955cee..2c02ba8 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -221,10 +221,12 @@ void MainController::resetClient() {
eventWindowController_ = NULL;
delete chatsManager_;
chatsManager_ = NULL;
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
delete historyController_;
historyController_ = NULL;
delete historyViewController_;
historyViewController_ = NULL;
+#endif
delete ftOverview_;
ftOverview_ = NULL;
delete rosterController_;
@@ -301,10 +303,14 @@ void MainController::handleConnected() {
* want to have the user's nick available and this means it will
* be before they receive stanzas that need it (e.g. bookmarks).*/
client_->getVCardManager()->requestOwnVCard();
- historyController_ = new HistoryController(storages_->getHistoryStorage());
- chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, uiFactory_, uiFactory_, client_->getNickResolver(), client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, uiFactory_, useDelayForLatency_, networkFactories_->getTimerFactory(), client_->getMUCRegistry(), client_->getEntityCapsProvider(), client_->getMUCManager(), uiFactory_, profileSettings_, ftOverview_, client_->getRoster(), !settings_->getSetting(SettingConstants::REMEMBER_RECENT_CHATS), settings_, historyController_);
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
+ historyController_ = new HistoryController(storages_->getHistoryStorage());
historyViewController_ = new HistoryViewController(jid_, uiEventStream_, historyController_, client_->getNickResolver(), client_->getAvatarManager(), client_->getPresenceOracle(), uiFactory_);
+ chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, uiFactory_, uiFactory_, client_->getNickResolver(), client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, uiFactory_, useDelayForLatency_, networkFactories_->getTimerFactory(), client_->getMUCRegistry(), client_->getEntityCapsProvider(), client_->getMUCManager(), uiFactory_, profileSettings_, ftOverview_, client_->getRoster(), !settings_->getSetting(SettingConstants::REMEMBER_RECENT_CHATS), settings_, historyController_);
+#else
+ chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, uiFactory_, uiFactory_, client_->getNickResolver(), client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, uiFactory_, useDelayForLatency_, networkFactories_->getTimerFactory(), client_->getMUCRegistry(), client_->getEntityCapsProvider(), client_->getMUCManager(), uiFactory_, profileSettings_, ftOverview_, client_->getRoster(), !settings_->getSetting(SettingConstants::REMEMBER_RECENT_CHATS), settings_, NULL);
+#endif
client_->onMessageReceived.connect(boost::bind(&ChatsManager::handleIncomingMessage, chatsManager_, _1));
chatsManager_->setAvatarManager(client_->getAvatarManager());
diff --git a/Swift/Controllers/Storages/FileStorages.cpp b/Swift/Controllers/Storages/FileStorages.cpp
index 27c245d..cff87d3 100644
--- a/Swift/Controllers/Storages/FileStorages.cpp
+++ b/Swift/Controllers/Storages/FileStorages.cpp
@@ -19,7 +19,9 @@ FileStorages::FileStorages(const boost::filesystem::path& baseDir, const JID& ji
capsStorage = new CapsFileStorage(baseDir / "caps");
avatarStorage = new AvatarFileStorage(baseDir / "avatars", baseDir / profile / "avatars");
rosterStorage = new RosterFileStorage(baseDir / profile / "roster.xml");
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
historyStorage = new SQLiteHistoryStorage((baseDir / "history.db").string());
+#endif
}
FileStorages::~FileStorages() {
@@ -27,7 +29,9 @@ FileStorages::~FileStorages() {
delete avatarStorage;
delete capsStorage;
delete vcardStorage;
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
delete historyStorage;
+#endif
}
VCardStorage* FileStorages::getVCardStorage() const {
@@ -47,7 +51,11 @@ RosterStorage* FileStorages::getRosterStorage() const {
}
HistoryStorage* FileStorages::getHistoryStorage() const {
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
return historyStorage;
+#else
+ return NULL;
+#endif
}
}
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp
index cc5119f..eaec3b6 100644
--- a/Swift/QtUI/QtChatView.cpp
+++ b/Swift/QtUI/QtChatView.cpp
@@ -66,10 +66,6 @@ QtChatView::QtChatView(QtChatTheme* theme, QWidget* parent, bool disableAutoScro
viewReady_ = false;
isAtBottom_ = true;
resetView();
-
- if (disableAutoScroll) {
- webPage_->mainFrame()->evaluateJavaScript("var disableAutoScroll = true;");
- }
}
void QtChatView::handleClearRequested() {
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index 7ec0c93..ced375f 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -123,9 +123,11 @@ QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStr
QAction* joinMUCAction = new QAction(tr("Enter &Room…"), this);
connect(joinMUCAction, SIGNAL(triggered()), SLOT(handleJoinMUCAction()));
actionsMenu->addAction(joinMUCAction);
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
QAction* viewLogsAction = new QAction(tr("&View History…"), this);
connect(viewLogsAction, SIGNAL(triggered()), SLOT(handleViewLogsAction()));
actionsMenu->addAction(viewLogsAction);
+#endif
addUserAction_ = new QAction(tr("&Add Contact…"), this);
connect(addUserAction_, SIGNAL(triggered(bool)), this, SLOT(handleAddUserActionTriggered(bool)));
actionsMenu->addAction(addUserAction_);
diff --git a/Swiften/Client/MemoryStorages.cpp b/Swiften/Client/MemoryStorages.cpp
index 9bae4e3..703e9ff 100644
--- a/Swiften/Client/MemoryStorages.cpp
+++ b/Swiften/Client/MemoryStorages.cpp
@@ -18,7 +18,9 @@ MemoryStorages::MemoryStorages() {
capsStorage = new CapsMemoryStorage();
avatarStorage = new AvatarMemoryStorage();
rosterStorage = new RosterMemoryStorage();
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
historyStorage = new SQLiteHistoryStorage(":memory:");
+#endif
}
MemoryStorages::~MemoryStorages() {
@@ -26,7 +28,9 @@ MemoryStorages::~MemoryStorages() {
delete avatarStorage;
delete capsStorage;
delete vcardStorage;
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
delete historyStorage;
+#endif
}
VCardStorage* MemoryStorages::getVCardStorage() const {
@@ -46,7 +50,11 @@ RosterStorage* MemoryStorages::getRosterStorage() const {
}
HistoryStorage* MemoryStorages::getHistoryStorage() const {
+#ifdef SWIFT_EXPERIMENTAL_HISTORY
return historyStorage;
+#else
+ return NULL;
+#endif
}