summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-11-18 18:46:50 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-04-06 18:05:18 (GMT)
commite9f2f7675b11ce36b3f66250156b78fae524a351 (patch)
treea4e677475b81dca17527e8ee920b97f471ca75b8 /Swift/QtUI/QtHistoryWindow.cpp
parent3333ab69d62d1be7ae7dd7a4e56cc4bb608d3add (diff)
downloadswift-e9f2f7675b11ce36b3f66250156b78fae524a351.zip
swift-e9f2f7675b11ce36b3f66250156b78fae524a351.tar.bz2
RTL support in chat dialog.
Change-Id: Id5604c65c6090783c79a45ee7c975ed4118a51f3
Diffstat (limited to 'Swift/QtUI/QtHistoryWindow.cpp')
-rw-r--r--Swift/QtUI/QtHistoryWindow.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp
index 23621c6..6f22b76 100644
--- a/Swift/QtUI/QtHistoryWindow.cpp
+++ b/Swift/QtUI/QtHistoryWindow.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Catalin Badea
+ * Copyright (c) 2012-2013 Catalin Badea
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
@@ -13,6 +13,7 @@
#include <string>
#include <boost/shared_ptr.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
#include <QTime>
#include <QUrl>
@@ -20,6 +21,7 @@
#include <QTextDocument>
#include <QDateTime>
#include <Swift/QtUI/QtScaledAvatarCache.h>
+#include <Swift/QtUI/ChatSnippet.h>
#include <QLineEdit>
#include "QtUtilities.h"
@@ -126,14 +128,14 @@ void QtHistoryWindow::addMessage(const std::string &message, const std::string &
if (addAtTheTop) {
bool appendToPrevious = ((senderIsSelf && previousTopMessageWasSelf_) || (!senderIsSelf && !previousTopMessageWasSelf_&& previousTopSenderName_ == P2QSTRING(senderName)));
- conversation_->addMessageTop(boost::shared_ptr<ChatSnippet>(new MessageSnippet(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id))));
+ conversation_->addMessageTop(boost::shared_ptr<ChatSnippet>(new MessageSnippet(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message))));
previousTopMessageWasSelf_ = senderIsSelf;
previousTopSenderName_ = P2QSTRING(senderName);
}
else {
bool appendToPrevious = ((senderIsSelf && previousBottomMessageWasSelf_) || (!senderIsSelf && !previousBottomMessageWasSelf_&& previousBottomSenderName_ == P2QSTRING(senderName)));
- conversation_->addMessageBottom(boost::shared_ptr<ChatSnippet>(new MessageSnippet(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id))));
+ conversation_->addMessageBottom(boost::make_shared<MessageSnippet>(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(message)));
previousBottomMessageWasSelf_ = senderIsSelf;
previousBottomSenderName_ = P2QSTRING(senderName);
}