From 2406bf9cb4565aa4e30c7b00c2814e439c416338 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 10 Dec 2020 19:56:01 +0100 Subject: [PATCH] Added to display a new colored forum icons when forum is restricted to a circle * Added to show a red icon when forum is restricted to a private circle, show a green icon when forum restricted to a public circle. * Removed unnecessary colored icons for signed/tracking. --- .../src/gui/gxsforums/GxsForumsDialog.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp index e9aca3971..9527d8675 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp @@ -222,16 +222,20 @@ void GxsForumsDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *grou const RsGxsForumGroup *forumGroupData = dynamic_cast(groupData); if (!forumGroupData) - { + { std::cerr << "GxsChannelDialog::groupInfoToGroupItemInfo() Failed to cast data to GxsChannelGroupInfoData"<< std::endl; return; } + RsGxsCircleDetails details; + rsGxsCircles->getCircleDetails(RsGxsCircleId(groupData->mMeta.mCircleId), details) ; + groupItemInfo.description = QString::fromUtf8(forumGroupData->mDescription.c_str()); - if(IS_GROUP_ADMIN(groupData->mMeta.mSubscribeFlags)) - groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/forums.png"); - else if ((IS_GROUP_PGP_AUTHED(groupData->mMeta.mSignFlags)) || (IS_GROUP_MESSAGE_TRACKING(groupData->mMeta.mSignFlags)) ) - groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/forums-signed.png"); + if (!groupData->mMeta.mCircleId.isNull() ) + if (details.mRestrictedCircleId == details.mCircleId) + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/forums-red.png"); + else + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/forums-signed.png"); }