mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 09:11:28 -05: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 "ui_PostedCreatePostDialog.h"
|
||||||
|
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
#include "util/qtthreadsutils.h"
|
||||||
#include "util/RichTextEdit.h"
|
#include "util/RichTextEdit.h"
|
||||||
#include "gui/feeds/SubFileItem.h"
|
#include "gui/feeds/SubFileItem.h"
|
||||||
#include "util/rsdir.h"
|
#include "util/rsdir.h"
|
||||||
@ -178,10 +179,20 @@ void PostedCreatePostDialog::createPost()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t token;
|
RsThread::async([this,post]()
|
||||||
mPosted->createPost(token, post);
|
{
|
||||||
|
RsGxsMessageId post_id;
|
||||||
|
|
||||||
|
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();
|
accept();
|
||||||
|
}, this );
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostedCreatePostDialog::fileHashingFinished(QList<HashedFile> hashedFiles)
|
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);
|
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)
|
void PostedDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo)
|
||||||
{
|
{
|
||||||
GxsGroupFrameDialog::groupInfoToGroupItemInfo(groupData, groupItemInfo);
|
GxsGroupFrameDialog::groupInfoToGroupItemInfo(groupData, groupItemInfo);
|
||||||
|
@ -283,12 +283,16 @@ void BasePostedItem::readToggled(bool checked)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsThread::async([this,checked]()
|
||||||
|
{
|
||||||
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
|
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
|
||||||
|
rsPosted->setPostReadStatus(msgPair, !checked);
|
||||||
|
|
||||||
uint32_t token;
|
RsQThreadUtils::postToObject( [checked,this]()
|
||||||
rsPosted->setMessageReadStatus(token, msgPair, !checked);
|
{
|
||||||
|
|
||||||
setReadStatus(false, checked);
|
setReadStatus(false, checked);
|
||||||
|
}, this );
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasePostedItem::readAndClearItem()
|
void BasePostedItem::readAndClearItem()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user