diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 19c408336..8592cf2bc 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -936,6 +936,12 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) #endif markMsgAsReadUnread(true, false, false); } + + if (Settings->getForumExpandNewMessages()) + { + recursExpandUnread(index); + } + } void GxsForumThreadWidget::clickedThread(QModelIndex index) @@ -1323,7 +1329,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) else { RsIdentityDetails details; rsIdentity->getIdDetails(msg.mMeta.mAuthorId, details); - QString name = GxsIdDetails::getName(details); + QString name = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE); 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 += "
";
@@ -2107,3 +2113,16 @@ void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg)
MainWindow::showWindow(MainWindow::People);
idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId));
}
+
+void GxsForumThreadWidget::recursExpandUnread(const QModelIndex &index)
+{
+ if (index.isValid()
+ && index.data(RsGxsForumModel::UnreadChildrenRole).toBool()
+ ) {
+ ui->threadTreeWidget->expand(index);
+ for (int row=0; row < mThreadProxyModel->rowCount(index); ++row)
+ {
+ recursExpandUnread(index.child(row, 0));
+ }
+ }
+}
diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h
index 29e56268f..32dce5c1f 100644
--- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h
+++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h
@@ -199,6 +199,7 @@ private:
void setForumDescriptionLoading();
void clearForumDescription();
void blankPost();
+ void recursExpandUnread(const QModelIndex &index);
RsGxsGroupId mLastForumID;
RsGxsMessageId mThreadId;