diff --git a/libretroshare/src/retroshare/rswire.h b/libretroshare/src/retroshare/rswire.h index 66fd7ba9a..03625719f 100644 --- a/libretroshare/src/retroshare/rswire.h +++ b/libretroshare/src/retroshare/rswire.h @@ -42,6 +42,8 @@ typedef std::shared_ptr RsWireGroupConstSPtr; class RsWireGroup: public RsGxsGenericGroupData { public: + RsWireGroup(); + std::string mTagline; std::string mLocation; diff --git a/libretroshare/src/services/p3wire.cc b/libretroshare/src/services/p3wire.cc index 56ec04554..4a8719415 100644 --- a/libretroshare/src/services/p3wire.cc +++ b/libretroshare/src/services/p3wire.cc @@ -30,6 +30,12 @@ RsWire *rsWire = NULL; +RsWireGroup::RsWireGroup() + :mGroupPulses(0),mGroupRepublishes(0),mGroupLikes(0),mGroupReplies(0) + ,mRefMentions(0),mRefRepublishes(0),mRefLikes(0),mRefReplies(0) +{ + return; +} uint32_t RsWirePulse::ImageCount() { @@ -878,6 +884,19 @@ bool p3Wire::getPulsesForGroups(const std::list &groupIds, std::li return false; } + + std::cerr << "p3Wire::getPulsesForGroups() size = " << pulsePtrs.size(); + std::cerr << std::endl; + { + std::list::iterator it; + for (it = pulsePtrs.begin(); it != pulsePtrs.end(); it++) + { + std::cerr << "p3Wire::getPulsesForGroups() Flags: "; + std::cerr << (*it)->mPulseType << " Msg: " << (*it)->mPulseText; + std::cerr << std::endl; + } + } + std::cerr << "p3Wire::getPulsesForGroups() size = " << pulsePtrs.size(); std::cerr << " sorting and trimming"; std::cerr << std::endl; diff --git a/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp b/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp index 38ead4b84..715bc8ff6 100644 --- a/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp +++ b/retroshare-gui/src/gui/TheWire/PulseViewGroup.cpp @@ -25,6 +25,7 @@ #include "PulseViewGroup.h" +#include "gui/gxs/GxsIdDetails.h" #include "util/DateTime.h" /** Constructor */ @@ -40,8 +41,54 @@ PulseViewGroup::PulseViewGroup(PulseViewHolder *holder, RsWireGroupSPtr group) void PulseViewGroup::setup() { if (mGroup) { - label_groupName->setText(QString::fromStdString(mGroup->mMeta.mGroupName)); - label_authorName->setText(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString())); + label_groupName->setText("@" + QString::fromStdString(mGroup->mMeta.mGroupName)); + label_authorName->setText(BoldString(QString::fromStdString(mGroup->mMeta.mAuthorId.toStdString()))); + label_date->setText(DateTime::formatDateTime(mGroup->mMeta.mPublishTs)); + label_tagline->setText(QString::fromStdString(mGroup->mTagline)); + label_location->setText(QString::fromStdString(mGroup->mLocation)); + + // need to draw mGroup->mMasthead, as background to headshot. + // TODO frame_headerBackground->setBackground() + + if (mGroup->mHeadshot.mData) + { + QPixmap pixmap; + if (GxsIdDetails::loadPixmapFromData( + mGroup->mHeadshot.mData, + mGroup->mHeadshot.mSize, + pixmap,GxsIdDetails::ORIGINAL)) + { + pixmap = pixmap.scaled(50,50); + label_headshot->setPixmap(pixmap); + } + } + else + { + // default. + QPixmap pixmap = QPixmap(":/icons/png/posted.png").scaled(50,50); + label_headshot->setPixmap(pixmap); + } + + if (mGroup->mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) + { + uint32_t pulses = mGroup->mGroupPulses + mGroup->mGroupReplies; + uint32_t replies = mGroup->mRefReplies; + uint32_t republishes = mGroup->mRefRepublishes; + uint32_t likes = mGroup->mRefLikes; + + label_extra_pulses->setText(BoldString(ToNumberUnits(pulses))); + label_extra_replies->setText(BoldString(ToNumberUnits(replies))); + label_extra_republishes->setText(BoldString(ToNumberUnits(republishes))); + label_extra_likes->setText(BoldString(ToNumberUnits(likes))); + + // hide follow. + widget_actions->setVisible(false); + } + else + { + // hide stats. + widget_replies->setVisible(false); + } } } diff --git a/retroshare-gui/src/gui/TheWire/PulseViewGroup.ui b/retroshare-gui/src/gui/TheWire/PulseViewGroup.ui index 3a4d3e688..6dc0a25cf 100644 --- a/retroshare-gui/src/gui/TheWire/PulseViewGroup.ui +++ b/retroshare-gui/src/gui/TheWire/PulseViewGroup.ui @@ -245,7 +245,7 @@ border-radius: 10px} - + 0 @@ -277,7 +277,7 @@ border-radius: 10px} - + 0