mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
Merge pull request #2629 from csoler/v0.6-TokenSystem
continue cleaning the old token system
This commit is contained in:
commit
8595425e0b
@ -584,12 +584,13 @@ void CreateCircleDialog::createCircle()
|
||||
circle.mMeta.mCircleType = GXS_CIRCLE_TYPE_LOCAL;
|
||||
}
|
||||
|
||||
bool is_existing_circle(mIsExistingCircle);
|
||||
|
||||
RsThread::async([&circle,this]()
|
||||
RsThread::async([circle,is_existing_circle]()
|
||||
{
|
||||
RsGxsCircleId circleId;
|
||||
|
||||
if(mIsExistingCircle)
|
||||
if(is_existing_circle)
|
||||
{
|
||||
#ifdef DEBUG_CREATE_CIRCLE_DIALOG
|
||||
std::cerr << "CreateCircleDialog::updateCircle() : mCircleType: " << circle.mMeta.mCircleType << std::endl;
|
||||
@ -598,7 +599,7 @@ void CreateCircleDialog::createCircle()
|
||||
|
||||
std::cerr << "CreateCircleDialog::updateCircle() Checks and Balances Okay - calling service proper.."<< std::endl;
|
||||
#endif
|
||||
rsGxsCircles->editCircle(circle);
|
||||
rsGxsCircles->editCircle(*const_cast<RsGxsCircleGroup*>(&circle)); // const_cast: Not nice, but simpler.
|
||||
|
||||
circleId = RsGxsCircleId(circle.mMeta.mGroupId);
|
||||
}
|
||||
@ -619,14 +620,14 @@ void CreateCircleDialog::createCircle()
|
||||
circle.mLocalFriends);
|
||||
}
|
||||
|
||||
RsQThreadUtils::postToObject( [this,circle,circleId]()
|
||||
{
|
||||
if(!mIsExistingCircle)
|
||||
QMessageBox::information(nullptr,tr("Circle created"),
|
||||
tr("Your new circle has been created:\n Name: %1\n Id: %2.")
|
||||
.arg(QString::fromUtf8(circle.mMeta.mGroupName.c_str()))
|
||||
.arg(QString::fromStdString(circleId.toStdString())));
|
||||
});
|
||||
if(!is_existing_circle)
|
||||
RsQThreadUtils::postToObject( [circle,circleId]()
|
||||
{
|
||||
QMessageBox::information(nullptr,tr("Circle created"),
|
||||
tr("Your new circle has been created:\n Name: %1\n Id: %2.")
|
||||
.arg(QString::fromUtf8(circle.mMeta.mGroupName.c_str()))
|
||||
.arg(QString::fromStdString(circleId.toStdString())));
|
||||
});
|
||||
});
|
||||
|
||||
close();
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <retroshare-gui/mainpage.h>
|
||||
|
||||
#include "gui/feeds/FeedHolder.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include <retroshare-gui/RsAutoUpdatePage.h>
|
||||
|
||||
#define IMAGE_NEWSFEED ":/icons/png/newsfeed.png"
|
||||
|
@ -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
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include <retroshare/rsgxscircles.h>
|
||||
#include "FeedItem.h"
|
||||
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
namespace Ui {
|
||||
class GxsCircleItem;
|
||||
}
|
||||
|
@ -672,15 +672,9 @@ void GxsGroupDialog::createGroup()
|
||||
|
||||
if (service_createGroup(meta))
|
||||
{
|
||||
// now update the UI
|
||||
#warning Missing code here!
|
||||
#ifdef TODO
|
||||
//
|
||||
// get the Queue to handle response. What is this for?
|
||||
if(mExternalTokenQueue != NULL)
|
||||
mExternalTokenQueue->queueRequest(token, TOKENREQ_GROUPINFO, RS_TOKREQ_ANSTYPE_ACK, GXSGROUP_NEWGROUPID);
|
||||
#endif
|
||||
}
|
||||
// now update the UI
|
||||
}
|
||||
|
||||
close();
|
||||
}
|
||||
|
@ -23,8 +23,6 @@
|
||||
|
||||
#include "ui_GxsGroupDialog.h"
|
||||
|
||||
#include "util/TokenQueue.h"
|
||||
|
||||
/********
|
||||
* Notes:
|
||||
*
|
||||
@ -284,9 +282,6 @@ private:
|
||||
|
||||
std::list<std::string> mShareList;
|
||||
QPixmap mPicture;
|
||||
RsTokenService *mTokenService;
|
||||
TokenQueue *mExternalTokenQueue;
|
||||
TokenQueue *mInternalTokenQueue;
|
||||
RsGroupMetaData mGrpMeta;
|
||||
|
||||
Mode mMode;
|
||||
|
@ -56,8 +56,6 @@
|
||||
* #define DEBUG_CHANNEL
|
||||
***/
|
||||
|
||||
//static const int mTokenTypeGroupData = 1;
|
||||
|
||||
static const int CHANNEL_TABS_DETAILS= 0;
|
||||
static const int CHANNEL_TABS_POSTS = 1;
|
||||
static const int CHANNEL_TABS_FILES = 2;
|
||||
@ -1430,12 +1428,10 @@ public:
|
||||
explicit GxsChannelPostsReadData(bool read)
|
||||
{
|
||||
mRead = read;
|
||||
mLastToken = 0;
|
||||
}
|
||||
|
||||
public:
|
||||
bool mRead;
|
||||
uint32_t mLastToken;
|
||||
};
|
||||
|
||||
void GxsChannelPostsWidgetWithModel::setAllMessagesReadDo(bool read)
|
||||
|
Loading…
Reference in New Issue
Block a user