diff options
Diffstat (limited to 'Swift/QtUI/QtPlainChatView.cpp')
| -rw-r--r-- | Swift/QtUI/QtPlainChatView.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Swift/QtUI/QtPlainChatView.cpp b/Swift/QtUI/QtPlainChatView.cpp index 7e9c857..cdee1e6 100644 --- a/Swift/QtUI/QtPlainChatView.cpp +++ b/Swift/QtUI/QtPlainChatView.cpp @@ -1,11 +1,11 @@ /* - * Copyright (c) 2013-2017 Isode Limited. + * Copyright (c) 2013-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/QtUI/QtPlainChatView.h> #include <QDialog> #include <QFileDialog> #include <QInputDialog> @@ -36,19 +36,19 @@ QtPlainChatView::QtPlainChatView(QtChatWindow *window, UIEventStream* eventStrea log_ = new LogTextEdit(this); log_->setReadOnly(true); log_->setAccessibleName(tr("Chat Messages")); mainLayout->addWidget(log_); } QtPlainChatView::~QtPlainChatView() { } -QString chatMessageToString(const ChatWindow::ChatMessage& message) { +static QString chatMessageToString(const ChatWindow::ChatMessage& message) { QString result; for (auto&& part : message.getParts()) { std::shared_ptr<ChatWindow::ChatTextMessagePart> textPart; std::shared_ptr<ChatWindow::ChatURIMessagePart> uriPart; std::shared_ptr<ChatWindow::ChatEmoticonMessagePart> emoticonPart; std::shared_ptr<ChatWindow::ChatHighlightingMessagePart> highlightPart; if ((textPart = std::dynamic_pointer_cast<ChatWindow::ChatTextMessagePart>(part))) { QString text = QtUtilities::htmlEscape(P2QSTRING(textPart->text)); @@ -172,19 +172,19 @@ void QtPlainChatView::replaceSystemMessage(const ChatWindow::ChatMessage& messag void QtPlainChatView::setAckState(const std::string& /*id*/, ChatWindow::AckState state) { if (state == ChatWindow::Failed) { addSystemMessage(ChatWindow::ChatMessage("Message delivery failed due to disconnection from server."), ChatWindow::DefaultDirection); } } std::string QtPlainChatView::addFileTransfer(const std::string& senderName, const std::string& /*avatarPath*/, bool senderIsSelf, const std::string& filename, const boost::uintmax_t sizeInBytes, const std::string& description) { - const std::string ftId = "ft" + boost::lexical_cast<std::string>(idGenerator_++); + const std::string ftId = "ft" + std::to_string(idGenerator_++); const std::string sizeString = formatSize(sizeInBytes); FileTransfer* transfer; if (senderIsSelf) { QString description = QInputDialog::getText(this, tr("File transfer description"), tr("Description:"), QLineEdit::Normal, ""); /* NOTE: it is not possible to abort if description is not provided, since we must always return a valid transfer id */ const std::string descriptionMessage = description.isEmpty() ? "" : (" \"" + Q2PSTRING(description) + "\""); const std::string message = std::string() + "Confirm file transfer: <i>" + filename + " (" + sizeString + " bytes)</i>" + descriptionMessage; @@ -321,19 +321,19 @@ void QtPlainChatView::fileTransferFinish() fileTransfers_.erase(transferIter); } } } void QtPlainChatView::acceptMUCInvite() { AcceptMUCInviteAction *action = dynamic_cast<AcceptMUCInviteAction*>(sender()); if (action) { - eventStream_->send(std::make_shared<JoinMUCUIEvent>(action->jid_.toString(), action->password_, boost::optional<std::string>(), false, false, action->isImpromptu_, action->isContinuation_)); + eventStream_->send(std::make_shared<JoinMUCUIEvent>(action->jid_.toString(), action->password_, boost::optional<std::string>(), false, action->isImpromptu_, action->isContinuation_)); delete action->parent_; } } void QtPlainChatView::rejectMUCInvite() { AcceptMUCInviteAction *action = dynamic_cast<AcceptMUCInviteAction*>(sender()); if (action) { /* NOTE: no action required to reject an invite? */ |
Swift