2008-06-20 08:43:23 -04:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Robert Fernie
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
2010-07-23 14:52:58 -04:00
|
|
|
|
|
|
|
#include <QDateTime>
|
2011-01-27 03:34:23 -05:00
|
|
|
#include <QMessageBox>
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
#include "ForumMsgItem.h"
|
|
|
|
#include "FeedHolder.h"
|
2011-05-03 19:04:42 -04:00
|
|
|
#include "gui/RetroShareLink.h"
|
2008-06-20 08:43:23 -04:00
|
|
|
|
2010-08-06 05:40:23 -04:00
|
|
|
#include <retroshare/rsforums.h>
|
2011-01-26 04:34:48 -05:00
|
|
|
#include <retroshare/rsmsgs.h>
|
|
|
|
#include <retroshare/rspeers.h>
|
|
|
|
|
2010-02-08 15:43:23 -05:00
|
|
|
#include "gui/forums/CreateForumMsg.h"
|
2011-01-13 17:19:20 -05:00
|
|
|
#include "gui/chat/HandleRichText.h"
|
2011-09-02 06:22:44 -04:00
|
|
|
#include "gui/common/AvatarDefs.h"
|
2012-02-11 19:58:47 -05:00
|
|
|
#include "gui/notifyqt.h"
|
2012-02-13 15:40:36 -05:00
|
|
|
#include "gui/ForumsDialog.h"
|
2012-02-05 09:56:27 -05:00
|
|
|
//#include "gui/settings/rsharesettings.h"
|
2011-01-26 04:34:48 -05:00
|
|
|
|
2008-07-09 05:53:47 -04:00
|
|
|
/****
|
|
|
|
* #define DEBUG_ITEM 1
|
|
|
|
****/
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
/** Constructor */
|
2011-01-26 16:36:13 -05:00
|
|
|
ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, const std::string &forumId, const std::string &postId, bool isHome)
|
|
|
|
:QWidget(NULL), mParent(parent), mFeedId(feedId), mForumId(forumId), mPostId(postId), mIsHome(isHome), mIsTop(false)
|
2008-06-20 08:43:23 -04:00
|
|
|
{
|
2012-02-05 09:56:27 -05:00
|
|
|
/* Invoke the Qt Designer generated object setup routine */
|
|
|
|
setupUi(this);
|
2008-06-20 08:43:23 -04:00
|
|
|
|
2012-02-05 09:56:27 -05:00
|
|
|
setAttribute ( Qt::WA_DeleteOnClose, true );
|
2010-05-04 20:05:36 -04:00
|
|
|
|
2012-02-05 09:56:27 -05:00
|
|
|
/* general ones */
|
|
|
|
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
|
|
|
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
|
2008-06-20 08:43:23 -04:00
|
|
|
|
2012-02-05 09:56:27 -05:00
|
|
|
/* specific ones */
|
|
|
|
connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeForum ( void ) ) );
|
|
|
|
connect( replyButton, SIGNAL( clicked( void ) ), this, SLOT( replyToPost ( void ) ) );
|
|
|
|
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );
|
2011-05-08 14:43:08 -04:00
|
|
|
|
2012-02-11 19:58:47 -05:00
|
|
|
connect(NotifyQt::getInstance(), SIGNAL(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int)), Qt::QueuedConnection);
|
|
|
|
|
2012-02-05 09:56:27 -05:00
|
|
|
subjectLabel->setMinimumWidth(20);
|
2008-06-20 08:43:23 -04:00
|
|
|
|
2012-02-05 09:56:27 -05:00
|
|
|
small();
|
|
|
|
updateItemStatic();
|
|
|
|
updateItem();
|
|
|
|
textEdit->hide();
|
|
|
|
sendButton->hide();
|
|
|
|
signedcheckBox->hide();
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void ForumMsgItem::updateItemStatic()
|
|
|
|
{
|
|
|
|
if (!rsForums)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* fill in */
|
|
|
|
#ifdef DEBUG_ITEM
|
|
|
|
std::cerr << "ForumMsgItem::updateItemStatic()";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
#endif
|
|
|
|
|
2011-01-27 19:51:56 -05:00
|
|
|
canReply = false;
|
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
ForumInfo fi;
|
|
|
|
if (rsForums->getForumInfo(mForumId, fi))
|
|
|
|
{
|
2011-05-04 06:22:49 -04:00
|
|
|
RetroShareLink link;
|
2011-05-08 19:11:27 -04:00
|
|
|
link.createForum(fi.forumId, "");
|
2011-01-27 19:51:56 -05:00
|
|
|
QString title = tr("Forum Post") + ": ";
|
2011-05-03 19:04:42 -04:00
|
|
|
title += link.toHtml();
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
titleLabel->setText(title);
|
2011-01-27 19:51:56 -05:00
|
|
|
if (fi.subscribeFlags & (RS_DISTRIB_ADMIN | RS_DISTRIB_SUBSCRIBED))
|
2008-06-20 08:43:23 -04:00
|
|
|
{
|
2011-01-27 19:51:56 -05:00
|
|
|
unsubscribeButton->setEnabled(true);
|
2010-02-08 15:43:23 -05:00
|
|
|
replyButton->setEnabled(true);
|
2011-01-27 19:51:56 -05:00
|
|
|
|
|
|
|
if (fi.forumFlags & RS_DISTRIB_AUTHEN_REQ)
|
|
|
|
{
|
|
|
|
signedcheckBox->setChecked(true);
|
|
|
|
signedcheckBox->setEnabled(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
canReply = true;
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-27 19:51:56 -05:00
|
|
|
unsubscribeButton->setEnabled(false);
|
|
|
|
replyButton->setEnabled(false);
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-13 17:19:20 -05:00
|
|
|
titleLabel->setText(tr("Unknown Forum Post"));
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* get actual Message */
|
|
|
|
ForumMsgInfo msg;
|
|
|
|
if (rsForums->getForumMessage(mForumId, mPostId, msg))
|
|
|
|
{
|
|
|
|
#ifdef DEBUG_ITEM
|
|
|
|
std::cerr << "Ids: MsgId: " << msg.msgId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
std::cerr << "Ids: ParentId: " << msg.parentId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
std::cerr << "Ids: ThreadId: " << msg.threadId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* decide if top or not */
|
|
|
|
if ((msg.msgId == msg.threadId) || (msg.threadId == ""))
|
|
|
|
{
|
|
|
|
mIsTop = true;
|
|
|
|
}
|
2011-01-26 04:34:48 -05:00
|
|
|
|
2011-05-04 06:22:49 -04:00
|
|
|
RetroShareLink link;
|
2011-05-08 19:11:27 -04:00
|
|
|
link.createForum(msg.forumId, msg.msgId);
|
2011-05-03 19:04:42 -04:00
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
if (mIsTop)
|
2011-09-05 17:19:07 -04:00
|
|
|
{
|
|
|
|
avatar->setId(msg.srcId, true);
|
2011-01-26 16:36:13 -05:00
|
|
|
|
|
|
|
if (rsPeers->getPeerName(msg.srcId) !="")
|
|
|
|
{
|
2011-05-08 14:43:08 -04:00
|
|
|
RetroShareLink linkMessage;
|
|
|
|
linkMessage.createMessage(msg.srcId, "");
|
|
|
|
namelabel->setText(linkMessage.toHtml());
|
2011-01-26 16:36:13 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
namelabel->setText(tr("Anonymous"));
|
|
|
|
}
|
|
|
|
|
2011-05-03 19:04:42 -04:00
|
|
|
prevSubLabel->setText(link.toHtml());
|
2012-02-13 15:40:36 -05:00
|
|
|
prevMsgLabel->setText(RsHtml::formatText(ForumsDialog::messageFromInfo(msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
|
|
|
|
2012-02-05 09:56:27 -05:00
|
|
|
QDateTime qtime;
|
|
|
|
qtime.setTime_t(msg.ts);
|
|
|
|
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
|
|
|
timestamplabel->setText(timestamp);
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
nextFrame->hide();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-05 17:19:07 -04:00
|
|
|
nextavatar->setId(msg.srcId, true);
|
2011-01-26 16:36:13 -05:00
|
|
|
|
|
|
|
if (rsPeers->getPeerName(msg.srcId) !="")
|
|
|
|
{
|
2011-05-08 14:43:08 -04:00
|
|
|
RetroShareLink linkMessage;
|
|
|
|
linkMessage.createMessage(msg.srcId, "");
|
|
|
|
nextnamelabel->setText(linkMessage.toHtml());
|
2011-01-26 16:36:13 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nextnamelabel->setText(tr("Anonymous"));
|
|
|
|
}
|
|
|
|
|
2011-05-03 19:04:42 -04:00
|
|
|
nextSubLabel->setText(link.toHtml());
|
2012-02-13 15:40:36 -05:00
|
|
|
nextMsgLabel->setText(RsHtml::formatText(ForumsDialog::messageFromInfo(msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
2008-06-20 08:43:23 -04:00
|
|
|
|
2010-03-10 17:41:10 -05:00
|
|
|
QDateTime qtime;
|
2012-02-05 09:56:27 -05:00
|
|
|
qtime.setTime_t(msg.ts);
|
|
|
|
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
|
|
|
timestamplabel->setText(timestamp);
|
2010-03-10 17:41:10 -05:00
|
|
|
|
2010-10-23 10:08:20 -04:00
|
|
|
prevSHLabel->setText(tr("In Reply to") + ": ");
|
2008-06-20 08:43:23 -04:00
|
|
|
|
|
|
|
ForumMsgInfo msgParent;
|
|
|
|
if (rsForums->getForumMessage(mForumId, msg.parentId, msgParent))
|
|
|
|
{
|
2011-09-05 17:19:07 -04:00
|
|
|
avatar->setId(msgParent.srcId, true);
|
2011-01-26 16:36:13 -05:00
|
|
|
|
2011-05-04 06:22:49 -04:00
|
|
|
RetroShareLink linkParent;
|
2011-05-08 19:11:27 -04:00
|
|
|
linkParent.createForum(msgParent.forumId, msgParent.msgId);
|
2011-05-03 19:04:42 -04:00
|
|
|
prevSubLabel->setText(linkParent.toHtml());
|
2012-02-13 15:40:36 -05:00
|
|
|
prevMsgLabel->setText(RsHtml::formatText(ForumsDialog::messageFromInfo(msgParent), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
2011-01-26 04:34:48 -05:00
|
|
|
|
|
|
|
if (rsPeers->getPeerName(msgParent.srcId) !="")
|
|
|
|
{
|
2011-05-08 14:43:08 -04:00
|
|
|
RetroShareLink linkMessage;
|
|
|
|
linkMessage.createMessage(msgParent.srcId, "");
|
|
|
|
namelabel->setText(linkMessage.toHtml());
|
2011-01-26 04:34:48 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-26 16:36:13 -05:00
|
|
|
namelabel->setText(tr("Anonymous"));
|
2011-01-26 04:34:48 -05:00
|
|
|
}
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
prevSubLabel->setText("???");
|
|
|
|
prevMsgLabel->setText("???");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* header stuff */
|
2012-04-09 11:01:25 -04:00
|
|
|
subjectLabel->setText(link.toHtml());
|
2011-05-08 13:14:51 -04:00
|
|
|
//srcLabel->setText(QString::fromStdString(msg.srcId));
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (mIsHome)
|
|
|
|
{
|
|
|
|
/* disable buttons */
|
|
|
|
clearButton->setEnabled(false);
|
2008-07-04 10:41:24 -04:00
|
|
|
//gotoButton->setEnabled(false);
|
|
|
|
|
|
|
|
clearButton->hide();
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
unsubscribeButton->hide();
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void ForumMsgItem::updateItem()
|
|
|
|
{
|
|
|
|
/* fill in */
|
|
|
|
#ifdef DEBUG_ITEM
|
|
|
|
std::cerr << "ForumMsgItem::updateItem()";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void ForumMsgItem::small()
|
|
|
|
{
|
|
|
|
nextFrame->hide();
|
|
|
|
prevFrame->hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ForumMsgItem::toggle()
|
|
|
|
{
|
|
|
|
if (prevFrame->isHidden())
|
|
|
|
{
|
|
|
|
prevFrame->show();
|
2011-01-27 19:51:56 -05:00
|
|
|
textEdit->setVisible(canReply);
|
|
|
|
sendButton->setVisible(canReply);
|
|
|
|
signedcheckBox->setVisible(canReply);
|
2008-08-17 10:13:09 -04:00
|
|
|
expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
2012-02-05 09:56:27 -05:00
|
|
|
expandButton->setToolTip("Hide");
|
2008-06-20 08:43:23 -04:00
|
|
|
if (!mIsTop)
|
|
|
|
{
|
|
|
|
nextFrame->show();
|
|
|
|
}
|
2012-02-05 09:56:27 -05:00
|
|
|
|
|
|
|
uint32_t status;
|
|
|
|
rsForums->getMessageStatus(mForumId, mPostId, status);
|
|
|
|
|
|
|
|
if (canReply) {
|
|
|
|
/* set always to read ... */
|
|
|
|
uint32_t statusNew = status | FORUM_MSG_STATUS_READ;
|
|
|
|
|
|
|
|
// bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate();
|
|
|
|
// if (setToReadOnActive) {
|
|
|
|
/* ... and to read by user */
|
|
|
|
statusNew &= ~FORUM_MSG_STATUS_UNREAD_BY_USER;
|
|
|
|
// } else {
|
|
|
|
// /* ... and to unread by user */
|
|
|
|
// statusNew |= FORUM_MSG_STATUS_UNREAD_BY_USER;
|
|
|
|
// }
|
|
|
|
|
|
|
|
if (status != statusNew) {
|
2012-02-11 19:58:47 -05:00
|
|
|
disconnect(NotifyQt::getInstance(), SIGNAL(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int)));
|
2012-02-05 09:56:27 -05:00
|
|
|
rsForums->setMessageStatus(mForumId, mPostId, statusNew, FORUM_MSG_STATUS_READ | FORUM_MSG_STATUS_UNREAD_BY_USER);
|
2012-02-11 19:58:47 -05:00
|
|
|
connect(NotifyQt::getInstance(), SIGNAL(forumMsgReadSatusChanged(QString,QString,int)), this, SLOT(forumMsgReadSatusChanged(QString,QString,int)), Qt::QueuedConnection);
|
2012-02-05 09:56:27 -05:00
|
|
|
}
|
|
|
|
}
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
prevFrame->hide();
|
|
|
|
nextFrame->hide();
|
2011-01-27 03:34:23 -05:00
|
|
|
textEdit->hide();
|
|
|
|
sendButton->hide();
|
|
|
|
signedcheckBox->hide();
|
2008-08-17 10:13:09 -04:00
|
|
|
expandButton->setIcon(QIcon(QString(":/images/edit_add24.png")));
|
2012-02-05 09:56:27 -05:00
|
|
|
expandButton->setToolTip("Expand");
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ForumMsgItem::removeItem()
|
|
|
|
{
|
|
|
|
#ifdef DEBUG_ITEM
|
|
|
|
std::cerr << "ForumMsgItem::removeItem()";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
#endif
|
|
|
|
hide();
|
|
|
|
if (mParent)
|
|
|
|
{
|
|
|
|
mParent->deleteFeedItem(this, mFeedId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********** SPECIFIC FUNCTIOSN ***********************/
|
|
|
|
|
|
|
|
void ForumMsgItem::unsubscribeForum()
|
|
|
|
{
|
|
|
|
#ifdef DEBUG_ITEM
|
|
|
|
std::cerr << "ForumMsgItem::unsubscribeForum()";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
#endif
|
|
|
|
if (rsForums)
|
|
|
|
{
|
|
|
|
rsForums->forumSubscribe(mForumId, false);
|
|
|
|
}
|
|
|
|
updateItemStatic();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ForumMsgItem::subscribeForum()
|
|
|
|
{
|
|
|
|
#ifdef DEBUG_ITEM
|
|
|
|
std::cerr << "ForumMsgItem::subscribeForum()";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
#endif
|
|
|
|
if (rsForums)
|
|
|
|
{
|
|
|
|
rsForums->forumSubscribe(mForumId, true);
|
|
|
|
}
|
|
|
|
updateItemStatic();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ForumMsgItem::replyToPost()
|
|
|
|
{
|
2011-01-27 19:51:56 -05:00
|
|
|
if (canReply == false) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
#ifdef DEBUG_ITEM
|
|
|
|
std::cerr << "ForumMsgItem::replyToPost()";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
#endif
|
|
|
|
if (mParent)
|
|
|
|
{
|
2010-05-23 19:02:15 -04:00
|
|
|
CreateForumMsg *cfm = new CreateForumMsg(mForumId, mPostId);
|
|
|
|
cfm->show();
|
2008-06-20 08:43:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-27 03:34:23 -05:00
|
|
|
void ForumMsgItem::sendMsg()
|
|
|
|
{
|
2011-01-27 19:51:56 -05:00
|
|
|
if (canReply == false) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
QString desc = textEdit->toHtml();
|
|
|
|
|
2011-01-27 03:34:23 -05:00
|
|
|
if(textEdit->toPlainText().isEmpty())
|
2011-06-20 17:19:48 -04:00
|
|
|
{ /* error message */
|
2011-01-31 17:04:28 -05:00
|
|
|
QMessageBox::warning(this, "RetroShare",tr("Please give a Text Message"),
|
2011-06-20 17:19:48 -04:00
|
|
|
QMessageBox::Ok, QMessageBox::Ok);
|
2011-01-27 03:34:23 -05:00
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
return; //Don't add a empty Message!!
|
|
|
|
}
|
2011-01-27 03:34:23 -05:00
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
ForumMsgInfo msg;
|
2011-01-27 03:34:23 -05:00
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
/* get message */
|
|
|
|
if (rsForums->getForumMessage(mForumId, mPostId, msg)) {
|
|
|
|
ForumMsgInfo msgInfo;
|
|
|
|
|
|
|
|
msgInfo.forumId = mForumId;
|
|
|
|
msgInfo.threadId = "";
|
|
|
|
msgInfo.parentId = mPostId;
|
|
|
|
msgInfo.msgId = "";
|
|
|
|
|
|
|
|
/* modify title */
|
|
|
|
QString text = QString::fromStdWString(msg.title);
|
|
|
|
if (text.startsWith("Re:", Qt::CaseInsensitive)) {
|
|
|
|
msgInfo.title = msg.title;
|
|
|
|
} else {
|
|
|
|
msgInfo.title = L"Re: " + msg.title;
|
|
|
|
}
|
2011-01-27 03:34:23 -05:00
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
msgInfo.msg = desc.toStdWString();
|
|
|
|
msgInfo.msgflags = 0;
|
2011-01-27 03:34:23 -05:00
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
if (signedcheckBox->isChecked())
|
|
|
|
{
|
|
|
|
msgInfo.msgflags = RS_DISTRIB_AUTHEN_REQ;
|
|
|
|
}
|
2011-01-27 03:34:23 -05:00
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
if ((msgInfo.msg == L"") && (msgInfo.title == L""))
|
|
|
|
return; /* do nothing */
|
2011-01-27 03:34:23 -05:00
|
|
|
|
2011-06-20 17:19:48 -04:00
|
|
|
if (rsForums->ForumMessageSend(msgInfo) == true) {
|
|
|
|
textEdit->clear();
|
|
|
|
}
|
|
|
|
}
|
2011-01-27 03:34:23 -05:00
|
|
|
}
|
2012-02-11 19:58:47 -05:00
|
|
|
|
|
|
|
void ForumMsgItem::forumMsgReadSatusChanged(const QString &forumId, const QString &msgId, int status)
|
|
|
|
{
|
|
|
|
if (mForumId == forumId.toStdString() && mPostId == msgId.toStdString()) {
|
|
|
|
if (status & FORUM_MSG_STATUS_READ) {
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|