diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index 66bc100e1..33e6ed9f3 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -28,6 +28,8 @@ #include "rsiface/rsmsgs.h" #include "rsiface/rspeers.h" +#include "gui/msgs/ChanMsgDialog.h" + #include /**** @@ -246,8 +248,29 @@ void MsgItem::replyMsg() #endif if (mParent) { - mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, mMsgId); - } + //mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, mMsgId); + + MessageInfo msgInfo; + if (!rsMsgs -> getMessage(mMsgId, msgInfo)) + return ; + + ChanMsgDialog *nMsgDialog = new ChanMsgDialog(true); + nMsgDialog->newMsg(); + nMsgDialog->insertTitleText( (QString("Re: ") + QString::fromStdWString(msgInfo.title)).toStdString()) ; + nMsgDialog->setWindowTitle(tr("Re: ") + QString::fromStdWString(msgInfo.title) ) ; + + QTextDocument doc ; + doc.setHtml(QString::fromStdWString(msgInfo.msg)) ; + std::string cited_text(doc.toPlainText().toStdString()) ; + + nMsgDialog->insertPastedText(cited_text) ; + nMsgDialog->addRecipient( msgInfo.srcId ) ; + nMsgDialog->show(); + nMsgDialog->activateWindow(); + + /* window will destroy itself! */ + + } } diff --git a/retroshare-gui/src/gui/feeds/PeerItem.cpp b/retroshare-gui/src/gui/feeds/PeerItem.cpp index bb958b694..0707b5289 100644 --- a/retroshare-gui/src/gui/feeds/PeerItem.cpp +++ b/retroshare-gui/src/gui/feeds/PeerItem.cpp @@ -24,8 +24,11 @@ #include "FeedHolder.h" #include "../RsAutoUpdatePage.h" +#include "rsiface/rsmsgs.h" #include "rsiface/rspeers.h" +#include "gui/msgs/ChanMsgDialog.h" + #include #include #include @@ -282,7 +285,16 @@ void PeerItem::sendMsg() if (mParent) { - mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, ""); + //mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, ""); + + ChanMsgDialog *nMsgDialog = new ChanMsgDialog(true); + nMsgDialog->newMsg(); + + nMsgDialog->addRecipient( mPeerId ) ; + nMsgDialog->show(); + nMsgDialog->activateWindow(); + + /* window will destroy itself! */ } }