mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
removed tokens from boards and added missing blocking API calls
This commit is contained in:
parent
cdc650540b
commit
73279db2c5
@ -28,6 +28,7 @@
|
||||
#include "ui_PostedCreatePostDialog.h"
|
||||
|
||||
#include "util/misc.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "util/RichTextEdit.h"
|
||||
#include "gui/feeds/SubFileItem.h"
|
||||
#include "util/rsdir.h"
|
||||
@ -178,10 +179,20 @@ void PostedCreatePostDialog::createPost()
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t token;
|
||||
mPosted->createPost(token, post);
|
||||
RsThread::async([this,post]()
|
||||
{
|
||||
RsGxsMessageId post_id;
|
||||
|
||||
accept();
|
||||
bool res = rsPosted->createPost(post,post_id);
|
||||
|
||||
RsQThreadUtils::postToObject( [res,this]()
|
||||
{
|
||||
if(!res)
|
||||
QMessageBox::information(nullptr,tr("Error while creating post"),tr("An error occurred while creating the post."));
|
||||
|
||||
accept();
|
||||
}, this );
|
||||
});
|
||||
}
|
||||
|
||||
void PostedCreatePostDialog::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||
|
@ -217,34 +217,6 @@ QWidget *PostedDialog::createCommentHeaderWidget(const RsGxsGroupId &grpId, cons
|
||||
return new PostedItem(NULL, 0, grpId, msgId, true, false);
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void PostedDialog::loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata *&userdata)
|
||||
{
|
||||
std::vector<RsPostedGroup> groups;
|
||||
rsPosted->getGroupData(token, groups);
|
||||
|
||||
/* Save groups to fill description */
|
||||
PostedGroupInfoData *postedData = new PostedGroupInfoData;
|
||||
userdata = postedData;
|
||||
|
||||
std::vector<RsPostedGroup>::iterator groupIt;
|
||||
for (groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) {
|
||||
RsPostedGroup &group = *groupIt;
|
||||
groupInfo.push_back(group.mMeta);
|
||||
|
||||
if (group.mGroupImage.mData != NULL) {
|
||||
QPixmap image;
|
||||
GxsIdDetails::loadPixmapFromData(group.mGroupImage.mData, group.mGroupImage.mSize, image,GxsIdDetails::ORIGINAL);
|
||||
postedData->mIcon[group.mMeta.mGroupId] = image;
|
||||
}
|
||||
|
||||
if (!group.mDescription.empty()) {
|
||||
postedData->mDescription[group.mMeta.mGroupId] = QString::fromUtf8(group.mDescription.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void PostedDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo)
|
||||
{
|
||||
GxsGroupFrameDialog::groupInfoToGroupItemInfo(groupData, groupItemInfo);
|
||||
|
@ -279,16 +279,20 @@ void BasePostedItem::loadComments()
|
||||
}
|
||||
void BasePostedItem::readToggled(bool checked)
|
||||
{
|
||||
if (mInFill) {
|
||||
return;
|
||||
}
|
||||
if (mInFill) {
|
||||
return;
|
||||
}
|
||||
|
||||
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
|
||||
RsThread::async([this,checked]()
|
||||
{
|
||||
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
|
||||
rsPosted->setPostReadStatus(msgPair, !checked);
|
||||
|
||||
uint32_t token;
|
||||
rsPosted->setMessageReadStatus(token, msgPair, !checked);
|
||||
|
||||
setReadStatus(false, checked);
|
||||
RsQThreadUtils::postToObject( [checked,this]()
|
||||
{
|
||||
setReadStatus(false, checked);
|
||||
}, this );
|
||||
});
|
||||
}
|
||||
|
||||
void BasePostedItem::readAndClearItem()
|
||||
|
Loading…
Reference in New Issue
Block a user