summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/Controllers/HistoryController.cpp11
-rw-r--r--Swift/Controllers/HistoryController.h13
-rw-r--r--Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp17
-rw-r--r--Swift/QtUI/QtPlainChatView.cpp2
4 files changed, 27 insertions, 16 deletions
diff --git a/Swift/Controllers/HistoryController.cpp b/Swift/Controllers/HistoryController.cpp
index cce139b..f439429 100644
--- a/Swift/Controllers/HistoryController.cpp
+++ b/Swift/Controllers/HistoryController.cpp
@@ -1,30 +1,33 @@
/*
* Copyright (c) 2012 Catalin Badea
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
/*
- * Copyright (c) 2014 Isode Limited.
+ * Copyright (c) 2014-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swift/Controllers/HistoryController.h>
-#include <Swiften/History/HistoryStorage.h>
-#include <Swiften/History/HistoryMessage.h>
+
#include <boost/date_time/c_local_time_adjustor.hpp>
+#include <Swiften/History/HistoryMessage.h>
+#include <Swiften/History/HistoryStorage.h>
+#include <Swiften/JID/JID.h>
+
namespace Swift {
-HistoryController::HistoryController(HistoryStorage* localHistoryStorage) : localHistory_(localHistoryStorage), remoteArchiveSupported_(false) {
+HistoryController::HistoryController(HistoryStorage* localHistoryStorage) : localHistory_(localHistoryStorage) {
}
HistoryController::~HistoryController() {
}
void HistoryController::addMessage(const std::string& message, const JID& fromJID, const JID& toJID, HistoryMessage::Type type, const boost::posix_time::ptime& timeStamp) {
// note: using localtime timestamps
boost::posix_time::ptime localTime = boost::date_time::c_local_adjustor<boost::posix_time::ptime>::utc_to_local(timeStamp);
int offset = (localTime - timeStamp).hours();
diff --git a/Swift/Controllers/HistoryController.h b/Swift/Controllers/HistoryController.h
index 8c86409..0bdbb35 100644
--- a/Swift/Controllers/HistoryController.h
+++ b/Swift/Controllers/HistoryController.h
@@ -1,21 +1,27 @@
/*
* Copyright (c) 2012 Catalin Badea
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <Swiften/JID/JID.h>
-#include <boost/date_time/posix_time/posix_time.hpp>
#include <vector>
-#include <set>
+
+#include <boost/date_time/posix_time/posix_time.hpp>
+
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/History/HistoryMessage.h>
#include <Swiften/History/HistoryStorage.h>
namespace Swift {
class JID;
class HistoryController {
public:
@@ -29,12 +35,11 @@ namespace Swift {
ContactsMap getContacts(const JID& selfJID, HistoryMessage::Type type, const std::string& keyword = std::string()) const;
std::vector<HistoryMessage> getMUCContext(const JID& selfJID, const JID& mucJID, const boost::posix_time::ptime& timeStamp) const;
boost::posix_time::ptime getLastTimeStampFromMUC(const JID& selfJID, const JID& mucJID);
boost::signal<void (const HistoryMessage&)> onNewMessage;
private:
HistoryStorage* localHistory_;
- bool remoteArchiveSupported_;
};
}
diff --git a/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp b/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp
index 4a28bbd..ac2a603 100644
--- a/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp
+++ b/Swift/QtUI/QtAdHocCommandWithJIDWindow.cpp
@@ -1,29 +1,32 @@
/*
- * Copyright (c) 2010-2014 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
+#include <Swift/QtUI/QtAdHocCommandWithJIDWindow.h>
+
#include <boost/bind.hpp>
-#include <QLabel>
-#include <QPushButton>
+
#include <QBoxLayout>
#include <QDialogButtonBox>
+#include <QLabel>
+#include <QPushButton>
+
#include <Swiften/Elements/Command.h>
-#include <Swift/Controllers/UIEvents/UIEventStream.h>
+
#include <Swift/Controllers/UIEvents/RequestAdHocWithJIDUIEvent.h>
-#include <Swift/QtUI/QtAdHocCommandWithJIDWindow.h>
+#include <Swift/Controllers/UIEvents/UIEventStream.h>
+
#include <Swift/QtUI/QtFormWidget.h>
#include <Swift/QtUI/QtSwiftUtil.h>
-const int FormLayoutIndex = 1;
-
namespace Swift {
QtAdHocCommandWithJIDWindow::QtAdHocCommandWithJIDWindow(UIEventStream* uiEventStream) : uiEventStream_(uiEventStream) {
QVBoxLayout* hlayout = new QVBoxLayout(this);
QLabel* jidLabel = new QLabel("JID:", this);
hlayout->addWidget(jidLabel);
jid_ = new QLineEdit(this);
hlayout->addWidget(jid_);
diff --git a/Swift/QtUI/QtPlainChatView.cpp b/Swift/QtUI/QtPlainChatView.cpp
index eabf35f..e062efc 100644
--- a/Swift/QtUI/QtPlainChatView.cpp
+++ b/Swift/QtUI/QtPlainChatView.cpp
@@ -157,19 +157,19 @@ void QtPlainChatView::replaceWithAction(const ChatWindow::ChatMessage& message,
void QtPlainChatView::replaceLastMessage(const ChatWindow::ChatMessage& message, const ChatWindow::TimestampBehaviour /*timestampBehaviour*/)
{
QString text = "<p>The last message was corrected to:<br/>";
text += chatMessageToString(message);
text += "</p>";
log_->append(text);
}
-void QtPlainChatView::replaceSystemMessage(const ChatWindow::ChatMessage& message, const std::string& id, const ChatWindow::TimestampBehaviour timestampBehaviour) {
+void QtPlainChatView::replaceSystemMessage(const ChatWindow::ChatMessage& message, const std::string& /*id*/, const ChatWindow::TimestampBehaviour /*timestampBehaviour*/) {
QString text = "<p><i>";
text += chatMessageToString(message);
text += "</i></p>";
log_->append(text);
}
void QtPlainChatView::setAckState(const std::string& /*id*/, ChatWindow::AckState state)
{
if (state == ChatWindow::Failed) {