continue cleanign the old token system

This commit is contained in:
csoler 2022-08-04 19:10:47 +02:00
parent 43fb720a98
commit 82f981c9db
6 changed files with 2 additions and 65 deletions

View file

@ -1213,48 +1213,3 @@ void PostedListWidgetWithModel::voteMsg(RsGxsGrpMsgIdPair msg,bool up_or_down)
updateDisplay(true);
}
#ifdef TODO
class PostedPostsReadData
{
public:
PostedPostsReadData(bool read)
{
mRead = read;
mLastToken = 0;
}
public:
bool mRead;
uint32_t mLastToken;
};
static void setAllMessagesReadCallback(FeedItem *feedItem, void *data)
{
GxsChannelPostItem *channelPostItem = dynamic_cast<GxsChannelPostItem*>(feedItem);
if (!channelPostItem) {
return;
}
GxsChannelPostsReadData *readData = (GxsChannelPostsReadData*) data;
bool isRead = !channelPostItem->isUnread() ;
if(channelPostItem->isLoaded() && (isRead == readData->mRead))
return ;
RsGxsGrpMsgIdPair msgPair = std::make_pair(channelPostItem->groupId(), channelPostItem->messageId());
rsGxsChannels->setMessageReadStatus(readData->mLastToken, msgPair, readData->mRead);
}
void PostedListWidgetWithModel::setAllMessagesReadDo(bool read, uint32_t &token)
{
if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags)) {
return;
}
GxsChannelPostsReadData data(read);
//ui->feedWidget->withAll(setAllMessagesReadCallback, &data);
token = data.mLastToken;
}
#endif