removed token system from GxsCommentDialog

This commit is contained in:
csoler 2022-07-09 22:33:42 +02:00
parent 1089d1470e
commit ac4b9b2971
13 changed files with 42 additions and 159 deletions

View file

@ -28,6 +28,7 @@
#include "gui/feeds/FeedHolder.h"
#include "gui/RetroShareLink.h"
#include "gui/gxs/GxsIdDetails.h"
#include "util/qtthreadsutils.h"
#include "util/DateTime.h"
#include "util/misc.h"
#include "util/stringutil.h"
@ -286,12 +287,15 @@ void BaseBoardsCommentsItem::readToggled(bool checked)
return;
}
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
uint32_t token;
rsPosted->setMessageReadStatus(token, msgPair, !checked);
setReadStatus(false, checked);
RsThread::async( [this,checked]() {
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
rsPosted->setCommentReadStatus(msgPair, !checked);
RsQThreadUtils::postToObject( [this,checked]() {
setReadStatus(false, checked);
} );
});
}
void BaseBoardsCommentsItem::readAndClearItem()

View file

@ -617,7 +617,7 @@ void ChannelsCommentsItem::readToggled(bool /*checked*/)
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
rsGxsChannels->markRead(msgPair, isUnread());
rsGxsChannels->setCommentReadStatus(msgPair, isUnread());
//setReadStatus(false, checked); // Updated by events
}

View file

@ -850,7 +850,7 @@ void GxsChannelPostItem::readToggled(bool /*checked*/)
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
rsGxsChannels->markRead(msgPair, isUnread());
rsGxsChannels->setMessageReadStatus(msgPair, isUnread());
//setReadStatus(false, checked); // Updated by events
}

View file

@ -475,18 +475,21 @@ void GxsForumMsgItem::unsubscribeForum()
void GxsForumMsgItem::setAsRead()
{
if (mInFill) {
return;
}
if (mInFill) {
return;
}
mCloseOnRead = false;
mCloseOnRead = false;
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
RsThread::async( [this]() {
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
uint32_t token;
rsGxsForums->setMessageReadStatus(token, msgPair, true);
rsGxsForums->markRead(msgPair, true);
setReadStatus(false, false);
RsQThreadUtils::postToObject( [this]() {
setReadStatus(false, true);
} );
});
}
void GxsForumMsgItem::on_linkActivated(QString link)