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

@ -24,7 +24,6 @@
#include <retroshare-gui/mainpage.h> #include <retroshare-gui/mainpage.h>
#include "gui/feeds/FeedHolder.h" #include "gui/feeds/FeedHolder.h"
#include "util/TokenQueue.h"
#include <retroshare-gui/RsAutoUpdatePage.h> #include <retroshare-gui/RsAutoUpdatePage.h>
#define IMAGE_NEWSFEED ":/icons/png/newsfeed.png" #define IMAGE_NEWSFEED ":/icons/png/newsfeed.png"

View File

@ -1213,48 +1213,3 @@ void PostedListWidgetWithModel::voteMsg(RsGxsGrpMsgIdPair msg,bool up_or_down)
updateDisplay(true); 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

View File

@ -24,8 +24,6 @@
#include <retroshare/rsgxscircles.h> #include <retroshare/rsgxscircles.h>
#include "FeedItem.h" #include "FeedItem.h"
#include "util/TokenQueue.h"
namespace Ui { namespace Ui {
class GxsCircleItem; class GxsCircleItem;
} }

View File

@ -672,15 +672,9 @@ void GxsGroupDialog::createGroup()
if (service_createGroup(meta)) if (service_createGroup(meta))
{ {
// now update the UI
#warning Missing code here! #warning Missing code here!
#ifdef TODO // now update the UI
// }
// 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
}
close(); close();
} }

View File

@ -23,8 +23,6 @@
#include "ui_GxsGroupDialog.h" #include "ui_GxsGroupDialog.h"
#include "util/TokenQueue.h"
/******** /********
* Notes: * Notes:
* *
@ -284,9 +282,6 @@ private:
std::list<std::string> mShareList; std::list<std::string> mShareList;
QPixmap mPicture; QPixmap mPicture;
RsTokenService *mTokenService;
TokenQueue *mExternalTokenQueue;
TokenQueue *mInternalTokenQueue;
RsGroupMetaData mGrpMeta; RsGroupMetaData mGrpMeta;
Mode mMode; Mode mMode;

View File

@ -56,8 +56,6 @@
* #define DEBUG_CHANNEL * #define DEBUG_CHANNEL
***/ ***/
//static const int mTokenTypeGroupData = 1;
static const int CHANNEL_TABS_DETAILS= 0; static const int CHANNEL_TABS_DETAILS= 0;
static const int CHANNEL_TABS_POSTS = 1; static const int CHANNEL_TABS_POSTS = 1;
static const int CHANNEL_TABS_FILES = 2; static const int CHANNEL_TABS_FILES = 2;
@ -1430,12 +1428,10 @@ public:
explicit GxsChannelPostsReadData(bool read) explicit GxsChannelPostsReadData(bool read)
{ {
mRead = read; mRead = read;
mLastToken = 0;
} }
public: public:
bool mRead; bool mRead;
uint32_t mLastToken;
}; };
void GxsChannelPostsWidgetWithModel::setAllMessagesReadDo(bool read) void GxsChannelPostsWidgetWithModel::setAllMessagesReadDo(bool read)