Fixed message read status to use new method

*Fixed default Avatars
This commit is contained in:
defnax 2026-04-12 18:10:25 +02:00
parent e6e7340da6
commit 3faa35cfb0
3 changed files with 17 additions and 15 deletions

View File

@ -1524,7 +1524,9 @@ WireGroupItem *WireDialog::findGroupItemWidget(const RsGxsGroupId &groupId)
void WireDialog::markGroupAsRead(const RsGxsGroupId &groupId)
{
// Fetch all message summaries in the background and mark each as read.
// Fetch all message summaries in the background and mark each as read
// using the blocking API — DB write is complete before each call returns,
// so the event arrives after the data is committed.
RsThread::async([this, groupId]()
{
std::vector<RsMsgMetaData> summaries;
@ -1537,15 +1539,11 @@ void WireDialog::markGroupAsRead(const RsGxsGroupId &groupId)
for (auto &meta : summaries)
{
uint32_t token;
RsGxsGrpMsgIdPair msgIdPair(groupId, meta.mMsgId);
rsWire->setMessageReadStatus(token, msgIdPair, true);
rsWire->setMessageReadStatus(msgIdPair, true);
}
// Refresh statistics and notify icon from the GUI thread.
RsQThreadUtils::postToObject([this, groupId]()
{
updateGroupStatisticsReal(groupId);
}, this);
// Stats will be refreshed automatically via the READ_STATUS_CHANGED events
// fired by setMessageReadStatus for each message.
});
}
}

View File

@ -30,6 +30,8 @@
#include "gui/TheWire/WireDialog.h"
#include "util/DateTime.h"
#define IMAGE_WIRE ":icons/wire.png"
/****
* #define DEBUG_ITEM 1
****/
@ -180,7 +182,9 @@ void WireNotifyGroupItem::fill()
GxsIdDetails::loadPixmapFromData(mGroup.mHeadshot.mData, mGroup.mHeadshot.mSize, wireImage,GxsIdDetails::ORIGINAL);
ui->logoLabel->setPixmap(QPixmap(wireImage));
} else {
ui->logoLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/wire.png"));
// default.
QPixmap pixmap = GxsIdDetails::makeDefaultGroupIcon(mGroup.mMeta.mGroupId, IMAGE_WIRE, GxsIdDetails::ORIGINAL);
ui->logoLabel->setPixmap(pixmap);
}
//TODO - nice icon for subscribed group

View File

@ -35,6 +35,8 @@
#include <iostream>
#include <cmath>
#define IMAGE_WIRE ":icons/wire.png"
WireNotifyPostItem::WireNotifyPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId& groupId, const RsGxsMessageId &messageId, bool autoUpdate, const std::set<RsGxsMessageId> &older_versions) :
GxsFeedItem(feedHolder, feedId, groupId, messageId, false, rsWire, autoUpdate)
{
@ -330,7 +332,7 @@ void WireNotifyPostItem::doExpand(bool open)
ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png")));
ui->expandButton->setToolTip(tr("Hide"));
// readToggled(false);
readToggled(false);
}
else
{
@ -475,7 +477,7 @@ void WireNotifyPostItem::setGroup(const RsWireGroup &group)
else
{
// default.
QPixmap pixmap = FilesDefs::getPixmapFromQtResourcePath(":/icons/wire.png");
QPixmap pixmap = GxsIdDetails::makeDefaultGroupIcon(group.mMeta.mGroupId, IMAGE_WIRE, GxsIdDetails::ORIGINAL);
ui->logoLabel->setPixmap(pixmap);
}
@ -503,9 +505,7 @@ void WireNotifyPostItem::readToggled(bool /*checked*/)
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
//rsWire->setMessageReadStatus(msgPair, isUnread());
//setReadStatus(false, checked); // Updated by events
rsWire->setMessageReadStatus(msgPair, isUnread());
}
void WireNotifyPostItem::on_linkActivated(QString link)