The author of this message (with ID %1) is banned.").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString())) ;
- extraTxt += tr( "- Messages from this author are not forwarded.
") ;
- extraTxt += tr( "- Messages from this author are replaced by this text.
") ;
- extraTxt += tr( "You can force the visibility and forwarding of messages by setting a different opinion for that Id in People's tab.
") ;
+ QString banned_text_info = "";
+ if(redacted) {
+ ui->downloadButton->setDisabled(true);
+ if (!mDisplayBannedText) {
+ QString extraTxt = tr( "The author of this message (with ID %1) is banned.").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString())) ;
+ extraTxt += tr( "- Messages from this author are not forwarded.
") ;
+ extraTxt += tr( "- Messages from this author are replaced by this text.
") ;
+ extraTxt += tr( "You can force the visibility and forwarding of messages by setting a different opinion for that Id in People's tab.
") ;
- ui->postText->setHtml(extraTxt) ;
- return;
- }
- else {
- RsIdentityDetails details;
- rsIdentity->getIdDetails(msg.mMeta.mAuthorId, details);
- QString name = GxsIdDetails::getName(details);
+ ui->postText->setHtml(extraTxt) ;
+ return;
+ }
+ else {
+ RsIdentityDetails details;
+ rsIdentity->getIdDetails(msg.mMeta.mAuthorId, details);
+ QString name = GxsIdDetails::getName(details);
- banned_text_info += "" + tr( "The author of this message (with ID %1) is banned. And named by name ( %2 )").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString()), name) + "";
- banned_text_info += "- " + tr( "Messages from this author are not forwarded.") + "
";
- banned_text_info += "" + tr( "You can force the visibility and forwarding of messages by setting a different opinion for that Id in People's tab.") + "
";
- }
- }
+ banned_text_info += "" + tr( "The author of this message (with ID %1) is banned. And named by name ( %2 )").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString()), name) + "";
+ banned_text_info += "- " + tr( "Messages from this author are not forwarded.") + "
";
+ banned_text_info += "" + tr( "You can force the visibility and forwarding of messages by setting a different opinion for that Id in People's tab.") + "
";
+ }
+ }
- uint32_t flags = RSHTML_FORMATTEXT_EMBED_LINKS;
- if(Settings->getForumLoadEmoticons())
- flags |= RSHTML_FORMATTEXT_EMBED_SMILEYS ;
- flags |= RSHTML_OPTIMIZEHTML_MASK;
+ uint32_t flags = RSHTML_FORMATTEXT_EMBED_LINKS;
+ if(Settings->getForumLoadEmoticons())
+ flags |= RSHTML_FORMATTEXT_EMBED_SMILEYS ;
+ flags |= RSHTML_OPTIMIZEHTML_MASK;
- QColor backgroundColor = ui->postText->palette().base().color();
- qreal desiredContrast = Settings->valueFromGroup("Forum",
- "MinimumContrast", 4.5).toDouble();
- int desiredMinimumFontSize = Settings->valueFromGroup("Forum",
- "MinimumFontSize", 10).toInt();
+ QColor backgroundColor = ui->postText->palette().base().color();
+ qreal desiredContrast = Settings->valueFromGroup("Forum",
+ "MinimumContrast", 4.5).toDouble();
+ int desiredMinimumFontSize = Settings->valueFromGroup("Forum",
+ "MinimumFontSize", 10).toInt();
- QString extraTxt = banned_text_info + RsHtml().formatText(ui->postText->document(),
- QString::fromUtf8(msg.mMsg.c_str()), flags
- , backgroundColor, desiredContrast, desiredMinimumFontSize
- );
- ui->postText->setHtml(extraTxt);
+ QString extraTxt = banned_text_info + RsHtml().formatText(ui->postText->document(),
+ QString::fromUtf8(msg.mMsg.c_str()), flags
+ , backgroundColor, desiredContrast, desiredMinimumFontSize
+ );
+ ui->postText->setHtml(extraTxt);
- QStringList urls;
- RsHtml::findAnchors(ui->postText->toHtml(), urls);
- ui->downloadButton->setEnabled(urls.count() > 0);
+ QStringList urls;
+ RsHtml::findAnchors(ui->postText->toHtml(), urls);
+ ui->downloadButton->setEnabled(urls.count() > 0);
}
void GxsForumThreadWidget::previousMessage()
{
- QModelIndex current_index = getCurrentIndex();
+ QModelIndex current_index = getCurrentIndex();
- if (!current_index.isValid())
- return;
+ if (!current_index.isValid())
+ return;
- QModelIndex parentIndex = current_index.parent();
+ QModelIndex parentIndex = current_index.parent();
- int index = current_index.row();
- int count = mThreadModel->rowCount(parentIndex) ;
+ int index = current_index.row();
+ int count = mThreadModel->rowCount(parentIndex) ;
- if (index > 0)
+ if (index > 0)
{
- QModelIndex prevItem = mThreadProxyModel->index(index - 1,0,parentIndex) ;
+ QModelIndex prevItem = mThreadProxyModel->index(index - 1,0,parentIndex) ;
- if (prevItem.isValid()) {
- ui->threadTreeWidget->setCurrentIndex(prevItem);
- ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
- ui->threadTreeWidget->setFocus();
- }
- }
- ui->previousButton->setEnabled(index-1 > 0);
- ui->nextButton->setEnabled(true);
+ if (prevItem.isValid()) {
+ ui->threadTreeWidget->setCurrentIndex(prevItem);
+ ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
+ ui->threadTreeWidget->setFocus();
+ }
+ }
+ ui->previousButton->setEnabled(index-1 > 0);
+ ui->nextButton->setEnabled(true);
}
@@ -1352,128 +1355,128 @@ void GxsForumThreadWidget::nextMessage()
{
QModelIndex current_index = getCurrentIndex();
- if (!current_index.isValid())
- return;
+ if (!current_index.isValid())
+ return;
- QModelIndex parentIndex = current_index.parent();
+ QModelIndex parentIndex = current_index.parent();
- int index = current_index.row();
- int count = mThreadProxyModel->rowCount(parentIndex);
+ int index = current_index.row();
+ int count = mThreadProxyModel->rowCount(parentIndex);
- if (index < count - 1)
+ if (index < count - 1)
{
- QModelIndex nextItem = mThreadProxyModel->index(index + 1,0,parentIndex) ;
+ QModelIndex nextItem = mThreadProxyModel->index(index + 1,0,parentIndex) ;
- if (nextItem.isValid()) {
- ui->threadTreeWidget->setCurrentIndex(nextItem);
- ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex()); //May change if model reloaded
- ui->threadTreeWidget->setFocus();
- }
- }
- ui->previousButton->setEnabled(true);
- ui->nextButton->setEnabled(index+1 < count - 1);
+ if (nextItem.isValid()) {
+ ui->threadTreeWidget->setCurrentIndex(nextItem);
+ ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex()); //May change if model reloaded
+ ui->threadTreeWidget->setFocus();
+ }
+ }
+ ui->previousButton->setEnabled(true);
+ ui->nextButton->setEnabled(index+1 < count - 1);
}
void GxsForumThreadWidget::downloadAllFiles()
{
- QStringList urls;
- if (RsHtml::findAnchors(ui->postText->toHtml(), urls) == false) {
- return;
- }
+ QStringList urls;
+ if (RsHtml::findAnchors(ui->postText->toHtml(), urls) == false) {
+ return;
+ }
- if (urls.count() == 0) {
- return;
- }
+ if (urls.count() == 0) {
+ return;
+ }
- RetroShareLink::process(urls, RetroShareLink::TYPE_FILE/*, true*/);
+ RetroShareLink::process(urls, RetroShareLink::TYPE_FILE/*, true*/);
}
void GxsForumThreadWidget::nextUnreadMessage()
{
- QModelIndex index = getCurrentIndex();
+ QModelIndex index = getCurrentIndex();
if(!index.isValid())
index = mThreadProxyModel->index(0,0);
else
{
- if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool())
- ui->threadTreeWidget->expand(index);
+ if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool())
+ ui->threadTreeWidget->expand(index);
- index = ui->threadTreeWidget->indexBelow(index);
+ index = ui->threadTreeWidget->indexBelow(index);
}
while(index.isValid() && !IS_MSG_UNREAD(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::StatusRole).toUInt()))
- {
- if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool())
- ui->threadTreeWidget->expand(index);
+ {
+ if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool())
+ ui->threadTreeWidget->expand(index);
- index = ui->threadTreeWidget->indexBelow(index);
- }
+ index = ui->threadTreeWidget->indexBelow(index);
+ }
- ui->threadTreeWidget->setCurrentIndex(index);
- ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
+ ui->threadTreeWidget->setCurrentIndex(index);
+ ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
}
void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum, RsGxsMessageId msgId /*= RsGxsMessageId()*/)
{
- if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) {
- return;
- }
- saveExpandedItems(mSavedExpandedMessages);
+ if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) {
+ return;
+ }
+ saveExpandedItems(mSavedExpandedMessages);
- QModelIndex src_index;
- if(forum)
- src_index = mThreadModel->root();
- else
- {
- if (!msgId.isNull())
- src_index = mThreadProxyModel->mapToSource(getCurrentIndex());
- else
- src_index = mThreadModel->getIndexOfMessage(mThreadId);
- }
- mThreadModel->setMsgReadStatus(src_index,read,children);
+ QModelIndex src_index;
+ if(forum)
+ src_index = mThreadModel->root();
+ else
+ {
+ if (!msgId.isNull())
+ src_index = mThreadProxyModel->mapToSource(getCurrentIndex());
+ else
+ src_index = mThreadModel->getIndexOfMessage(mThreadId);
+ }
+ mThreadModel->setMsgReadStatus(src_index,read,children);
- //Restore Selection
- whileBlocking(ui->threadTreeWidget)->setCurrentIndex(mThreadProxyModel->mapFromSource(mThreadModel->getIndexOfMessage(mThreadId)));
- recursRestoreExpandedItems(QModelIndex(),mSavedExpandedMessages);
+ //Restore Selection
+ whileBlocking(ui->threadTreeWidget)->setCurrentIndex(mThreadProxyModel->mapFromSource(mThreadModel->getIndexOfMessage(mThreadId)));
+ recursRestoreExpandedItems(QModelIndex(),mSavedExpandedMessages);
}
void GxsForumThreadWidget::markMsgAsRead()
{
- markMsgAsReadUnread(true, false, false);
+ markMsgAsReadUnread(true, false, false);
}
void GxsForumThreadWidget::markMsgAsReadChildren()
{
- markMsgAsReadUnread(true, true, false);
+ markMsgAsReadUnread(true, true, false);
}
void GxsForumThreadWidget::markMsgAsUnread()
{
- markMsgAsReadUnread(false, false, false);
+ markMsgAsReadUnread(false, false, false);
}
void GxsForumThreadWidget::markMsgAsUnreadChildren()
{
- markMsgAsReadUnread(false, true, false);
+ markMsgAsReadUnread(false, true, false);
}
void GxsForumThreadWidget::setAllMessagesReadDo(bool read, uint32_t &/*token*/)
{
- markMsgAsReadUnread(read, true, true);
+ markMsgAsReadUnread(read, true, true);
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
void GxsForumThreadWidget::expandSubtree() {
- QAction* the_action = qobject_cast(sender());
- if (!the_action) {
- return;
- }
- const QModelIndex current_index = ui->threadTreeWidget->currentIndex();
- if (!current_index.isValid()) {
- return;
- }
- ui->threadTreeWidget->expandRecursively(current_index);
+ QAction* the_action = qobject_cast(sender());
+ if (!the_action) {
+ return;
+ }
+ const QModelIndex current_index = ui->threadTreeWidget->currentIndex();
+ if (!current_index.isValid()) {
+ return;
+ }
+ ui->threadTreeWidget->expandRecursively(current_index);
}
#endif
@@ -1486,63 +1489,63 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId)
std::cerr << "(EE) Cannot navigate to msg " << msgId << " in forum " << mForumGroup.mMeta.mGroupId << ": index unknown. Setting mNavigatePendingMsgId." << std::endl;
mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading.
- return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
+ return true; // we have to return true here, otherwise the caller will intepret the async loading as an error.
}
QModelIndex indx = mThreadProxyModel->mapFromSource(source_index);
- ui->threadTreeWidget->setCurrentIndex(indx);
- ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
- ui->threadTreeWidget->setFocus();
- return true;
+ ui->threadTreeWidget->setCurrentIndex(indx);
+ ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
+ ui->threadTreeWidget->setFocus();
+ return true;
}
void GxsForumThreadWidget::copyMessageLink()
{
- if (groupId().isNull() || mThreadId.isNull()) {
- return;
- }
+ if (groupId().isNull() || mThreadId.isNull()) {
+ return;
+ }
ForumModelPostEntry fmpe ;
getCurrentPost(fmpe);
- QString thread_title = QString::fromUtf8(fmpe.mTitle.c_str());
+ QString thread_title = QString::fromUtf8(fmpe.mTitle.c_str());
- RetroShareLink link = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, groupId(), mThreadId, thread_title);
+ RetroShareLink link = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, groupId(), mThreadId, thread_title);
- if (link.valid()) {
- QList urls;
- urls.push_back(link);
- RSLinkClipboard::copyLinks(urls);
- }
+ if (link.valid()) {
+ QList urls;
+ urls.push_back(link);
+ RSLinkClipboard::copyLinks(urls);
+ }
}
void GxsForumThreadWidget::subscribeGroup(bool subscribe)
{
- if (groupId().isNull()) {
- return;
- }
+ if (groupId().isNull()) {
+ return;
+ }
- uint32_t token;
- rsGxsForums->subscribeToGroup(token, groupId(), subscribe);
+ uint32_t token;
+ rsGxsForums->subscribeToGroup(token, groupId(), subscribe);
}
void GxsForumThreadWidget::createmessage()
{
- if (groupId().isNull () || !IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) {
- return;
- }
+ if (groupId().isNull () || !IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) {
+ return;
+ }
- CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), mThreadId,RsGxsMessageId());
- cfm->show();
+ CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), mThreadId,RsGxsMessageId());
+ cfm->show();
- /* window will destroy itself! */
+ /* window will destroy itself! */
}
void GxsForumThreadWidget::togglePinUpPost()
{
- if (groupId().isNull() || mOrigThreadId.isNull())
- return;
+ if (groupId().isNull() || mOrigThreadId.isNull())
+ return;
QModelIndex index = getCurrentIndex();
@@ -1552,21 +1555,21 @@ void GxsForumThreadWidget::togglePinUpPost()
{
std::cerr << "(EE) togglePinUpPost() called on non top level post. This is inconsistent." << std::endl;
return ;
- }
+ }
- QString thread_title = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_TITLE).data(Qt::DisplayRole).toString();
+ QString thread_title = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_TITLE).data(Qt::DisplayRole).toString();
#ifdef DEBUG_FORUMS
std::cerr << "Toggling Pin-up state of post " << mThreadId.toStdString() << ": \"" << thread_title.toStdString() << "\"" << std::endl;
#endif
if(mForumGroup.mPinnedPosts.ids.find(mThreadId) == mForumGroup.mPinnedPosts.ids.end())
- mForumGroup.mPinnedPosts.ids.insert(mThreadId) ;
+ mForumGroup.mPinnedPosts.ids.insert(mThreadId) ;
else
- mForumGroup.mPinnedPosts.ids.erase(mThreadId) ;
+ mForumGroup.mPinnedPosts.ids.erase(mThreadId) ;
- uint32_t token;
- rsGxsForums->updateGroup(token,mForumGroup);
+ uint32_t token;
+ rsGxsForums->updateGroup(token,mForumGroup);
groupIdChanged(); // reloads all posts. We could also update the model directly, but the cost is so small now ;-)
updateDisplay(true) ;
@@ -1574,49 +1577,49 @@ void GxsForumThreadWidget::togglePinUpPost()
void GxsForumThreadWidget::createthread()
{
- if (groupId().isNull ()) {
- QMessageBox::information(this, tr("RetroShare"), tr("No Forum Selected!"));
- return;
- }
+ if (groupId().isNull ()) {
+ QMessageBox::information(this, tr("RetroShare"), tr("No Forum Selected!"));
+ return;
+ }
- CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), RsGxsMessageId(),RsGxsMessageId());
- cfm->show();
+ CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), RsGxsMessageId(),RsGxsMessageId());
+ cfm->show();
- /* window will destroy itself! */
+ /* window will destroy itself! */
}
static QString buildReplyHeader(const RsMsgMetaData &meta)
{
- RetroShareLink link = RetroShareLink::createMessage(meta.mAuthorId, "");
- QString from = link.toHtml();
+ RetroShareLink link = RetroShareLink::createMessage(meta.mAuthorId, "");
+ QString from = link.toHtml();
- QString header = QString("-----%1-----").arg(QApplication::translate("GxsForumThreadWidget", "Original Message"));
- header += QString("
%1: %2
").arg(QApplication::translate("GxsForumThreadWidget", "From"), from);
+ QString header = QString("-----%1-----").arg(QApplication::translate("GxsForumThreadWidget", "Original Message"));
+ header += QString("
%1: %2
").arg(QApplication::translate("GxsForumThreadWidget", "From"), from);
- header += QString("
%1: %2
").arg(QApplication::translate("GxsForumThreadWidget", "Sent"), DateTime::formatLongDateTime(meta.mPublishTs));
- header += QString("%1: %2
").arg(QApplication::translate("GxsForumThreadWidget", "Subject"), QString::fromUtf8(meta.mMsgName.c_str()));
- header += "
";
+ header += QString("
%1: %2
").arg(QApplication::translate("GxsForumThreadWidget", "Sent"), DateTime::formatLongDateTime(meta.mPublishTs));
+ header += QString("%1: %2
").arg(QApplication::translate("GxsForumThreadWidget", "Subject"), QString::fromUtf8(meta.mMsgName.c_str()));
+ header += "
";
- header += QApplication::translate("GxsForumThreadWidget", "On %1, %2 wrote:").arg(DateTime::formatDateTime(meta.mPublishTs), from);
+ header += QApplication::translate("GxsForumThreadWidget", "On %1, %2 wrote:").arg(DateTime::formatDateTime(meta.mPublishTs), from);
- return header;
+ return header;
}
void GxsForumThreadWidget::flagperson()
{
- // no need to use the token system for that, since we just need to find out the author's name, which is in the item.
+ // no need to use the token system for that, since we just need to find out the author's name, which is in the item.
- if (groupId().isNull() || mThreadId.isNull()) {
- QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message"));
- return;
- }
+ if (groupId().isNull() || mThreadId.isNull()) {
+ QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message"));
+ return;
+ }
- RsOpinion opinion =
- static_cast(
- qobject_cast(sender())->data().toUInt() );
+ RsOpinion opinion =
+ static_cast(
+ qobject_cast(sender())->data().toUInt() );
- mThreadModel->setAuthorOpinion(
- mThreadProxyModel->mapToSource(getCurrentIndex()), opinion );
+ mThreadModel->setAuthorOpinion(
+ mThreadProxyModel->mapToSource(getCurrentIndex()), opinion );
}
void GxsForumThreadWidget::replytoforummessage() { async_msg_action( &GxsForumThreadWidget::replyForumMessageData ); }
@@ -1626,13 +1629,13 @@ void GxsForumThreadWidget::showInPeopleTab() { async_msg_action( &Gxs
void GxsForumThreadWidget::async_msg_action(const MsgMethod &action)
{
- if (groupId().isNull() || mThreadId.isNull()) {
- QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message"));
- return;
- }
+ if (groupId().isNull() || mThreadId.isNull()) {
+ QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message"));
+ return;
+ }
- RsThread::async([this,action]()
- {
+ RsThread::async([this,action]()
+ {
// 1 - get message data from p3GxsForums
#ifdef DEBUG_FORUMS
@@ -1644,16 +1647,16 @@ void GxsForumThreadWidget::async_msg_action(const MsgMethod &action)
msgs_to_request.insert(mThreadId);
- if(!rsGxsForums->getForumContent(groupId(),msgs_to_request,msgs))
- {
- std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum message info for forum " << groupId() << " and thread " << mThreadId << std::endl;
- return;
+ if(!rsGxsForums->getForumContent(groupId(),msgs_to_request,msgs))
+ {
+ std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum message info for forum " << groupId() << " and thread " << mThreadId << std::endl;
+ return;
}
if(msgs.size() != 1)
{
- std::cerr << __PRETTY_FUNCTION__ << " more than 1 or no msgs selected in forum " << groupId() << std::endl;
- return;
+ std::cerr << __PRETTY_FUNCTION__ << " more than 1 or no msgs selected in forum " << groupId() << std::endl;
+ return;
}
// 2 - sort the messages into a proper hierarchy
@@ -1663,65 +1666,65 @@ void GxsForumThreadWidget::async_msg_action(const MsgMethod &action)
// 3 - update the model in the UI thread.
RsQThreadUtils::postToObject( [msg,action,this]()
- {
- /* Here it goes any code you want to be executed on the Qt Gui
- * thread, for example to update the data model with new information
- * after a blocking call to RetroShare API complete */
+ {
+ /* Here it goes any code you want to be executed on the Qt Gui
+ * thread, for example to update the data model with new information
+ * after a blocking call to RetroShare API complete */
- (this->*action)(msg);
+ (this->*action)(msg);
- }, this );
+ }, this );
});
}
void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg)
{
- if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
- {
- std::cerr << "(EE) GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
- std::cerr << std::endl;
- return;
- }
+ if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
+ {
+ std::cerr << "(EE) GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
+ std::cerr << std::endl;
+ return;
+ }
- if (!msg.mMeta.mAuthorId.isNull())
- {
- MessageComposer *msgDialog = MessageComposer::newMsg();
- msgDialog->setTitleText(QString::fromUtf8(msg.mMeta.mMsgName.c_str()), MessageComposer::REPLY);
+ if (!msg.mMeta.mAuthorId.isNull())
+ {
+ MessageComposer *msgDialog = MessageComposer::newMsg();
+ msgDialog->setTitleText(QString::fromUtf8(msg.mMeta.mMsgName.c_str()), MessageComposer::REPLY);
- msgDialog->setQuotedMsg(QString::fromUtf8(msg.mMsg.c_str()), buildReplyHeader(msg.mMeta));
+ msgDialog->setQuotedMsg(QString::fromUtf8(msg.mMsg.c_str()), buildReplyHeader(msg.mMeta));
- msgDialog->addRecipient(MessageComposer::TO, RsGxsId(msg.mMeta.mAuthorId));
- msgDialog->show();
- msgDialog->activateWindow();
+ msgDialog->addRecipient(MessageComposer::TO, RsGxsId(msg.mMeta.mAuthorId));
+ msgDialog->show();
+ msgDialog->activateWindow();
- /* window will destroy itself! */
- }
- else
- {
- QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to an Anonymous Author"));
- }
+ /* window will destroy itself! */
+ }
+ else
+ {
+ QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to an Anonymous Author"));
+ }
}
void GxsForumThreadWidget::editForumMessageData(const RsGxsForumMsg& msg)
{
- if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
- {
- std::cerr << "(EE) GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
- std::cerr << std::endl;
- return;
- }
+ if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
+ {
+ std::cerr << "(EE) GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
+ std::cerr << std::endl;
+ return;
+ }
- // Go through the list of own ids and see if one of them is a moderator
- // TODO: offer to select which moderator ID to use if multiple IDs fit the conditions of the forum
+ // Go through the list of own ids and see if one of them is a moderator
+ // TODO: offer to select which moderator ID to use if multiple IDs fit the conditions of the forum
RsGxsId moderator_id ;
- std::list own_ids ;
- rsIdentity->getOwnIds(own_ids) ;
+ std::list own_ids ;
+ rsIdentity->getOwnIds(own_ids) ;
- for(auto it(own_ids.begin());it!=own_ids.end();++it)
- if(mForumGroup.mAdminList.ids.find(*it) != mForumGroup.mAdminList.ids.end())
+ for(auto it(own_ids.begin());it!=own_ids.end();++it)
+ if(mForumGroup.mAdminList.ids.find(*it) != mForumGroup.mAdminList.ids.end())
{
moderator_id = *it;
break;
@@ -1733,61 +1736,61 @@ void GxsForumThreadWidget::editForumMessageData(const RsGxsForumMsg& msg)
if(*it == msg.mMeta.mAuthorId)
is_own = true ;
- if (!msg.mMeta.mAuthorId.isNull())
- {
- CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), msg.mMeta.mParentId, msg.mMeta.mMsgId, is_own?(msg.mMeta.mAuthorId):moderator_id,!is_own);
+ if (!msg.mMeta.mAuthorId.isNull())
+ {
+ CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), msg.mMeta.mParentId, msg.mMeta.mMsgId, is_own?(msg.mMeta.mAuthorId):moderator_id,!is_own);
- cfm->insertPastedText(QString::fromUtf8(msg.mMsg.c_str())) ;
- cfm->show();
+ cfm->insertPastedText(QString::fromUtf8(msg.mMsg.c_str())) ;
+ cfm->show();
- /* window will destroy itself! */
- }
- else
- {
- QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to an Anonymous Author"));
- }
+ /* window will destroy itself! */
+ }
+ else
+ {
+ QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to an Anonymous Author"));
+ }
}
void GxsForumThreadWidget::replyForumMessageData(const RsGxsForumMsg &msg)
{
- if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
- {
- std::cerr << "(EE) GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
- std::cerr << std::endl;
- return;
- }
+ if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
+ {
+ std::cerr << "(EE) GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
+ std::cerr << std::endl;
+ return;
+ }
- if (!msg.mMeta.mAuthorId.isNull())
- {
- CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), mThreadId,RsGxsMessageId());
+ if (!msg.mMeta.mAuthorId.isNull())
+ {
+ CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), mThreadId,RsGxsMessageId());
- RsHtml::makeQuotedText(ui->postText);
+ RsHtml::makeQuotedText(ui->postText);
- cfm->insertPastedText(RsHtml::makeQuotedText(ui->postText)) ;
- cfm->show();
+ cfm->insertPastedText(RsHtml::makeQuotedText(ui->postText)) ;
+ cfm->show();
- /* window will destroy itself! */
- }
- else
- {
- QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to an Anonymous Author"));
- }
+ /* window will destroy itself! */
+ }
+ else
+ {
+ QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to an Anonymous Author"));
+ }
}
void GxsForumThreadWidget::saveImage()
{
- QPoint point = ui->actionSave_image->data().toPoint();
- QTextCursor cursor = ui->postText->cursorForPosition(point);
- ImageUtil::extractImage(window(), cursor);
+ QPoint point = ui->actionSave_image->data().toPoint();
+ QTextCursor cursor = ui->postText->cursorForPosition(point);
+ ImageUtil::extractImage(window(), cursor);
}
void GxsForumThreadWidget::changedViewBox()
{
- ui->threadTreeWidget->selectionModel()->clear();
- ui->threadTreeWidget->selectionModel()->reset();
+ ui->threadTreeWidget->selectionModel()->clear();
+ ui->threadTreeWidget->selectionModel()->reset();
mThreadId.clear();
- // save index
- Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex());
+ // save index
+ Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex());
if(ui->viewBox->currentIndex() == VIEW_FLAT)
mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT);
@@ -1802,49 +1805,49 @@ void GxsForumThreadWidget::changedViewBox()
void GxsForumThreadWidget::filterColumnChanged(int column)
{
- filterItems(ui->filterLineEdit->text());
+ filterItems(ui->filterLineEdit->text());
- // save index
- Settings->setValueToGroup("ForumThreadWidget", "filterColumn", column);
+ // save index
+ Settings->setValueToGroup("ForumThreadWidget", "filterColumn", column);
}
void GxsForumThreadWidget::filterItems(const QString& text)
{
- QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
+ QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
- int filterColumn = ui->filterLineEdit->currentFilter();
+ int filterColumn = ui->filterLineEdit->currentFilter();
uint32_t count;
- mThreadModel->setFilter(filterColumn,lst,count) ;
+ mThreadModel->setFilter(filterColumn,lst,count) ;
// We do this in order to trigger a new filtering action in the proxy model.
- mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ;
+ mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ;
- if(!lst.empty())
- ui->threadTreeWidget->expandAll();
- else {
- // currentIndex() not on the clicked message, so not this way
- // if (!mThreadId.isNull()) {
- // an_index = mThreadProxyModel->mapToSource(ui->threadTreeWidget->currentIndex());
- // }
- ui->threadTreeWidget->collapseAll();
- if (!mThreadId.isNull()) {
- // ...but this one
- QModelIndex an_index = mThreadModel->getIndexOfMessage(mThreadId);
- if (an_index.isValid()) {
- QModelIndex the_index = mThreadProxyModel->mapFromSource(an_index);
- ui->threadTreeWidget->setCurrentIndex(the_index);
- ui->threadTreeWidget->scrollTo(the_index);
- // don't change focus
- // ui->threadTreeWidget->setFocus();
- }
- }
+ if(!lst.empty())
+ ui->threadTreeWidget->expandAll();
+ else {
+ // currentIndex() not on the clicked message, so not this way
+ // if (!mThreadId.isNull()) {
+ // an_index = mThreadProxyModel->mapToSource(ui->threadTreeWidget->currentIndex());
+ // }
+ ui->threadTreeWidget->collapseAll();
+ if (!mThreadId.isNull()) {
+ // ...but this one
+ QModelIndex an_index = mThreadModel->getIndexOfMessage(mThreadId);
+ if (an_index.isValid()) {
+ QModelIndex the_index = mThreadProxyModel->mapFromSource(an_index);
+ ui->threadTreeWidget->setCurrentIndex(the_index);
+ ui->threadTreeWidget->scrollTo(the_index);
+ // don't change focus
+ // ui->threadTreeWidget->setFocus();
+ }
+ }
}
- if(count > 0)
- ui->filterLineEdit->setToolTip(tr("No result.")) ;
- else
- ui->filterLineEdit->setToolTip(tr("Found %1 results.").arg(count)) ;
+ if(count > 0)
+ ui->filterLineEdit->setToolTip(tr("No result.")) ;
+ else
+ ui->filterLineEdit->setToolTip(tr("Found %1 results.").arg(count)) ;
}
/*********************** **** **** **** ***********************/
@@ -1853,65 +1856,65 @@ void GxsForumThreadWidget::filterItems(const QString& text)
void GxsForumThreadWidget::postForumLoading()
{
- if(groupId().isNull())
+ if(groupId().isNull())
{
ui->nextUnreadButton->setEnabled(false);
return;
}
#ifdef DEBUG_FORUMS
- std::cerr << "Post forum loading..." << std::endl;
+ std::cerr << "Post forum loading..." << std::endl;
#endif
- if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid())
- {
+ if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid())
+ {
#ifdef DEBUG_FORUMS
- std::cerr << "Pending msg navigation: " << mNavigatePendingMsgId << ". Using it as new thread Id" << std::endl;
+ std::cerr << "Pending msg navigation: " << mNavigatePendingMsgId << ". Using it as new thread Id" << std::endl;
#endif
- QModelIndex source_index = mThreadModel->getIndexOfMessage(mNavigatePendingMsgId);
- QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
+ QModelIndex source_index = mThreadModel->getIndexOfMessage(mNavigatePendingMsgId);
+ QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
- ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
- ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
+ ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
+ ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
- mNavigatePendingMsgId.clear();
- }
- else
- {
+ mNavigatePendingMsgId.clear();
+ }
+ else
+ {
- QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
+ QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId);
- if(!mThreadId.isNull() && source_index.isValid())
- {
- QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
- ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
- ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
+ if(!mThreadId.isNull() && source_index.isValid())
+ {
+ QModelIndex index = mThreadProxyModel->mapFromSource(source_index);
+ ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
+ ui->threadTreeWidget->scrollTo(ui->threadTreeWidget->currentIndex());//May change if model reloaded
#ifdef DEBUG_FORUMS
- std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl;
+ std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl;
#endif
- }
- else
- {
+ }
+ else
+ {
#ifdef DEBUG_FORUMS
- std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl;
+ std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl;
#endif
- ui->threadTreeWidget->selectionModel()->clear();
- ui->threadTreeWidget->selectionModel()->reset();
- mThreadId.clear();
- //blank();
- }
- // we also need to restore expanded threads
- }
+ ui->threadTreeWidget->selectionModel()->clear();
+ ui->threadTreeWidget->selectionModel()->reset();
+ mThreadId.clear();
+ //blank();
+ }
+ // we also need to restore expanded threads
+ }
- ui->newthreadButton->show();
- ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
- ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
- ui->threadTreeWidget->update();
- ui->viewBox->setEnabled(true);
- ui->filterLineEdit->setEnabled(true);
+ ui->newthreadButton->show();
+ ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str()));
+ ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder);
+ ui->threadTreeWidget->update();
+ ui->viewBox->setEnabled(true);
+ ui->filterLineEdit->setEnabled(true);
- recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages);
- //mUpdating = false;
+ recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages);
+ //mUpdating = false;
ui->nextUnreadButton->setEnabled(true);
}
@@ -1925,60 +1928,60 @@ void GxsForumThreadWidget::updateGroupData()
// ui->threadTreeWidget->selectionModel()->reset();
// mThreadProxyModel->clear();
- setForumDescriptionLoading();
+ setForumDescriptionLoading();
- RsThread::async([this]()
- {
+ RsThread::async([this]()
+ {
// 1 - get message data from p3GxsForums
std::list forumIds;
- std::vector groups;
+ std::vector groups;
forumIds.push_back(groupId());
bool success = false;
- if(!rsGxsForums->getForumsInfo(forumIds,groups))
- std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum group info for forum " << groupId() << std::endl;
- else if(groups.size() != 1)
- std::cerr << __PRETTY_FUNCTION__ << " obtained more than one group info for forum " << groupId() << std::endl;
+ if(!rsGxsForums->getForumsInfo(forumIds,groups))
+ std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum group info for forum " << groupId() << std::endl;
+ else if(groups.size() != 1)
+ std::cerr << __PRETTY_FUNCTION__ << " obtained more than one group info for forum " << groupId() << std::endl;
else
success = true;
- if(success)
- {
- // 2 - sort the messages into a proper hierarchy
+ if(success)
+ {
+ // 2 - sort the messages into a proper hierarchy
- RsGxsForumGroup group(groups[0]); // we use a copy to share the object in order to avoid group deletion while we're in the thread.
+ RsGxsForumGroup group(groups[0]); // we use a copy to share the object in order to avoid group deletion while we're in the thread.
- // 3 - update the model in the UI thread.
+ // 3 - update the model in the UI thread.
- RsQThreadUtils::postToObject( [group,this]()
- {
- /* Here it goes any code you want to be executed on the Qt Gui
- * thread, for example to update the data model with new information
- * after a blocking call to RetroShare API complete */
+ RsQThreadUtils::postToObject( [group,this]()
+ {
+ /* Here it goes any code you want to be executed on the Qt Gui
+ * thread, for example to update the data model with new information
+ * after a blocking call to RetroShare API complete */
- mForumGroup = group;
- mThreadId.clear();
+ mForumGroup = group;
+ mThreadId.clear();
- ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags)));
- ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ;
+ ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags)));
+ ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ;
- updateForumDescription(true);
+ updateForumDescription(true);
emit groupChanged(this); // signals the parent widget to e.g. update the group tab name
- }, this );
- }
- else
- RsQThreadUtils::postToObject( [this]() { updateForumDescription(false); },this);
+ }, this );
+ }
+ else
+ RsQThreadUtils::postToObject( [this]() { updateForumDescription(false); },this);
});
}
void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId)
{
- RsThread::async([msgId,this]()
- {
+ RsThread::async([msgId,this]()
+ {
// 1 - get message data from p3GxsForums
#ifdef DEBUG_FORUMS
@@ -1991,20 +1994,20 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId)
msgs_to_request.insert(msgId);
QString error_string;
- if(!rsGxsForums->getForumContent(groupId(),msgs_to_request,msgs))
- {
- std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve message info for forum " << groupId() << " and MsgId " << msgId << std::endl;
+ if(!rsGxsForums->getForumContent(groupId(),msgs_to_request,msgs))
+ {
+ std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve message info for forum " << groupId() << " and MsgId " << msgId << std::endl;
error_string = tr("Failed to retrieve this message. Is the database currently overloaded?");
}
if(msgs.empty())
{
- std::cerr << __PRETTY_FUNCTION__ << " no posts for msgId " << msgId << ". Database corruption?" << std::endl;
+ std::cerr << __PRETTY_FUNCTION__ << " no posts for msgId " << msgId << ". Database corruption?" << std::endl;
error_string = tr("No data for this message. Is the database corrupted?");
}
if(msgs.size() > 1)
{
- std::cerr << __PRETTY_FUNCTION__ << " obtained more than one msg info for msgId " << msgId << ". This could be a bug. Only showing the first msg in the list." << std::endl;
+ std::cerr << __PRETTY_FUNCTION__ << " obtained more than one msg info for msgId " << msgId << ". This could be a bug. Only showing the first msg in the list." << std::endl;
std::cerr << "Messages are:" << std::endl;
for(auto it(msgs.begin());it!=msgs.end();++it)
std::cerr << (*it).mMeta << std::endl;
@@ -2013,25 +2016,25 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId)
}
if(error_string.isNull())
- {
- // 2 - sort the messages into a proper hierarchy
+ {
+ // 2 - sort the messages into a proper hierarchy
- RsGxsForumMsg msg(msgs[0]);
+ RsGxsForumMsg msg(msgs[0]);
- // 3 - update the model in the UI thread.
+ // 3 - update the model in the UI thread.
- RsQThreadUtils::postToObject( [msg,this]()
- {
- /* Here it goes any code you want to be executed on the Qt Gui
- * thread, for example to update the data model with new information
- * after a blocking call to RetroShare API complete */
+ RsQThreadUtils::postToObject( [msg,this]()
+ {
+ /* Here it goes any code you want to be executed on the Qt Gui
+ * thread, for example to update the data model with new information
+ * after a blocking call to RetroShare API complete */
- insertMessageData(msg);
+ insertMessageData(msg);
- ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags)));
- ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ;
- }, this );
- }
+ ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags)));
+ ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ;
+ }, this );
+ }
else
RsQThreadUtils::postToObject( [error_string,this](){ setMessageLoadingError(error_string); } );
});
@@ -2039,18 +2042,18 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId)
void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg)
{
- if(msg.mMeta.mAuthorId.isNull())
- {
- std::cerr << "(EE) GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data...";
- std::cerr << std::endl;
- }
+ if(msg.mMeta.mAuthorId.isNull())
+ {
+ std::cerr << "(EE) GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data...";
+ std::cerr << std::endl;
+ }
- /* window will destroy itself! */
- IdDialog *idDialog = dynamic_cast(MainWindow::getPage(MainWindow::People));
+ /* window will destroy itself! */
+ IdDialog *idDialog = dynamic_cast(MainWindow::getPage(MainWindow::People));
- if (!idDialog)
- return ;
+ if (!idDialog)
+ return ;
- MainWindow::showWindow(MainWindow::People);
- idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId));
+ MainWindow::showWindow(MainWindow::People);
+ idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId));
}