mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-10 17:59:32 -04:00
Merge pull request #1838 from csoler/v0.6-FT4
Converting GxsMessageFrameWidget to blocking API, removing more TokenQueue from UI
This commit is contained in:
commit
a0816c7324
@ -217,7 +217,8 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType,
|
||||
mmr->mMsgIds[*lit] = std::set<RsGxsMessageId>();
|
||||
|
||||
req = mmr;
|
||||
}else if(reqType & GXS_REQUEST_TYPE_MSG_DATA)
|
||||
}
|
||||
else if(reqType & GXS_REQUEST_TYPE_MSG_DATA)
|
||||
{
|
||||
MsgDataReq* mdr = new MsgDataReq();
|
||||
|
||||
@ -225,7 +226,8 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType,
|
||||
mdr->mMsgIds[*lit] = std::set<RsGxsMessageId>();
|
||||
|
||||
req = mdr;
|
||||
}else if(reqType & GXS_REQUEST_TYPE_MSG_IDS)
|
||||
}
|
||||
else if(reqType & GXS_REQUEST_TYPE_MSG_IDS)
|
||||
{
|
||||
MsgIdReq* mir = new MsgIdReq();
|
||||
|
||||
|
@ -67,14 +67,6 @@ bool PgpAuxUtilsImpl::parseSignature(unsigned char *sign, unsigned int signlen,
|
||||
return AuthGPG::getAuthGPG()->parseSignature(sign,signlen,issuer);
|
||||
}
|
||||
|
||||
bool PgpAuxUtilsImpl::askForDeferredSelfSignature(const void *data,
|
||||
const uint32_t len,
|
||||
unsigned char *sign,
|
||||
unsigned int *signlen,
|
||||
int& signature_result , std::string reason)
|
||||
{
|
||||
return RsServer::notify()->askForDeferredSelfSignature(data, len, sign, signlen, signature_result, reason);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -41,10 +41,6 @@ class PgpAuxUtils
|
||||
|
||||
virtual bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const =0;
|
||||
virtual bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint) = 0;
|
||||
|
||||
/** @deprecated this method depends on retroshare-gui to work */
|
||||
RS_DEPRECATED_FOR("AuthGPG::SignDataBin")
|
||||
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string reason) = 0;
|
||||
};
|
||||
|
||||
class PgpAuxUtilsImpl: public PgpAuxUtils
|
||||
@ -59,8 +55,6 @@ public:
|
||||
virtual bool getKeyFingerprint(const RsPgpId& id,PGPFingerprintType& fp) const;
|
||||
virtual bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint);
|
||||
virtual bool getGPGAllList(std::list<RsPgpId> &ids);
|
||||
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string reason);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -293,14 +293,6 @@ bool p3Notify::askForPluginConfirmation (const std::string& plugin_filen
|
||||
|
||||
return false ;
|
||||
}
|
||||
bool p3Notify::askForDeferredSelfSignature (const void * data , const uint32_t len , unsigned char *sign, unsigned int *signlen,int& signature_result, std::string reason /*=""*/)
|
||||
{
|
||||
FOR_ALL_NOTIFY_CLIENTS
|
||||
if( (*it)->askForDeferredSelfSignature(data,len,sign,signlen,signature_result, reason))
|
||||
return true ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
void p3Notify::registerNotifyClient(NotifyClient *cl)
|
||||
{
|
||||
|
@ -114,7 +114,6 @@ class p3Notify: public RsNotify
|
||||
void notifyPeerStatusChangedSummary () ;
|
||||
void notifyDiscInfoChanged () ;
|
||||
|
||||
bool askForDeferredSelfSignature (const void * /* data */, const uint32_t /* len */, unsigned char * /* sign */, unsigned int * /* signlen */, int& signature_result , std::string reason = "") ;
|
||||
void notifyDownloadComplete (const std::string& /* fileHash */) ;
|
||||
void notifyDownloadCompleteCount (uint32_t /* count */) ;
|
||||
void notifyHistoryChanged (uint32_t /* msgId */, int /* type */) ;
|
||||
|
@ -68,12 +68,10 @@ struct RsGxsChannelGroup : RsSerializable, RsGxsGenericGroupData
|
||||
~RsGxsChannelGroup() override;
|
||||
};
|
||||
|
||||
struct RsGxsChannelPost : RsSerializable
|
||||
struct RsGxsChannelPost : RsSerializable, RsGxsGenericMsgData
|
||||
{
|
||||
RsGxsChannelPost() : mCount(0), mSize(0) {}
|
||||
|
||||
RsMsgMetaData mMeta;
|
||||
|
||||
std::set<RsGxsMessageId> mOlderVersions;
|
||||
std::string mMsg; // UTF8 encoded.
|
||||
|
||||
@ -325,7 +323,20 @@ public:
|
||||
std::vector<RsGxsChannelGroup>& channelsInfo ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Get channel contents
|
||||
* @brief Get all channel messages and comments in a given channel
|
||||
* @jsonapi{development}
|
||||
* @param[in] channelId id of the channel of which the content is requested
|
||||
* @param[out] posts storage for posts
|
||||
* @param[out] comments storage for the comments
|
||||
* @return false if something failed, true otherwhise
|
||||
*/
|
||||
virtual bool getChannelAllContent(const RsGxsGroupId& channelId,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Get channel messages and comments corresponding to the given message ID list. If the list is empty, nothing is returned. Since
|
||||
* comments are themselves messages, it is possible to get comments only by only supplying their message IDs.
|
||||
* @jsonapi{development}
|
||||
* @param[in] channelId id of the channel of which the content is requested
|
||||
* @param[in] contentsIds ids of requested contents
|
||||
@ -333,10 +344,10 @@ public:
|
||||
* @param[out] comments storage for the comments
|
||||
* @return false if something failed, true otherwhise
|
||||
*/
|
||||
virtual bool getChannelContent( const RsGxsGroupId& channelId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) = 0;
|
||||
virtual bool getChannelContent(const RsGxsGroupId& channelId,
|
||||
const std::set<RsGxsMessageId>& contentIds,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Get channel content summaries
|
||||
|
@ -40,14 +40,19 @@
|
||||
* are necessary, so at this point this workaround seems acceptable.
|
||||
*/
|
||||
|
||||
#define DEBUG_GXSIFACEHELPER 1
|
||||
|
||||
enum class TokenRequestType: uint8_t
|
||||
{
|
||||
GROUP_INFO = 0x01,
|
||||
MSG_INFO = 0x02,
|
||||
MSG_RELATED_INFO = 0x03,
|
||||
GROUP_STATISTICS = 0x04,
|
||||
SERVICE_STATISTICS = 0x05,
|
||||
NO_KILL_TYPE = 0x06,
|
||||
UNDEFINED = 0x00,
|
||||
GROUP_DATA = 0x01,
|
||||
GROUP_META = 0x02,
|
||||
POSTS = 0x03,
|
||||
ALL_POSTS = 0x04,
|
||||
MSG_RELATED_INFO = 0x05,
|
||||
GROUP_STATISTICS = 0x06,
|
||||
SERVICE_STATISTICS = 0x07,
|
||||
NO_KILL_TYPE = 0x08,
|
||||
};
|
||||
|
||||
class RsGxsIfaceHelper
|
||||
@ -248,12 +253,23 @@ public:
|
||||
/// @see RsTokenService::requestGroupInfo
|
||||
bool requestGroupInfo( uint32_t& token, const RsTokReqOptions& opts, const std::list<RsGxsGroupId> &groupIds, bool high_priority_request = false )
|
||||
{
|
||||
cancelActiveRequestTokens(TokenRequestType::GROUP_INFO);
|
||||
TokenRequestType token_request_type;
|
||||
|
||||
switch(opts.mReqType)
|
||||
{
|
||||
case GXS_REQUEST_TYPE_GROUP_DATA: token_request_type = TokenRequestType::GROUP_DATA; break;
|
||||
case GXS_REQUEST_TYPE_GROUP_META: token_request_type = TokenRequestType::GROUP_META; break;
|
||||
default:
|
||||
RsErr() << __PRETTY_FUNCTION__ << "(EE) Unexpected request type " << opts.mReqType << "!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
cancelActiveRequestTokens(token_request_type);
|
||||
|
||||
if( mTokenService.requestGroupInfo(token, 0, opts, groupIds))
|
||||
{
|
||||
RS_STACK_MUTEX(mMtx);
|
||||
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : (TokenRequestType::GROUP_INFO);
|
||||
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type;
|
||||
locked_dumpTokens();
|
||||
return true;
|
||||
}
|
||||
@ -264,12 +280,24 @@ public:
|
||||
/// @see RsTokenService::requestGroupInfo
|
||||
bool requestGroupInfo(uint32_t& token, const RsTokReqOptions& opts, bool high_priority_request = false)
|
||||
{
|
||||
cancelActiveRequestTokens(TokenRequestType::GROUP_INFO);
|
||||
TokenRequestType token_request_type;
|
||||
|
||||
switch(opts.mReqType)
|
||||
{
|
||||
case GXS_REQUEST_TYPE_GROUP_DATA: token_request_type = TokenRequestType::GROUP_DATA; break;
|
||||
case GXS_REQUEST_TYPE_GROUP_META: token_request_type = TokenRequestType::GROUP_META; break;
|
||||
default:
|
||||
RsErr() << __PRETTY_FUNCTION__ << "(EE) Unexpected request type " << opts.mReqType << "!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
cancelActiveRequestTokens(token_request_type);
|
||||
|
||||
|
||||
if( mTokenService.requestGroupInfo(token, 0, opts))
|
||||
{
|
||||
RS_STACK_MUTEX(mMtx);
|
||||
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : (TokenRequestType::GROUP_INFO);
|
||||
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type;
|
||||
locked_dumpTokens();
|
||||
return true;
|
||||
}
|
||||
@ -278,13 +306,13 @@ public:
|
||||
}
|
||||
|
||||
/// @see RsTokenService::requestMsgInfo
|
||||
bool requestMsgInfo( uint32_t& token,
|
||||
const RsTokReqOptions& opts, const GxsMsgReq& msgIds )
|
||||
bool requestMsgInfo( uint32_t& token, const RsTokReqOptions& opts, const GxsMsgReq& msgIds )
|
||||
{
|
||||
if(mTokenService.requestMsgInfo(token, 0, opts, msgIds))
|
||||
{
|
||||
RS_STACK_MUTEX(mMtx);
|
||||
mActiveTokens[token]=TokenRequestType::MSG_INFO;
|
||||
|
||||
mActiveTokens[token]= (msgIds.size()==1 && msgIds.begin()->second.size()==0) ?(TokenRequestType::ALL_POSTS):(TokenRequestType::POSTS);
|
||||
locked_dumpTokens();
|
||||
return true;
|
||||
}
|
||||
@ -298,7 +326,7 @@ public:
|
||||
if(mTokenService.requestMsgInfo(token, 0, opts, grpIds))
|
||||
{
|
||||
RS_STACK_MUTEX(mMtx);
|
||||
mActiveTokens[token]=TokenRequestType::MSG_INFO;
|
||||
mActiveTokens[token]=TokenRequestType::ALL_POSTS;
|
||||
locked_dumpTokens();
|
||||
return true;
|
||||
}
|
||||
@ -459,15 +487,15 @@ private:
|
||||
|
||||
uint32_t count[7] = {0};
|
||||
|
||||
std::cerr << "Service 0x0" << std::hex << service_id
|
||||
std::cerr << "Service " << std::hex << service_id << std::dec
|
||||
<< " (" << rsServiceControl->getServiceName(RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(service_id))
|
||||
<< ") this=0x" << (void*)this << ") Active tokens (per type): " ;
|
||||
<< ") this=" << std::hex << (void*)this << std::dec << ") Active tokens (per type): " ;
|
||||
|
||||
for(auto& it: mActiveTokens) // let's count how many token of each type we've got.
|
||||
++count[static_cast<int>(it.second)];
|
||||
|
||||
for(uint32_t i=0;i<7;++i)
|
||||
std::cerr /* << i << ":" */ << count[i] << " ";
|
||||
std::cerr << std::dec /* << i << ":" */ << count[i] << " ";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
};
|
||||
|
@ -184,6 +184,14 @@ struct RsMsgMetaData : RsSerializable
|
||||
}
|
||||
};
|
||||
|
||||
struct RsGxsGenericMsgData
|
||||
{
|
||||
virtual ~RsGxsGenericMsgData() = default; // making the type polymorphic
|
||||
|
||||
RsMsgMetaData mMeta;
|
||||
};
|
||||
|
||||
|
||||
class GxsGroupStatistic
|
||||
{
|
||||
public:
|
||||
|
@ -237,7 +237,6 @@ public:
|
||||
virtual void notifyPeerStatusChangedSummary () {}
|
||||
virtual void notifyDiscInfoChanged () {}
|
||||
|
||||
virtual bool askForDeferredSelfSignature (const void * /* data */, const uint32_t /* len */, unsigned char * /* sign */, unsigned int * /* signlen */,int& signature_result , std::string /*reason = ""*/) { signature_result = false ;return true; }
|
||||
virtual void notifyDownloadComplete (const std::string& /* fileHash */) {}
|
||||
virtual void notifyDownloadCompleteCount (uint32_t /* count */) {}
|
||||
virtual void notifyHistoryChanged (uint32_t /* msgId */, int /* type */) {}
|
||||
|
@ -46,14 +46,13 @@ struct RsPostedGroup: RsGxsGenericGroupData
|
||||
RsGxsImage mGroupImage;
|
||||
};
|
||||
|
||||
struct RsPostedPost
|
||||
struct RsPostedPost: public RsGxsGenericMsgData
|
||||
{
|
||||
RsPostedPost(): mHaveVoted(false), mUpVotes(0), mDownVotes(0), mComments(0),
|
||||
mHotScore(0), mTopScore(0), mNewScore(0) {}
|
||||
|
||||
bool calculateScores(rstime_t ref_time);
|
||||
|
||||
RsMsgMetaData mMeta;
|
||||
std::string mLink;
|
||||
std::string mNotes;
|
||||
|
||||
@ -151,6 +150,11 @@ public:
|
||||
|
||||
virtual bool getBoardsSummaries(std::list<RsGroupMetaData>& groupInfo) =0;
|
||||
|
||||
virtual bool getBoardAllContent(
|
||||
const RsGxsGroupId& boardId,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) = 0;
|
||||
|
||||
virtual bool getBoardContent(
|
||||
const RsGxsGroupId& boardId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
|
@ -1083,20 +1083,34 @@ bool p3GxsChannels::getContentSummaries(
|
||||
return res;
|
||||
}
|
||||
|
||||
bool p3GxsChannels::getChannelAllContent( const RsGxsGroupId& channelId,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
if( !requestMsgInfo(token, opts,std::list<RsGxsGroupId>({channelId})) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
|
||||
return getPostData(token, posts, comments);
|
||||
}
|
||||
|
||||
bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
const std::set<RsGxsMessageId>& contentIds,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
GxsMsgReq msgIds;
|
||||
msgIds[channelId] = contentsIds;
|
||||
msgIds[channelId] = contentIds;
|
||||
|
||||
if( !requestMsgInfo(token, opts, msgIds) ||
|
||||
waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
if( !requestMsgInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
|
||||
return getPostData(token, posts, comments);
|
||||
}
|
||||
|
@ -185,9 +185,14 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
|
||||
const std::list<RsGxsGroupId>& chanIds,
|
||||
std::vector<RsGxsChannelGroup>& channelsInfo ) override;
|
||||
|
||||
/// Implementation of @see RsGxsChannels::getChannelContent
|
||||
bool getChannelContent( const RsGxsGroupId& channelId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
/// Implementation of @see RsGxsChannels::getChannelAllMessages
|
||||
bool getChannelAllContent(const RsGxsGroupId& channelId,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) override;
|
||||
|
||||
/// Implementation of @see RsGxsChannels::getChannelMessages
|
||||
bool getChannelContent(const RsGxsGroupId& channelId,
|
||||
const std::set<RsGxsMessageId>& contentIds,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) override;
|
||||
|
||||
|
@ -3522,25 +3522,7 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(
|
||||
unsigned int sign_size = MAX_SIGN_SIZE;
|
||||
memset(signarray,0,MAX_SIGN_SIZE) ; // just in case.
|
||||
|
||||
/* -10 is never returned by askForDeferredSelfSignature therefore we can
|
||||
* use it to properly detect and handle the case libretroshare is being
|
||||
* used outside retroshare-gui */
|
||||
int result = -10;
|
||||
|
||||
/* This method is DEPRECATED we call it only for retrocompatibility with
|
||||
* retroshare-gui, when called from something different then
|
||||
* retroshare-gui for example retroshare-service it miserably fail! */
|
||||
mPgpUtils->askForDeferredSelfSignature(
|
||||
static_cast<const void*>(hash.toByteArray()),
|
||||
hash.SIZE_IN_BYTES, signarray, &sign_size, result,
|
||||
__PRETTY_FUNCTION__ );
|
||||
|
||||
/* If askForDeferredSelfSignature left result untouched it means
|
||||
* libretroshare is being used by something different then
|
||||
* retroshare-gui so try calling AuthGPG::getAuthGPG()->SignDataBin
|
||||
* directly */
|
||||
if( result == -10 )
|
||||
result = AuthGPG::getAuthGPG()->SignDataBin(
|
||||
int result = AuthGPG::getAuthGPG()->SignDataBin(
|
||||
static_cast<const void*>(hash.toByteArray()),
|
||||
hash.SIZE_IN_BYTES, signarray, &sign_size,
|
||||
__PRETTY_FUNCTION__ )
|
||||
|
@ -322,6 +322,20 @@ bool p3Posted::getBoardsInfo(
|
||||
return getGroupData(token, groupsInfo) && !groupsInfo.empty();
|
||||
}
|
||||
|
||||
bool p3Posted::getBoardAllContent( const RsGxsGroupId& groupId,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
if( !requestMsgInfo(token, opts, std::list<RsGxsGroupId>({groupId})) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
|
||||
return getPostData(token, posts, comments);
|
||||
}
|
||||
|
||||
bool p3Posted::getBoardContent( const RsGxsGroupId& groupId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
|
@ -61,6 +61,10 @@ virtual void receiveHelperChanges(std::vector<RsGxsNotify*>& changes)
|
||||
bool getBoardsInfo(const std::list<RsGxsGroupId>& boardsIds,
|
||||
std::vector<RsPostedGroup>& groupsInfo ) override;
|
||||
|
||||
bool getBoardAllContent(const RsGxsGroupId& groupId,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) override;
|
||||
|
||||
bool getBoardContent(const RsGxsGroupId& groupId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
|
@ -381,60 +381,6 @@ void IdDetailsDialog::loadIdentity()
|
||||
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void IdDetailsDialog::requestRepList()
|
||||
{
|
||||
// Removing this for the moment.
|
||||
return;
|
||||
|
||||
mStateHelper->setLoading(IDDETAILSDIALOG_REPLIST, true);
|
||||
|
||||
mIdQueue->cancelActiveRequestTokens(IDDETAILSDIALOG_REPLIST);
|
||||
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
groupIds.push_back(mId);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
uint32_t token;
|
||||
mIdQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, IDDETAILSDIALOG_REPLIST);
|
||||
}
|
||||
|
||||
void IdDetailsDialog::insertRepList(uint32_t token)
|
||||
{
|
||||
Q_UNUSED(token)
|
||||
mStateHelper->setLoading(IDDETAILSDIALOG_REPLIST, false);
|
||||
mStateHelper->setActive(IDDETAILSDIALOG_REPLIST, true);
|
||||
}
|
||||
|
||||
void IdDetailsDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
if (queue != mIdQueue) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ID_DEBUG
|
||||
std::cerr << "IdDetailsDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
switch (req.mUserType)
|
||||
{
|
||||
case IDDETAILSDIALOG_IDDETAILS:
|
||||
insertIdDetails(req.mToken);
|
||||
break;
|
||||
|
||||
case IDDETAILSDIALOG_REPLIST:
|
||||
insertRepList(req.mToken);
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cerr << "IdDetailsDialog::loadRequest() ERROR";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
QString IdDetailsDialog::inviteMessage()
|
||||
{
|
||||
|
@ -1301,8 +1301,7 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item,
|
||||
RsIdentityDetails idd ;
|
||||
rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),idd) ;
|
||||
|
||||
bool isBanned = idd.mReputation.mOverallReputationLevel ==
|
||||
RsReputationLevel::LOCALLY_NEGATIVE;
|
||||
bool isBanned = idd.mReputation.mOverallReputationLevel == RsReputationLevel::LOCALLY_NEGATIVE;
|
||||
uint32_t item_flags = 0;
|
||||
|
||||
/* do filtering */
|
||||
@ -1474,7 +1473,7 @@ void IdDialog::loadIdentities(const std::map<RsGxsGroupId,RsGxsIdGroup>& ids_set
|
||||
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
|
||||
|
||||
// Update existing and remove not existing items
|
||||
// Also remove items that do not have the correct parent
|
||||
// Also remove items that do not have the correct parent
|
||||
|
||||
QTreeWidgetItemIterator itemIterator(ui->idTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
@ -1494,6 +1493,9 @@ void IdDialog::loadIdentities(const std::map<RsGxsGroupId,RsGxsIdGroup>& ids_set
|
||||
|
||||
QTreeWidgetItem *parent_item = item->parent() ;
|
||||
|
||||
// if(it->second.mMeta.mPublishTs > time(NULL) - 20 || it->second.mMeta.mGroupId == RsGxsGroupId("3de2172503675206b3a23c997e5ee688"))
|
||||
// std::cerr << "Captured ID " <<it->second.mMeta.mGroupId << std::endl;
|
||||
|
||||
if( (parent_item == allItem && it->second.mIsAContact) || (parent_item == contactsItem && !it->second.mIsAContact))
|
||||
{
|
||||
delete item ; // do not remove from the list, so that it is added again in the correct place.
|
||||
|
@ -26,8 +26,9 @@
|
||||
#include "gui/common/UIStateHelper.h"
|
||||
#include "gui/common/AvatarDialog.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "util/misc.h"
|
||||
#include "gui/notifyqt.h"
|
||||
|
||||
#include <retroshare/rsidentity.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
@ -88,17 +89,13 @@ IdEditDialog::IdEditDialog(QWidget *parent) :
|
||||
/* Initialize ui */
|
||||
ui->lineEdit_Nickname->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
|
||||
|
||||
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
||||
ui->pushButton_Tag->setEnabled(false);
|
||||
ui->pushButton_Tag->hide(); // unfinished
|
||||
ui->plainTextEdit_Tag->hide();
|
||||
ui->label_TagCheck->hide();
|
||||
}
|
||||
|
||||
IdEditDialog::~IdEditDialog()
|
||||
{
|
||||
delete(mIdQueue);
|
||||
}
|
||||
IdEditDialog::~IdEditDialog() {}
|
||||
|
||||
void IdEditDialog::changeAvatar()
|
||||
{
|
||||
@ -199,25 +196,52 @@ void IdEditDialog::setAvatar(const QPixmap &avatar)
|
||||
}
|
||||
}
|
||||
|
||||
void IdEditDialog::setupExistingId(const RsGxsGroupId &keyId)
|
||||
void IdEditDialog::setupExistingId(const RsGxsGroupId& keyId)
|
||||
{
|
||||
setWindowTitle(tr("Edit identity"));
|
||||
ui->headerFrame->setHeaderImage(QPixmap(":/icons/png/person.png"));
|
||||
ui->headerFrame->setHeaderText(tr("Edit identity"));
|
||||
|
||||
mStateHelper->setLoading(IDEDITDIALOG_LOADID, true);
|
||||
|
||||
mIsNew = false;
|
||||
mGroupId.clear();
|
||||
|
||||
mStateHelper->setLoading(IDEDITDIALOG_LOADID, true);
|
||||
RsThread::async([this,keyId]()
|
||||
{
|
||||
std::vector<RsGxsIdGroup> datavector;
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
bool res = rsIdentity->getIdentitiesInfo(std::set<RsGxsId>({(RsGxsId)keyId}),datavector);
|
||||
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
groupIds.push_back(keyId);
|
||||
RsQThreadUtils::postToObject( [this,keyId,res,datavector]()
|
||||
{
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
* after a blocking call to RetroShare API complete, note that
|
||||
* Qt::QueuedConnection is important!
|
||||
*/
|
||||
|
||||
uint32_t token;
|
||||
mIdQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, IDEDITDIALOG_LOADID);
|
||||
mStateHelper->setLoading(IDEDITDIALOG_LOADID, false);
|
||||
|
||||
/* get details from libretroshare */
|
||||
|
||||
if (!res || datavector.size() != 1)
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << " failed to collect group info for identity " << keyId << std::endl;
|
||||
|
||||
ui->lineEdit_KeyId->setText(tr("Error KeyID invalid"));
|
||||
ui->lineEdit_Nickname->setText("");
|
||||
|
||||
ui->lineEdit_GpgHash->setText(tr("N/A"));
|
||||
ui->lineEdit_GpgId->setText(tr("N/A"));
|
||||
ui->lineEdit_GpgName->setText(tr("N/A"));
|
||||
return;
|
||||
}
|
||||
|
||||
loadExistingId(datavector[0]);
|
||||
|
||||
}, this );
|
||||
});
|
||||
}
|
||||
|
||||
void IdEditDialog::enforceNoAnonIds()
|
||||
@ -227,33 +251,9 @@ void IdEditDialog::enforceNoAnonIds()
|
||||
ui->radioButton_Pseudo->setEnabled(false);
|
||||
}
|
||||
|
||||
void IdEditDialog::loadExistingId(uint32_t token)
|
||||
void IdEditDialog::loadExistingId(const RsGxsIdGroup& id_group)
|
||||
{
|
||||
mStateHelper->setLoading(IDEDITDIALOG_LOADID, false);
|
||||
|
||||
/* get details from libretroshare */
|
||||
std::vector<RsGxsIdGroup> datavector;
|
||||
if (!rsIdentity->getGroupData(token, datavector))
|
||||
{
|
||||
ui->lineEdit_KeyId->setText(tr("Error getting key!"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (datavector.size() != 1)
|
||||
{
|
||||
std::cerr << "IdDialog::insertIdDetails() Invalid datavector size";
|
||||
std::cerr << std::endl;
|
||||
|
||||
ui->lineEdit_KeyId->setText(tr("Error KeyID invalid"));
|
||||
ui->lineEdit_Nickname->setText("");
|
||||
|
||||
ui->lineEdit_GpgHash->setText(tr("N/A"));
|
||||
ui->lineEdit_GpgId->setText(tr("N/A"));
|
||||
ui->lineEdit_GpgName->setText(tr("N/A"));
|
||||
return;
|
||||
}
|
||||
|
||||
mEditGroup = datavector[0];
|
||||
mEditGroup = id_group;
|
||||
mGroupId = mEditGroup.mMeta.mGroupId;
|
||||
|
||||
QPixmap avatar;
|
||||
@ -539,25 +539,41 @@ void IdEditDialog::createId()
|
||||
else
|
||||
params.mImage.clear();
|
||||
|
||||
uint32_t token = 0;
|
||||
rsIdentity->createIdentity(token, params);
|
||||
RsGxsId keyId;
|
||||
std::string gpg_password;
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
if(params.isPgpLinked)
|
||||
{
|
||||
std::string gpg_name = rsPeers->getGPGName(rsPeers->getGPGOwnId());
|
||||
bool cancelled;
|
||||
|
||||
mIdQueue->queueRequest(token, 0, 0, IDEDITDIALOG_CREATEID);
|
||||
}
|
||||
if(!NotifyQt::getInstance()->askForPassword(tr("Profile password needed.").toStdString(),
|
||||
gpg_name + " (" + rsPeers->getOwnId().toStdString() + ")",
|
||||
false,
|
||||
gpg_password,cancelled))
|
||||
{
|
||||
QMessageBox::critical(NULL,tr("Identity creation failed"),tr("Cannot create an identity linked to your profile without your profile password."));
|
||||
return;
|
||||
}
|
||||
|
||||
void IdEditDialog::idCreated(uint32_t token)
|
||||
{
|
||||
if (!rsIdentity->acknowledgeGrp(token, mGroupId)) {
|
||||
std::cerr << "IdDialog::idCreated() acknowledgeGrp failed";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
if(rsIdentity->createIdentity(keyId,params.nickname,params.mImage,!params.isPgpLinked,gpg_password))
|
||||
{
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
|
||||
accept();
|
||||
RsIdentityDetails det;
|
||||
|
||||
if(rsIdentity->getIdDetails(keyId,det))
|
||||
{
|
||||
QMessageBox::information(NULL,tr("Identity creation success"),tr("Your new identity was successfuly created."));
|
||||
close();
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(NULL,tr("Identity creation failed"),tr("Cannot create identity. Something went wrong."));
|
||||
}
|
||||
else
|
||||
QMessageBox::critical(NULL,tr("Identity creation failed"),tr("Cannot create identity. Something went wrong. Check your profile password."));
|
||||
}
|
||||
|
||||
void IdEditDialog::updateId()
|
||||
@ -594,24 +610,8 @@ void IdEditDialog::updateId()
|
||||
mEditGroup.mImage.clear();
|
||||
|
||||
uint32_t dummyToken = 0;
|
||||
rsIdentity->updateIdentity(dummyToken, mEditGroup);
|
||||
rsIdentity->updateIdentity(mEditGroup);
|
||||
|
||||
accept();
|
||||
}
|
||||
|
||||
void IdEditDialog::loadRequest(const TokenQueue */*queue*/, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "IdDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
|
||||
switch (req.mUserType) {
|
||||
case IDEDITDIALOG_LOADID:
|
||||
loadExistingId(req.mToken);
|
||||
break;
|
||||
|
||||
case IDEDITDIALOG_CREATEID:
|
||||
idCreated(req.mToken);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace Ui {
|
||||
class IdEditDialog;
|
||||
}
|
||||
|
||||
class IdEditDialog : public QDialog, public TokenResponse
|
||||
class IdEditDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -43,13 +43,11 @@ public:
|
||||
~IdEditDialog();
|
||||
|
||||
void setupNewId(bool pseudo, bool enable_anon = true);
|
||||
void setupExistingId(const RsGxsGroupId &keyId);
|
||||
void setupExistingId(const RsGxsGroupId& keyId);
|
||||
void enforceNoAnonIds() ;
|
||||
|
||||
RsGxsGroupId groupId() { return mGroupId; }
|
||||
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
private slots:
|
||||
void idTypeToggled(bool checked);
|
||||
void submit();
|
||||
@ -68,7 +66,7 @@ private:
|
||||
void createId();
|
||||
void updateId();
|
||||
void updateIdType(bool pseudo);
|
||||
void loadExistingId(uint32_t token);
|
||||
void loadExistingId(const RsGxsIdGroup& id_group);
|
||||
void setAvatar(const QPixmap &avatar);
|
||||
void idCreated(uint32_t token);
|
||||
|
||||
@ -83,8 +81,6 @@ protected:
|
||||
UIStateHelper *mStateHelper;
|
||||
|
||||
RsGxsIdGroup mEditGroup;
|
||||
|
||||
TokenQueue *mIdQueue;
|
||||
RsGxsGroupId mGroupId;
|
||||
|
||||
QPixmap mAvatar; // Avatar from identity (not calculated)
|
||||
|
@ -885,30 +885,17 @@ void PostedListWidget::shallowClearPosts()
|
||||
}
|
||||
}
|
||||
|
||||
bool PostedListWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData)
|
||||
bool PostedListWidget::insertGroupData(const RsGxsGenericGroupData *data)
|
||||
{
|
||||
std::vector<RsPostedGroup> groups;
|
||||
rsPosted->getGroupData(token, groups);
|
||||
|
||||
if (groups.size() == 1)
|
||||
{
|
||||
insertPostedDetails(groups[0]);
|
||||
metaData = groups[0].mMeta;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
insertPostedDetails(*dynamic_cast<const RsPostedGroup*>(data));
|
||||
return true;
|
||||
}
|
||||
|
||||
void PostedListWidget::insertAllPosts(const uint32_t &token, GxsMessageFramePostThread */*thread*/)
|
||||
void PostedListWidget::insertAllPostedPosts(const std::vector<RsPostedPost>& posts, GxsMessageFramePostThread */*thread*/)
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
rsPosted->getPostData(token, posts);
|
||||
|
||||
std::vector<RsPostedPost>::iterator vit;
|
||||
for(vit = posts.begin(); vit != posts.end(); ++vit)
|
||||
for(auto vit = posts.begin(); vit != posts.end(); ++vit)
|
||||
{
|
||||
RsPostedPost& p = *vit;
|
||||
const RsPostedPost& p = *vit;
|
||||
loadPost(p);
|
||||
loadPostCardView(p);
|
||||
}
|
||||
@ -916,15 +903,11 @@ void PostedListWidget::insertAllPosts(const uint32_t &token, GxsMessageFramePost
|
||||
applyRanking();
|
||||
}
|
||||
|
||||
void PostedListWidget::insertPosts(const uint32_t &token)
|
||||
void PostedListWidget::insertPostedPosts(const std::vector<RsPostedPost>& posts)
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
rsPosted->getPostData(token, posts);
|
||||
|
||||
std::vector<RsPostedPost>::iterator vit;
|
||||
for(vit = posts.begin(); vit != posts.end(); ++vit)
|
||||
for(auto vit = posts.begin(); vit != posts.end(); ++vit)
|
||||
{
|
||||
RsPostedPost& p = *vit;
|
||||
const RsPostedPost& p = *vit;
|
||||
|
||||
// modify post content
|
||||
if(mPosts.find(p.mMeta.mMsgId) != mPosts.end())
|
||||
@ -1047,3 +1030,62 @@ void PostedListWidget::setViewMode(int viewMode)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void PostedListWidget::getMsgData(const std::set<RsGxsMessageId>& msgIds,std::vector<RsGxsGenericMsgData*>& psts)
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
|
||||
rsPosted->getBoardContent( groupId(),msgIds,posts,comments );
|
||||
|
||||
psts.clear();
|
||||
|
||||
for(auto& post: posts)
|
||||
psts.push_back(new RsPostedPost(post));
|
||||
}
|
||||
|
||||
void PostedListWidget::getAllMsgData(std::vector<RsGxsGenericMsgData*>& psts)
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
|
||||
rsPosted->getBoardAllContent( groupId(),posts,comments );
|
||||
|
||||
psts.clear();
|
||||
|
||||
for(auto& post: posts)
|
||||
psts.push_back(new RsPostedPost(post));
|
||||
}
|
||||
|
||||
bool PostedListWidget::getGroupData(RsGxsGenericGroupData*& data)
|
||||
{
|
||||
std::vector<RsPostedGroup> groupInfo ;
|
||||
data = nullptr;
|
||||
|
||||
if(! rsPosted->getBoardsInfo(std::list<RsGxsGroupId>({groupId()}),groupInfo) || groupInfo.size() != 1)
|
||||
return false;
|
||||
|
||||
data = new RsPostedGroup(groupInfo[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
void PostedListWidget::insertPosts(const std::vector<RsGxsGenericMsgData*>& posts)
|
||||
{
|
||||
std::vector<RsPostedPost> cposts;
|
||||
|
||||
for(auto post: posts) // This is not so nice but we have somehow to convert to RsGxsChannelPost at some timer, and the cposts list is being modified in the insert method.
|
||||
cposts.push_back(*dynamic_cast<RsPostedPost*>(post));
|
||||
|
||||
insertPostedPosts(cposts);
|
||||
}
|
||||
|
||||
void PostedListWidget::insertAllPosts(const std::vector<RsGxsGenericMsgData*>& posts, GxsMessageFramePostThread *thread)
|
||||
{
|
||||
std::vector<RsPostedPost> cposts;
|
||||
|
||||
for(auto post: posts) // This is not so nice but we have somehow to convert to RsGxsChannelPost at some timer, and the cposts list is being modified in the insert method.
|
||||
cposts.push_back(*dynamic_cast<RsPostedPost*>(post));
|
||||
|
||||
insertAllPostedPosts(cposts, NULL);
|
||||
}
|
||||
|
||||
|
@ -58,15 +58,22 @@ public:
|
||||
|
||||
protected:
|
||||
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
|
||||
void insertAllPostedPosts(const std::vector<RsPostedPost>& posts, GxsMessageFramePostThread *thread) ;
|
||||
void insertPostedPosts(const std::vector<RsPostedPost>& posts);
|
||||
|
||||
/* GxsMessageFramePostWidget */
|
||||
virtual bool insertGroupData(const uint32_t &token, RsGroupMetaData &metaData);
|
||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertPosts(const uint32_t &token);
|
||||
virtual void clearPosts();
|
||||
virtual void blank();
|
||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||
|
||||
virtual void getMsgData(const std::set<RsGxsMessageId>& msgIds,std::vector<RsGxsGenericMsgData*>& posts) override;
|
||||
virtual void getAllMsgData(std::vector<RsGxsGenericMsgData*>& posts) override;
|
||||
virtual bool getGroupData(RsGxsGenericGroupData*& data) override;
|
||||
|
||||
virtual bool insertGroupData(const RsGxsGenericGroupData *data) override;
|
||||
virtual void insertPosts(const std::vector<RsGxsGenericMsgData*>& posts) override;
|
||||
virtual void insertAllPosts(const std::vector<RsGxsGenericMsgData*>& posts, GxsMessageFramePostThread *thread) override;
|
||||
|
||||
/* GxsMessageFrameWidget */
|
||||
virtual void setAllMessagesReadDo(bool read, uint32_t &token);
|
||||
|
||||
|
@ -53,7 +53,6 @@ public:
|
||||
virtual ~GxsCircleItem();
|
||||
|
||||
uint64_t uniqueIdentifier() const override;
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
|
||||
protected:
|
||||
|
@ -354,6 +354,7 @@ void GxsCommentTreeWidget::requestComments(const RsGxsGroupId& group, const std:
|
||||
service_requestComments(group,message_versions);
|
||||
}
|
||||
|
||||
|
||||
void GxsCommentTreeWidget::service_requestComments(const RsGxsGroupId& group_id,const std::set<RsGxsMessageId> & msgIds)
|
||||
{
|
||||
/* request comments */
|
||||
|
@ -39,11 +39,6 @@ GxsFeedItem::GxsFeedItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGro
|
||||
|
||||
/* load data if we can */
|
||||
mMessageId = messageId;
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
mTokenTypeMessage = nextTokenType();
|
||||
mTokenTypeComment = nextTokenType();
|
||||
#endif
|
||||
}
|
||||
|
||||
GxsFeedItem::~GxsFeedItem()
|
||||
@ -88,122 +83,14 @@ void GxsFeedItem::copyMessageLink()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void GxsFeedItem::fillDisplay(RsGxsUpdateBroadcastBase *updateBroadcastBase, bool complete)
|
||||
{
|
||||
GxsGroupFeedItem::fillDisplay(updateBroadcastBase, complete);
|
||||
|
||||
std::map<RsGxsGroupId, std::set<RsGxsMessageId> > msgs;
|
||||
updateBroadcastBase->getAllMsgIds(msgs);
|
||||
|
||||
if (!msgs.empty())
|
||||
{
|
||||
std::map<RsGxsGroupId, std::set<RsGxsMessageId> >::const_iterator mit = msgs.find(groupId());
|
||||
|
||||
if (mit != msgs.end() && mit->second.find(messageId()) != mit->second.end())
|
||||
requestMessage();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void GxsFeedItem::requestMessage()
|
||||
{
|
||||
loadMessage();
|
||||
#ifdef TO_REMOVE
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "GxsFeedItem::requestMessage()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
if (!initLoadQueue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mLoadQueue->activeRequestExist(mTokenTypeMessage)) {
|
||||
/* Request already running */
|
||||
return;
|
||||
}
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
GxsMsgReq msgIds;
|
||||
std::set<RsGxsMessageId> &vect_msgIds = msgIds[groupId()];
|
||||
vect_msgIds.insert(mMessageId);
|
||||
|
||||
uint32_t token;
|
||||
mLoadQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeMessage);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GxsFeedItem::requestComment()
|
||||
{
|
||||
loadComment();
|
||||
#ifdef TO_REMOVE
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "GxsFeedItem::requestComment()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
if (!initLoadQueue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mLoadQueue->activeRequestExist(mTokenTypeComment)) {
|
||||
/* Request already running */
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;
|
||||
opts.mOptions = RS_TOKREQOPT_MSG_THREAD | RS_TOKREQOPT_MSG_LATEST;
|
||||
|
||||
std::vector<RsGxsGrpMsgIdPair> msgIds;
|
||||
|
||||
for(int i=0;i<mmessageversions.size();++i)
|
||||
msgids.push_back(std::make_pair(groupid(),mmessageversions[i])) ;
|
||||
|
||||
msgids.push_back(std::make_pair(groupid(),messageid()));
|
||||
|
||||
uint32_t token;
|
||||
mLoadQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeComment);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void GxsFeedItem::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "GxsFeedItem::loadRequest()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
if (queue == mLoadQueue) {
|
||||
if (req.mUserType == mTokenTypeMessage) {
|
||||
loadMessage(req.mToken);
|
||||
return;
|
||||
}
|
||||
if (req.mUserType == mTokenTypeComment) {
|
||||
loadComment(req.mToken);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
GxsGroupFeedItem::loadRequest(queue, req);
|
||||
}
|
||||
|
||||
bool GxsFeedItem::isLoading()
|
||||
{
|
||||
if (GxsGroupFeedItem::isLoading()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mLoadQueue && mLoadQueue->activeRequestExist(mTokenTypeMessage)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -1009,53 +1009,3 @@ void GxsGroupDialog::loadGroup(const RsGxsGroupId& grpId)
|
||||
});
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void GxsGroupDialog::requestGroup(const RsGxsGroupId &groupId)
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
groupIds.push_back(groupId);
|
||||
|
||||
std::cerr << "GxsGroupDialog::requestGroup() Requesting Group Summary(" << groupId << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
uint32_t token;
|
||||
if (mInternalTokenQueue)
|
||||
mInternalTokenQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, GXSGROUP_INTERNAL_LOADGROUP) ;
|
||||
}
|
||||
|
||||
void GxsGroupDialog::loadGroup(uint32_t token)
|
||||
{
|
||||
std::cerr << "GxsGroupDialog::loadGroup(" << token << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
QString description;
|
||||
if (service_loadGroup(token, mMode, mGrpMeta, description))
|
||||
{
|
||||
updateFromExistingMeta(description);
|
||||
}
|
||||
}
|
||||
|
||||
void GxsGroupDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
std::cerr << "GxsGroupDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (queue == mInternalTokenQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mUserType)
|
||||
{
|
||||
case GXSGROUP_INTERNAL_LOADGROUP:
|
||||
loadGroup(req.mToken);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "GxsGroupDialog::loadGroup() UNKNOWN UserType ";
|
||||
std::cerr << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1068,99 +1068,6 @@ void GxsGroupFrameDialog::updateGroupSummary()
|
||||
});
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void GxsGroupFrameDialog::requestGroupSummary()
|
||||
{
|
||||
mStateHelper->setLoading(TOKEN_TYPE_GROUP_SUMMARY, true);
|
||||
|
||||
#ifdef DEBUG_GROUPFRAMEDIALOG
|
||||
std::cerr << "GxsGroupFrameDialog::requestGroupSummary()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mTokenQueue->cancelActiveRequestTokens(TOKEN_TYPE_GROUP_SUMMARY);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = requestGroupSummaryType();
|
||||
|
||||
uint32_t token;
|
||||
mTokenQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, TOKEN_TYPE_GROUP_SUMMARY);
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata *&/*userdata*/)
|
||||
{
|
||||
/* Default implementation for request type GXS_REQUEST_TYPE_GROUP_META */
|
||||
mInterface->getGroupSummary(token, groupInfo);
|
||||
}
|
||||
|
||||
void GxsGroupFrameDialog::loadGroupSummary(const std::list<RsGxsGenericGroupData*>& groupInfo)
|
||||
{
|
||||
#ifdef DEBUG_GROUPFRAMEDIALOG
|
||||
std::cerr << "GxsGroupFrameDialog::loadGroupSummary()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*********************** **** **** **** ***********************/
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
||||
//void GxsGroupFrameDialog::acknowledgeSubscribeChange(const uint32_t &token)
|
||||
//{
|
||||
//#ifdef DEBUG_GROUPFRAMEDIALOG
|
||||
// std::cerr << "GxsGroupFrameDialog::acknowledgeSubscribeChange()";
|
||||
// std::cerr << std::endl;
|
||||
//#endif
|
||||
|
||||
// RsGxsGroupId groupId;
|
||||
// mInterface->acknowledgeGrp(token, groupId);
|
||||
|
||||
// fillComplete();
|
||||
//}
|
||||
|
||||
/*********************** **** **** **** ***********************/
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
||||
//void GxsGroupFrameDialog::requestGroupSummary_CurrentGroup(const RsGxsGroupId &groupId)
|
||||
//{
|
||||
// RsTokReqOptions opts;
|
||||
// opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||
|
||||
// std::list<std::string> grpIds;
|
||||
// grpIds.push_back(groupId);
|
||||
|
||||
// std::cerr << "GxsGroupFrameDialog::requestGroupSummary_CurrentGroup(" << groupId << ")";
|
||||
// std::cerr << std::endl;
|
||||
|
||||
// uint32_t token;
|
||||
// mInteface->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, grpIds, TOKEN_TYPE_CURRENTGROUP);
|
||||
//}
|
||||
|
||||
//void GxsGroupFrameDialog::loadGroupSummary_CurrentGroup(const uint32_t &token)
|
||||
//{
|
||||
// std::cerr << "GxsGroupFrameDialog::loadGroupSummary_CurrentGroup()";
|
||||
// std::cerr << std::endl;
|
||||
|
||||
// std::list<RsGroupMetaData> groupInfo;
|
||||
// rsGxsForums->getGroupSummary(token, groupInfo);
|
||||
|
||||
// if (groupInfo.size() == 1)
|
||||
// {
|
||||
// RsGroupMetaData fi = groupInfo.front();
|
||||
// mSubscribeFlags = fi.mSubscribeFlags;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// resetData();
|
||||
// std::cerr << "GxsGroupFrameDialog::loadGroupSummary_CurrentGroup() ERROR Invalid Number of Groups...";
|
||||
// std::cerr << std::endl;
|
||||
// }
|
||||
|
||||
// setValid(true);
|
||||
//}
|
||||
#endif
|
||||
|
||||
/*********************** **** **** **** ***********************/
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
||||
@ -1196,60 +1103,6 @@ void GxsGroupFrameDialog::updateGroupStatistics(const RsGxsGroupId &groupId)
|
||||
});
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void GxsGroupFrameDialog::loadGroupStatistics(const uint32_t &token)
|
||||
{
|
||||
GxsGroupStatistic stats;
|
||||
mInterface->getGroupStatistic(token, stats);
|
||||
|
||||
QTreeWidgetItem *item = ui->groupTreeWidget->getItemFromId(QString::fromStdString(stats.mGrpId.toStdString()));
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
ui->groupTreeWidget->setUnreadCount(item, mCountChildMsgs ? (stats.mNumThreadMsgsUnread + stats.mNumChildMsgsUnread) : stats.mNumThreadMsgsUnread);
|
||||
|
||||
getUserNotify()->updateIcon();
|
||||
}
|
||||
|
||||
/*********************** **** **** **** ***********************/
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
||||
void GxsGroupFrameDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
#ifdef DEBUG_GROUPFRAMEDIALOG
|
||||
std::cerr << "GxsGroupFrameDialog::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
if (queue == mTokenQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mUserType)
|
||||
{
|
||||
// case TOKEN_TYPE_GROUP_SUMMARY:
|
||||
// loadGroupSummary(req.mToken);
|
||||
// break;
|
||||
|
||||
// case TOKEN_TYPE_SUBSCRIBE_CHANGE:
|
||||
// acknowledgeSubscribeChange(req.mToken);
|
||||
// break;
|
||||
|
||||
// case TOKEN_TYPE_CURRENTGROUP:
|
||||
// loadGroupSummary_CurrentGroup(req.mToken);
|
||||
// break;
|
||||
|
||||
case TOKEN_TYPE_STATISTICS:
|
||||
loadGroupStatistics(req.mToken);
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cerr << "GxsGroupFrameDialog::loadRequest() ERROR: INVALID TYPE";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
TurtleRequestId GxsGroupFrameDialog::distantSearch(const QString& search_string) // this should be overloaded in the child class
|
||||
{
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "gui/common/UIStateHelper.h"
|
||||
|
||||
#include "retroshare/rsgxsifacehelper.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
|
||||
//#define ENABLE_DEBUG 1
|
||||
|
||||
@ -98,8 +99,8 @@ void GxsMessageFramePostWidget::updateDisplay(bool complete)
|
||||
{
|
||||
if (complete) {
|
||||
/* Fill complete */
|
||||
requestGroupData();
|
||||
requestAllPosts();
|
||||
loadGroupData();
|
||||
loadAllPosts();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -162,17 +163,10 @@ void GxsMessageFramePostWidget::fillThreadFinished()
|
||||
/** Request / Response of Data ********************************/
|
||||
/**************************************************************/
|
||||
|
||||
void GxsMessageFramePostWidget::requestGroupData()
|
||||
void GxsMessageFramePostWidget::loadGroupData()
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::requestGroupData()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mSubscribeFlags = 0;
|
||||
|
||||
mTokenQueue->cancelActiveRequestTokens(mTokenTypeGroupData);
|
||||
|
||||
if (groupId().isNull()) {
|
||||
mStateHelper->setActive(mTokenTypeGroupData, false);
|
||||
mStateHelper->setLoading(mTokenTypeGroupData, false);
|
||||
@ -189,61 +183,59 @@ void GxsMessageFramePostWidget::requestGroupData()
|
||||
mStateHelper->setLoading(mTokenTypeGroupData, true);
|
||||
emit groupChanged(this);
|
||||
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
groupIds.push_back(groupId());
|
||||
RsThread::async([this]()
|
||||
{
|
||||
RsGxsGenericGroupData *data;
|
||||
getGroupData(data);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
if(!data)
|
||||
{
|
||||
std::cerr << "Cannot get group data for group " << groupId() << ". Maybe database is busy" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
RsQThreadUtils::postToObject( [data,this]()
|
||||
{
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
* after a blocking call to RetroShare API complete */
|
||||
|
||||
bool ok = insertGroupData(data);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypeGroupData, false);
|
||||
|
||||
if (ok) {
|
||||
mSubscribeFlags = data->mMeta.mSubscribeFlags;
|
||||
|
||||
mGroupName = QString::fromUtf8(data->mMeta.mGroupName.c_str());
|
||||
groupNameChanged(mGroupName);
|
||||
} else {
|
||||
std::cerr << "GxsMessageFramePostWidget::loadGroupData() ERROR Not just one Group";
|
||||
std::cerr << std::endl;
|
||||
|
||||
mStateHelper->clear(mTokenTypeGroupData);
|
||||
|
||||
mGroupName.clear();
|
||||
groupNameChanged(mGroupName);
|
||||
}
|
||||
|
||||
mStateHelper->setActive(mTokenTypeGroupData, ok);
|
||||
|
||||
emit groupChanged(this);
|
||||
|
||||
delete data;
|
||||
|
||||
}, this );
|
||||
});
|
||||
|
||||
uint32_t token;
|
||||
mTokenQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, mTokenTypeGroupData);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::loadGroupData(const uint32_t &token)
|
||||
void GxsMessageFramePostWidget::loadAllPosts()
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadGroupData()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
RsGroupMetaData metaData;
|
||||
bool ok = insertGroupData(token, metaData);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypeGroupData, false);
|
||||
|
||||
if (ok) {
|
||||
mSubscribeFlags = metaData.mSubscribeFlags;
|
||||
|
||||
mGroupName = QString::fromUtf8(metaData.mGroupName.c_str());
|
||||
groupNameChanged(mGroupName);
|
||||
} else {
|
||||
std::cerr << "GxsMessageFramePostWidget::loadGroupData() ERROR Not just one Group";
|
||||
std::cerr << std::endl;
|
||||
|
||||
mStateHelper->clear(mTokenTypeGroupData);
|
||||
|
||||
mGroupName.clear();
|
||||
groupNameChanged(mGroupName);
|
||||
}
|
||||
|
||||
mStateHelper->setActive(mTokenTypeGroupData, ok);
|
||||
|
||||
emit groupChanged(this);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::requestAllPosts()
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::requestAllPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
|
||||
/* Request all posts */
|
||||
|
||||
mTokenQueue->cancelActiveRequestTokens(mTokenTypeAllPosts);
|
||||
|
||||
if (mFillThread) {
|
||||
/* Stop current fill thread */
|
||||
GxsMessageFramePostThread *thread = mFillThread;
|
||||
@ -266,66 +258,66 @@ void GxsMessageFramePostWidget::requestAllPosts()
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, true);
|
||||
emit groupChanged(this);
|
||||
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
groupIds.push_back(groupId());
|
||||
RsThread::async([this]()
|
||||
{
|
||||
std::vector<RsGxsGenericMsgData*> posts;
|
||||
getAllMsgData(posts);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
RsQThreadUtils::postToObject( [posts,this]()
|
||||
{
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
* after a blocking call to RetroShare API complete */
|
||||
|
||||
mStateHelper->setActive(mTokenTypeAllPosts, true);
|
||||
|
||||
if (useThread()) {
|
||||
/* Create fill thread */
|
||||
mFillThread = new GxsMessageFramePostThread(posts,this);
|
||||
|
||||
// connect thread
|
||||
connect(mFillThread, SIGNAL(finished()), this, SLOT(fillThreadFinished()), Qt::BlockingQueuedConnection);
|
||||
connect(mFillThread, SIGNAL(addPost(QVariant,bool,int,int)), this, SLOT(fillThreadAddPost(QVariant,bool,int,int)), Qt::BlockingQueuedConnection);
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadAllPosts() Start fill thread" << std::endl;
|
||||
#endif
|
||||
|
||||
/* Start thread */
|
||||
mFillThread->start();
|
||||
}
|
||||
else
|
||||
{
|
||||
insertAllPosts(posts, NULL);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, false);
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull())
|
||||
{
|
||||
navigate(mNavigatePendingMsgId);
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
}
|
||||
|
||||
// don't forget to delete the posts
|
||||
|
||||
for(auto& ppost:posts)
|
||||
delete ppost;
|
||||
}
|
||||
|
||||
emit groupChanged(this);
|
||||
|
||||
}, this );
|
||||
});
|
||||
|
||||
uint32_t token;
|
||||
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, mTokenTypeAllPosts);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::loadAllPosts(const uint32_t &token)
|
||||
void GxsMessageFramePostWidget::loadPosts(const std::set<RsGxsMessageId>& msgIds)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadAllPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mStateHelper->setActive(mTokenTypeAllPosts, true);
|
||||
|
||||
if (useThread()) {
|
||||
/* Create fill thread */
|
||||
mFillThread = new GxsMessageFramePostThread(token, this);
|
||||
|
||||
// connect thread
|
||||
connect(mFillThread, SIGNAL(finished()), this, SLOT(fillThreadFinished()), Qt::BlockingQueuedConnection);
|
||||
connect(mFillThread, SIGNAL(addPost(QVariant,bool,int,int)), this, SLOT(fillThreadAddPost(QVariant,bool,int,int)), Qt::BlockingQueuedConnection);
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadAllPosts() Start fill thread" << std::endl;
|
||||
#endif
|
||||
|
||||
/* Start thread */
|
||||
mFillThread->start();
|
||||
} else {
|
||||
insertAllPosts(token, NULL);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, false);
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull()) {
|
||||
navigate(mNavigatePendingMsgId);
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
}
|
||||
}
|
||||
|
||||
emit groupChanged(this);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::requestPosts(const std::set<RsGxsMessageId> &msgIds)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::requestPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
|
||||
mTokenQueue->cancelActiveRequestTokens(mTokenTypePosts);
|
||||
|
||||
if (groupId().isNull()) {
|
||||
if (groupId().isNull())
|
||||
{
|
||||
mStateHelper->setActive(mTokenTypePosts, false);
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
mStateHelper->clear(mTokenTypePosts);
|
||||
@ -333,77 +325,53 @@ void GxsMessageFramePostWidget::requestPosts(const std::set<RsGxsMessageId> &msg
|
||||
return;
|
||||
}
|
||||
|
||||
if (msgIds.empty()) {
|
||||
if (msgIds.empty())
|
||||
return;
|
||||
}
|
||||
|
||||
mStateHelper->setLoading(mTokenTypePosts, true);
|
||||
emit groupChanged(this);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
uint32_t token;
|
||||
GxsMsgReq requestMsgIds;
|
||||
requestMsgIds[groupId()] = msgIds;
|
||||
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, requestMsgIds, mTokenTypePosts);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::loadPosts(const uint32_t &token)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mStateHelper->setActive(mTokenTypePosts, true);
|
||||
|
||||
insertPosts(token);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
emit groupChanged(this);
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull()) {
|
||||
navigate(mNavigatePendingMsgId);
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
if (queue == mTokenQueue)
|
||||
RsThread::async([this,msgIds]()
|
||||
{
|
||||
if (req.mUserType == mTokenTypeGroupData) {
|
||||
loadGroupData(req.mToken);
|
||||
return;
|
||||
}
|
||||
std::vector<RsGxsGenericMsgData*> posts;
|
||||
|
||||
if (req.mUserType == mTokenTypeAllPosts) {
|
||||
loadAllPosts(req.mToken);
|
||||
return;
|
||||
}
|
||||
getMsgData(msgIds,posts);
|
||||
|
||||
if (req.mUserType == mTokenTypePosts) {
|
||||
loadPosts(req.mToken);
|
||||
return;
|
||||
}
|
||||
}
|
||||
RsQThreadUtils::postToObject( [posts,this]()
|
||||
{
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
* after a blocking call to RetroShare API complete */
|
||||
|
||||
GxsMessageFrameWidget::loadRequest(queue, req);
|
||||
mStateHelper->setActive(mTokenTypePosts, true);
|
||||
|
||||
insertPosts(posts);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
emit groupChanged(this);
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull())
|
||||
{
|
||||
navigate(mNavigatePendingMsgId);
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
}
|
||||
|
||||
// don't forget to delete posts.
|
||||
|
||||
for(auto& post:posts)
|
||||
delete post;
|
||||
|
||||
}, this );
|
||||
});
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
/** GxsMessageFramePostThread *********************************/
|
||||
/**************************************************************/
|
||||
|
||||
GxsMessageFramePostThread::GxsMessageFramePostThread(uint32_t token, GxsMessageFramePostWidget *parent)
|
||||
: QThread(parent), mToken(token), mParent(parent)
|
||||
GxsMessageFramePostThread::GxsMessageFramePostThread(const std::vector<RsGxsGenericMsgData*>& posts,GxsMessageFramePostWidget *parent)
|
||||
: mPosts(posts),QThread(parent), mParent(parent)
|
||||
{
|
||||
mStopped = false;
|
||||
}
|
||||
@ -417,9 +385,9 @@ GxsMessageFramePostThread::~GxsMessageFramePostThread()
|
||||
|
||||
void GxsMessageFramePostThread::stop(bool waitForStop)
|
||||
{
|
||||
if (waitForStop) {
|
||||
if (waitForStop)
|
||||
disconnect();
|
||||
}
|
||||
|
||||
|
||||
mStopped = true;
|
||||
QApplication::processEvents();
|
||||
@ -435,7 +403,12 @@ void GxsMessageFramePostThread::run()
|
||||
std::cerr << "GxsMessageFramePostThread::run()" << std::endl;
|
||||
#endif
|
||||
|
||||
mParent->insertAllPosts(mToken, this);
|
||||
mParent->insertAllPosts(mPosts,this);
|
||||
|
||||
for(auto& ppost:mPosts)
|
||||
delete ppost;
|
||||
|
||||
mPosts.clear(); // dont keep deleted pointers
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostThread::run() stopped: " << (stopped() ? "yes" : "no") << std::endl;
|
||||
|
@ -40,12 +40,15 @@ public:
|
||||
/* GxsMessageFrameWidget */
|
||||
virtual void groupIdChanged();
|
||||
virtual QString groupName(bool withUnreadCount);
|
||||
// virtual QIcon groupIcon() = 0;
|
||||
virtual bool navigate(const RsGxsMessageId& msgId);
|
||||
virtual bool isLoading();
|
||||
|
||||
// These should be derived in subclasses
|
||||
virtual bool getGroupData(RsGxsGenericGroupData *& data) =0;
|
||||
virtual void getMsgData(const std::set<RsGxsMessageId>& msgIds,std::vector<RsGxsGenericMsgData*>& posts) =0;
|
||||
virtual void getAllMsgData(std::vector<RsGxsGenericMsgData*>& posts) =0;
|
||||
|
||||
/* GXS functions */
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
int subscribeFlags() { return mSubscribeFlags; }
|
||||
|
||||
@ -65,16 +68,15 @@ protected:
|
||||
|
||||
/* GXS functions */
|
||||
void requestGroupData();
|
||||
void loadGroupData(const uint32_t &token);
|
||||
virtual bool insertGroupData(const uint32_t &token, RsGroupMetaData &metaData) = 0;
|
||||
void loadGroupData();
|
||||
void loadAllPosts();
|
||||
void loadPosts(const std::set<RsGxsMessageId>& msgIds);
|
||||
|
||||
void requestAllPosts();
|
||||
void loadAllPosts(const uint32_t &token);
|
||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread) = 0;
|
||||
// In the following 3 methods, the memory ownership is kept by GxsMessageFramePostWidget
|
||||
|
||||
void requestPosts(const std::set<RsGxsMessageId> &msgIds);
|
||||
void loadPosts(const uint32_t &token);
|
||||
virtual void insertPosts(const uint32_t &token) = 0;
|
||||
virtual bool insertGroupData(const RsGxsGenericGroupData *data) =0;
|
||||
virtual void insertPosts(const std::vector<RsGxsGenericMsgData*>& posts) =0;
|
||||
virtual void insertAllPosts(const std::vector<RsGxsGenericMsgData*>& posts, GxsMessageFramePostThread *thread) =0;
|
||||
|
||||
private slots:
|
||||
void fillThreadFinished();
|
||||
@ -97,7 +99,7 @@ class GxsMessageFramePostThread : public QThread
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GxsMessageFramePostThread(uint32_t token, GxsMessageFramePostWidget *parent);
|
||||
GxsMessageFramePostThread(const std::vector<RsGxsGenericMsgData*>& posts,GxsMessageFramePostWidget *parent);
|
||||
~GxsMessageFramePostThread();
|
||||
|
||||
void run();
|
||||
@ -110,7 +112,7 @@ signals:
|
||||
void addPost(const QVariant &post, bool related, int current, int count);
|
||||
|
||||
private:
|
||||
uint32_t mToken;
|
||||
std::vector<RsGxsGenericMsgData*> mPosts;
|
||||
GxsMessageFramePostWidget *mParent;
|
||||
volatile bool mStopped;
|
||||
};
|
||||
|
@ -49,12 +49,6 @@ const std::set<RsGxsGroupId> &RsGxsUpdateBroadcastWidget::getGrpIds()
|
||||
return mBase->getGrpIds();
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
const std::set<TurtleRequestId>& RsGxsUpdateBroadcastWidget::getSearchResults()
|
||||
{
|
||||
return mBase->getSearchResults();
|
||||
}
|
||||
#endif
|
||||
const std::set<RsGxsGroupId> &RsGxsUpdateBroadcastWidget::getGrpIdsMeta()
|
||||
{
|
||||
return mBase->getGrpIdsMeta();
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "util/HandleRichText.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/rsdir.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "util/RichTextEdit.h"
|
||||
|
||||
#include <retroshare/rsfiles.h>
|
||||
@ -54,7 +55,6 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
setupUi(this);
|
||||
Settings->loadWidgetInformation(this);
|
||||
mChannelQueue = new TokenQueue(rsGxsChannels->getTokenService(), this);
|
||||
|
||||
headerFrame->setHeaderImage(QPixmap(":/icons/png/channel.png"));
|
||||
|
||||
@ -104,8 +104,6 @@ CreateGxsChannelMsg::~CreateGxsChannelMsg()
|
||||
#ifdef CHANNELS_FRAME_CATCHER
|
||||
delete fCatcher;
|
||||
#endif
|
||||
|
||||
delete(mChannelQueue);
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::contextMenu(QPoint /*point*/)
|
||||
@ -591,26 +589,10 @@ void CreateGxsChannelMsg::newChannelMsg()
|
||||
|
||||
/* request Data */
|
||||
{
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
groupIds.push_back(mChannelId);
|
||||
|
||||
std::cerr << "CreateGxsChannelMsg::newChannelMsg() Req Group Summary(" << mChannelId << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
uint32_t token;
|
||||
mChannelQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, groupIds, CREATEMSG_CHANNELINFO);
|
||||
loadChannelInfo();
|
||||
|
||||
if(!mOrigPostId.isNull())
|
||||
{
|
||||
GxsMsgReq message_ids;
|
||||
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
message_ids[mChannelId].insert(mOrigPostId);
|
||||
mChannelQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_SUMMARY, opts, message_ids, CREATEMSG_CHANNEL_POST_INFO);
|
||||
}
|
||||
loadOriginalChannelPostInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@ -746,89 +728,92 @@ void CreateGxsChannelMsg::addThumbnail()
|
||||
thumbnail_label->setPixmap(picture);
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::loadChannelPostInfo(const uint32_t &token)
|
||||
void CreateGxsChannelMsg::loadOriginalChannelPostInfo()
|
||||
{
|
||||
#ifdef DEBUG_CREATE_GXS_MSG
|
||||
std::cerr << "CreateGxsChannelMsg::loadChannelPostInfo()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
rsGxsChannels->getPostData(token, posts);
|
||||
|
||||
if (posts.size() != 1)
|
||||
RsThread::async([this]()
|
||||
{
|
||||
std::cerr << "CreateGxsChannelMsg::loadChannelPostInfo() ERROR INVALID Number of posts in request" << std::endl;
|
||||
return ;
|
||||
}
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
|
||||
// now populate the widget with the channel post data.
|
||||
const RsGxsChannelPost& post = posts[0];
|
||||
if( !rsGxsChannels->getChannelContent(mChannelId,std::set<RsGxsMessageId>({mOrigPostId}),posts,comments) || posts.size() != 1)
|
||||
{
|
||||
std::cerr << "Cannot get channel post data for channel " << mChannelId << " and post " << mOrigPostId << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if(post.mMeta.mGroupId != mChannelId || post.mMeta.mMsgId != mOrigPostId)
|
||||
{
|
||||
std::cerr << "CreateGxsChannelMsg::loadChannelPostInfo() ERROR INVALID post ID or channel ID" << std::endl;
|
||||
return ;
|
||||
}
|
||||
RsQThreadUtils::postToObject( [posts,this]()
|
||||
{
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
* after a blocking call to RetroShare API complete */
|
||||
|
||||
subjectEdit->setText(QString::fromUtf8(post.mMeta.mMsgName.c_str())) ;
|
||||
RichTextEditWidget->setText(QString::fromUtf8(post.mMsg.c_str()));
|
||||
const RsGxsChannelPost& post(posts[0]);
|
||||
|
||||
for(std::list<RsGxsFile>::const_iterator it(post.mFiles.begin());it!=post.mFiles.end();++it)
|
||||
addAttachment(it->mHash,it->mName,it->mSize,true,RsPeerId(),true);
|
||||
if(post.mMeta.mGroupId != mChannelId || post.mMeta.mMsgId != mOrigPostId)
|
||||
{
|
||||
std::cerr << "CreateGxsChannelMsg::loadChannelPostInfo() ERROR INVALID post ID or channel ID" << std::endl;
|
||||
return ;
|
||||
}
|
||||
|
||||
subjectEdit->setText(QString::fromUtf8(post.mMeta.mMsgName.c_str())) ;
|
||||
RichTextEditWidget->setText(QString::fromUtf8(post.mMsg.c_str()));
|
||||
|
||||
for(std::list<RsGxsFile>::const_iterator it(post.mFiles.begin());it!=post.mFiles.end();++it)
|
||||
addAttachment(it->mHash,it->mName,it->mSize,true,RsPeerId(),true);
|
||||
|
||||
if(post.mThumbnail.mData != NULL)
|
||||
{
|
||||
GxsIdDetails::loadPixmapFromData(post.mThumbnail.mData,post.mThumbnail.mSize,picture,GxsIdDetails::ORIGINAL);
|
||||
thumbnail_label->setPixmap(picture);
|
||||
}
|
||||
|
||||
|
||||
}, this );
|
||||
});
|
||||
|
||||
if(post.mThumbnail.mData != NULL)
|
||||
{
|
||||
GxsIdDetails::loadPixmapFromData(post.mThumbnail.mData,post.mThumbnail.mSize,picture,GxsIdDetails::ORIGINAL);
|
||||
thumbnail_label->setPixmap(picture);
|
||||
}
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::loadChannelInfo(const uint32_t &token)
|
||||
void CreateGxsChannelMsg::loadChannelInfo()
|
||||
{
|
||||
#ifdef DEBUG_CREATE_GXS_MSG
|
||||
std::cerr << "CreateGxsChannelMsg::loadChannelInfo()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
std::list<RsGroupMetaData> groupInfo;
|
||||
rsGxsChannels->getGroupSummary(token, groupInfo);
|
||||
|
||||
if (groupInfo.size() == 1)
|
||||
RsThread::async([this]()
|
||||
{
|
||||
RsGroupMetaData fi = groupInfo.front();
|
||||
saveChannelInfo(fi);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "CreateGxsChannelMsg::loadForumInfo() ERROR INVALID Number of Forums";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
std::vector<RsGxsChannelGroup> groups;
|
||||
|
||||
void CreateGxsChannelMsg::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
{
|
||||
#ifdef DEBUG_CREATE_GXS_MSG
|
||||
std::cerr << "CreateGxsChannelMsg::loadRequest() UserType: " << req.mUserType;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
if( !rsGxsChannels->getChannelsInfo(std::list<RsGxsGroupId>({mChannelId}),groups) || groups.size() != 1)
|
||||
{
|
||||
std::cerr << "Cannot get channel group data for channel " << mChannelId << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (queue == mChannelQueue)
|
||||
{
|
||||
/* now switch on req */
|
||||
switch(req.mUserType)
|
||||
RsQThreadUtils::postToObject( [groups,this]()
|
||||
{
|
||||
case CREATEMSG_CHANNELINFO:
|
||||
loadChannelInfo(req.mToken);
|
||||
break;
|
||||
case CREATEMSG_CHANNEL_POST_INFO:
|
||||
loadChannelPostInfo(req.mToken);
|
||||
break;
|
||||
default:
|
||||
std::cerr << "CreateGxsChannelMsg::loadRequest() UNKNOWN UserType ";
|
||||
/* Here it goes any code you want to be executed on the Qt Gui
|
||||
* thread, for example to update the data model with new information
|
||||
* after a blocking call to RetroShare API complete */
|
||||
|
||||
if (groups.size() == 1)
|
||||
{
|
||||
const RsGroupMetaData& fi = groups.front().mMeta;
|
||||
saveChannelInfo(fi);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "CreateGxsChannelMsg::loadForumInfo() ERROR INVALID Number of Forums";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}, this );
|
||||
});
|
||||
}
|
||||
|
||||
void CreateGxsChannelMsg::on_channelpostButton_clicked()
|
||||
|
@ -22,7 +22,6 @@
|
||||
#define _CREATE_GXSCHANNEL_MSG_H
|
||||
|
||||
#include "ui_CreateGxsChannelMsg.h"
|
||||
#include "util/TokenQueue.h"
|
||||
#include <retroshare/rsgxschannels.h>
|
||||
|
||||
#ifdef CHANNELS_FRAME_CATCHER
|
||||
@ -31,7 +30,7 @@
|
||||
|
||||
class SubFileItem;
|
||||
|
||||
class CreateGxsChannelMsg : public QDialog, public TokenResponse, private Ui::CreateGxsChannelMsg
|
||||
class CreateGxsChannelMsg : public QDialog, private Ui::CreateGxsChannelMsg
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -51,9 +50,6 @@ public:
|
||||
|
||||
QPixmap picture;
|
||||
|
||||
// overload from TokenResponse
|
||||
virtual void loadRequest(const TokenQueue*, const TokenRequest&);
|
||||
|
||||
protected:
|
||||
virtual void dragEnterEvent(QDragEnterEvent *event);
|
||||
virtual void dropEvent(QDropEvent *event);
|
||||
@ -74,8 +70,8 @@ private slots:
|
||||
void on_channelpostButton_clicked();
|
||||
void on_attachmentsButton_clicked();
|
||||
private:
|
||||
void loadChannelInfo(const uint32_t &token);
|
||||
void loadChannelPostInfo(const uint32_t &token);
|
||||
void loadChannelInfo();
|
||||
void loadOriginalChannelPostInfo();
|
||||
void saveChannelInfo(const RsGroupMetaData &group);
|
||||
|
||||
void parseRsFileListAttachments(const std::string &attachList);
|
||||
@ -93,8 +89,6 @@ private:
|
||||
bool mCheckAttachment;
|
||||
bool mAutoMediaThumbNail;
|
||||
|
||||
TokenQueue *mChannelQueue;
|
||||
|
||||
#ifdef CHANNELS_FRAME_CATCHER
|
||||
framecatcher* fCatcher;
|
||||
#endif
|
||||
|
@ -366,34 +366,6 @@ bool GxsChannelDialog::getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void GxsChannelDialog::loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata *&userdata)
|
||||
{
|
||||
std::vector<RsGxsChannelGroup> groups;
|
||||
rsGxsChannels->getGroupData(token, groups);
|
||||
|
||||
/* Save groups to fill icons and description */
|
||||
GxsChannelGroupInfoData *channelData = new GxsChannelGroupInfoData;
|
||||
userdata = channelData;
|
||||
|
||||
std::vector<RsGxsChannelGroup>::iterator groupIt;
|
||||
for (groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) {
|
||||
RsGxsChannelGroup &group = *groupIt;
|
||||
groupInfo.push_back(group.mMeta);
|
||||
|
||||
if (group.mImage.mData != NULL) {
|
||||
QPixmap image;
|
||||
GxsIdDetails::loadPixmapFromData(group.mImage.mData, group.mImage.mSize, image,GxsIdDetails::ORIGINAL);
|
||||
channelData->mIcon[group.mMeta.mGroupId] = image;
|
||||
}
|
||||
|
||||
if (!group.mDescription.empty()) {
|
||||
channelData->mDescription[group.mMeta.mGroupId] = QString::fromUtf8(group.mDescription.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void GxsChannelDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo)
|
||||
{
|
||||
GxsGroupFrameDialog::groupInfoToGroupItemInfo(groupData, groupItemInfo);
|
||||
|
@ -148,7 +148,7 @@ void GxsChannelPostsWidget::handleEvent_main_thread(std::shared_ptr<const RsEven
|
||||
case RsChannelEventCode::NEW_CHANNEL:
|
||||
case RsChannelEventCode::UPDATED_MESSAGE:
|
||||
case RsChannelEventCode::NEW_MESSAGE:
|
||||
if(e->mChannelGroupId == mChannelGroupId)
|
||||
if(e->mChannelGroupId == groupId())
|
||||
updateDisplay(true);
|
||||
break;
|
||||
default:
|
||||
@ -506,7 +506,7 @@ void GxsChannelPostsWidget::fillThreadCreatePost(const QVariant &post, bool rela
|
||||
createPostItem(post.value<RsGxsChannelPost>(), related);
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::insertChannelPosts(std::vector<RsGxsChannelPost> &posts, GxsMessageFramePostThread *thread, bool related)
|
||||
void GxsChannelPostsWidget::insertChannelPosts(std::vector<RsGxsChannelPost>& posts, GxsMessageFramePostThread *thread, bool related)
|
||||
{
|
||||
if (related && thread) {
|
||||
std::cerr << "GxsChannelPostsWidget::insertChannelPosts fill only related posts as thread is not possible" << std::endl;
|
||||
@ -734,26 +734,56 @@ void GxsChannelPostsWidget::toggleAutoDownload()
|
||||
});
|
||||
}
|
||||
|
||||
bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData)
|
||||
bool GxsChannelPostsWidget::insertGroupData(const RsGxsGenericGroupData *data)
|
||||
{
|
||||
std::vector<RsGxsChannelGroup> groups;
|
||||
rsGxsChannels->getGroupData(token, groups);
|
||||
insertChannelDetails(*dynamic_cast<const RsGxsChannelGroup*>(data));
|
||||
return true;
|
||||
|
||||
if(groups.size() == 1)
|
||||
{
|
||||
insertChannelDetails(groups[0]);
|
||||
metaData = groups[0].mMeta;
|
||||
mChannelGroupId = groups[0].mMeta.mGroupId;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::getMsgData(const std::set<RsGxsMessageId>& msgIds,std::vector<RsGxsGenericMsgData*>& psts)
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
|
||||
rsGxsChannels->getChannelContent( groupId(),msgIds,posts,comments );
|
||||
|
||||
psts.clear();
|
||||
|
||||
for(auto& post: posts)
|
||||
psts.push_back(new RsGxsChannelPost(post));
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::getAllMsgData(std::vector<RsGxsGenericMsgData*>& psts)
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
|
||||
rsGxsChannels->getChannelAllContent( groupId(),posts,comments );
|
||||
|
||||
psts.clear();
|
||||
|
||||
for(auto& post: posts)
|
||||
psts.push_back(new RsGxsChannelPost(post));
|
||||
}
|
||||
|
||||
bool GxsChannelPostsWidget::getGroupData(RsGxsGenericGroupData *& data)
|
||||
{
|
||||
std::vector<RsGxsChannelGroup> groups;
|
||||
|
||||
if(rsGxsChannels->getChannelsInfo(std::list<RsGxsGroupId>({groupId()}),groups) && groups.size()==1)
|
||||
{
|
||||
data = new RsGxsChannelGroup(groups[0]);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
RsGxsChannelGroup distant_group;
|
||||
|
||||
if(rsGxsChannels->retrieveDistantGroup(groupId(),distant_group))
|
||||
{
|
||||
insertChannelDetails(distant_group);
|
||||
metaData = distant_group.mMeta;
|
||||
mChannelGroupId = distant_group.mMeta.mGroupId;
|
||||
data = new RsGxsChannelGroup(distant_group);
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
@ -761,20 +791,23 @@ bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaDa
|
||||
return false;
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread)
|
||||
void GxsChannelPostsWidget::insertAllPosts(const std::vector<RsGxsGenericMsgData*>& posts, GxsMessageFramePostThread *thread)
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
rsGxsChannels->getPostData(token, posts);
|
||||
std::vector<RsGxsChannelPost> cposts;
|
||||
|
||||
insertChannelPosts(posts, thread, false);
|
||||
for(auto post: posts) // This is not so nice but we have somehow to convert to RsGxsChannelPost at some timer, and the cposts list is being modified in the insert method.
|
||||
cposts.push_back(*static_cast<RsGxsChannelPost*>(post));
|
||||
|
||||
insertChannelPosts(cposts, thread, false);
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::insertPosts(const uint32_t &token)
|
||||
void GxsChannelPostsWidget::insertPosts(const std::vector<RsGxsGenericMsgData*>& posts)
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
rsGxsChannels->getPostData(token, posts);
|
||||
std::vector<RsGxsChannelPost> cposts;
|
||||
|
||||
insertChannelPosts(posts, NULL, true);
|
||||
for(auto post: posts) // This is not so nice but we have somehow to convert to RsGxsChannelPost at some timer, and the cposts list is being modified in the insert method.
|
||||
cposts.push_back(*static_cast<RsGxsChannelPost*>(post));
|
||||
|
||||
insertChannelPosts(cposts, NULL, true);
|
||||
}
|
||||
|
||||
class GxsChannelPostsReadData
|
||||
|
@ -65,15 +65,19 @@ public:
|
||||
protected:
|
||||
/* GxsMessageFramePostWidget */
|
||||
virtual void groupNameChanged(const QString &name);
|
||||
virtual bool insertGroupData(const uint32_t &token, RsGroupMetaData &metaData);
|
||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertPosts(const uint32_t &token);
|
||||
virtual bool insertGroupData(const RsGxsGenericGroupData *data) override;
|
||||
virtual void clearPosts();
|
||||
virtual bool useThread() { return mUseThread; }
|
||||
virtual void fillThreadCreatePost(const QVariant &post, bool related, int current, int count);
|
||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||
virtual void blank() ;
|
||||
|
||||
virtual bool getGroupData(RsGxsGenericGroupData *& data) override;
|
||||
virtual void getMsgData(const std::set<RsGxsMessageId>& msgIds,std::vector<RsGxsGenericMsgData*>& posts) override;
|
||||
virtual void getAllMsgData(std::vector<RsGxsGenericMsgData*>& posts) override;
|
||||
virtual void insertPosts(const std::vector<RsGxsGenericMsgData*>& posts) override;
|
||||
virtual void insertAllPosts(const std::vector<RsGxsGenericMsgData*>& posts, GxsMessageFramePostThread *thread) override;
|
||||
|
||||
/* GxsMessageFrameWidget */
|
||||
virtual void setAllMessagesReadDo(bool read, uint32_t &token);
|
||||
|
||||
@ -103,7 +107,6 @@ private:
|
||||
QAction *mAutoDownloadAction;
|
||||
|
||||
bool mUseThread;
|
||||
RsGxsGroupId mChannelGroupId;
|
||||
RsEventsHandlerId_t mEventHandlerId ;
|
||||
|
||||
/* UI - from Designer */
|
||||
|
@ -207,28 +207,6 @@ GxsMessageFrameWidget *GxsForumsDialog::createMessageFrameWidget(const RsGxsGrou
|
||||
return new GxsForumThreadWidget(groupId);
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void GxsForumsDialog::loadGroupSummaryToken(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo, RsUserdata *&userdata)
|
||||
{
|
||||
std::vector<RsGxsForumGroup> groups;
|
||||
rsGxsForums->getGroupData(token, groups);
|
||||
|
||||
/* Save groups to fill description */
|
||||
GxsForumGroupInfoData *forumData = new GxsForumGroupInfoData;
|
||||
userdata = forumData;
|
||||
|
||||
std::vector<RsGxsForumGroup>::iterator groupIt;
|
||||
for (groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) {
|
||||
RsGxsForumGroup &group = *groupIt;
|
||||
groupInfo.push_back(group.mMeta);
|
||||
|
||||
if (!group.mDescription.empty()) {
|
||||
forumData->mDescription[group.mMeta.mGroupId] = QString::fromUtf8(group.mDescription.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void GxsForumsDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupData, GroupItemInfo &groupItemInfo)
|
||||
{
|
||||
GxsGroupFrameDialog::groupInfoToGroupItemInfo(groupData, groupItemInfo);
|
||||
@ -249,27 +227,3 @@ void GxsForumsDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *grou
|
||||
groupItemInfo.icon = QIcon(":icons/png/forums-signed.png");
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void ::groupInfoToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo, const RsUserdata *userdata)
|
||||
{
|
||||
GxsGroupFrameDialog::groupInfoToGroupItemInfo(groupInfo, groupItemInfo, userdata);
|
||||
|
||||
const GxsForumGroupInfoData *forumData = dynamic_cast<const GxsForumGroupInfoData*>(userdata);
|
||||
if (!forumData) {
|
||||
std::cerr << "GxsForumsDialog::groupInfoToGroupItemInfo() Failed to cast data to GxsForumGroupInfoData";
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
QMap<RsGxsGroupId, QString>::const_iterator descriptionIt = forumData->mDescription.find(groupInfo.mGroupId);
|
||||
if (descriptionIt != forumData->mDescription.end()) {
|
||||
groupItemInfo.description = descriptionIt.value();
|
||||
}
|
||||
|
||||
//if (IS_GROUP_ADMIN(groupInfo.mSubscribeFlags))
|
||||
// groupItemInfo.icon = QIcon(":images/konv_message2.png");
|
||||
if ((IS_GROUP_PGP_AUTHED(groupInfo.mSignFlags)) || (IS_GROUP_MESSAGE_TRACKING(groupInfo.mSignFlags)) )
|
||||
groupItemInfo.icon = QIcon(":icons/png/forums-signed.png");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -199,51 +199,6 @@ class SignatureEventData
|
||||
std::string reason ;
|
||||
};
|
||||
|
||||
bool NotifyQt::askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string reason /*=""*/)
|
||||
{
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
|
||||
std::cerr << "NotifyQt:: deferred signature event requeted. " << std::endl;
|
||||
|
||||
// Look into the queue
|
||||
|
||||
Sha1CheckSum chksum = RsDirUtil::sha1sum((uint8_t*)data,len) ;
|
||||
|
||||
std::map<std::string,SignatureEventData*>::iterator it = _deferred_signature_queue.find(chksum.toStdString()) ;
|
||||
signature_result = SELF_SIGNATURE_RESULT_PENDING ;
|
||||
|
||||
if(it != _deferred_signature_queue.end())
|
||||
{
|
||||
signature_result = it->second->signature_result ;
|
||||
|
||||
if(it->second->signature_result != SELF_SIGNATURE_RESULT_PENDING) // found it. Copy the result, and remove from the queue.
|
||||
{
|
||||
// We should check for the exact data match, for the sake of being totally secure.
|
||||
//
|
||||
std::cerr << "Found into queue: returning it" << std::endl;
|
||||
|
||||
memcpy(sign,it->second->sign,*it->second->signlen) ;
|
||||
*signlen = *(it->second->signlen) ;
|
||||
|
||||
delete it->second ;
|
||||
_deferred_signature_queue.erase(it) ;
|
||||
}
|
||||
return true ; // already registered, but not done yet.
|
||||
}
|
||||
|
||||
// Not found. Store in the queue and emit a signal.
|
||||
//
|
||||
std::cerr << "NotifyQt:: deferred signature event requeted. Pushing into queue" << std::endl;
|
||||
|
||||
SignatureEventData *edta = new SignatureEventData(data,len,*signlen, reason) ;
|
||||
|
||||
_deferred_signature_queue[chksum.toStdString()] = edta ;
|
||||
}
|
||||
emit deferredSignatureHandlingRequested() ;
|
||||
return true;
|
||||
}
|
||||
|
||||
void NotifyQt::handleSignatureEvent()
|
||||
{
|
||||
std::cerr << "NotifyQt:: performing a deferred signature in the main GUI thread." << std::endl;
|
||||
@ -349,36 +304,6 @@ void NotifyQt::notifyDiscInfoChanged()
|
||||
emit discInfoChanged() ;
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void NotifyQt::notifyDownloadComplete(const std::string& fileHash)
|
||||
{
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
if(!_enabled)
|
||||
return ;
|
||||
}
|
||||
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::cerr << "Notifyqt::notifyDownloadComplete notified that a download is completed" << std::endl;
|
||||
#endif
|
||||
|
||||
emit downloadComplete(QString::fromStdString(fileHash));
|
||||
}
|
||||
|
||||
void NotifyQt::notifyDownloadCompleteCount(uint32_t count)
|
||||
{
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
if(!_enabled)
|
||||
return ;
|
||||
}
|
||||
|
||||
std::cerr << "Notifyqt::notifyDownloadCompleteCount " << count << std::endl;
|
||||
|
||||
emit downloadCompleteCountChanged(count);
|
||||
}
|
||||
#endif
|
||||
|
||||
void NotifyQt::notifyDiskFull(uint32_t loc,uint32_t size_in_mb)
|
||||
{
|
||||
{
|
||||
@ -424,23 +349,6 @@ void NotifyQt::notifyPeerStatusChangedSummary()
|
||||
emit peerStatusChangedSummary();
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void NotifyQt::notifyGxsChange(const RsGxsChanges& changes)
|
||||
{
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
if(!_enabled)
|
||||
return ;
|
||||
}
|
||||
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::cerr << "Notifyqt:: notified that gxs has changes" << std::endl;
|
||||
#endif
|
||||
|
||||
emit gxsChange(changes);
|
||||
}
|
||||
#endif
|
||||
|
||||
void NotifyQt::notifyOwnStatusMessageChanged()
|
||||
{
|
||||
{
|
||||
@ -584,35 +492,6 @@ void NotifyQt::notifyTurtleSearchResult(const RsPeerId& pid,uint32_t search_id,c
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void NotifyQt::notifyHashingInfo(uint32_t type, const std::string& fileinfo)
|
||||
{
|
||||
QString info;
|
||||
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
if(!_enabled)
|
||||
return ;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case NOTIFY_HASHTYPE_EXAMINING_FILES:
|
||||
info = tr("Examining shared files...");
|
||||
break;
|
||||
case NOTIFY_HASHTYPE_FINISH:
|
||||
break;
|
||||
case NOTIFY_HASHTYPE_HASH_FILE:
|
||||
info = tr("Hashing file") + " " + QString::fromUtf8(fileinfo.c_str());
|
||||
break;
|
||||
case NOTIFY_HASHTYPE_SAVE_FILE_INDEX:
|
||||
info = tr("Saving file index...");
|
||||
break;
|
||||
}
|
||||
|
||||
emit hashingInfoChanged(info);
|
||||
}
|
||||
#endif
|
||||
|
||||
void NotifyQt::notifyHistoryChanged(uint32_t msgId, int type)
|
||||
{
|
||||
{
|
||||
@ -780,19 +659,6 @@ void NotifyQt::notifyListPreChange(int list, int /*type*/)
|
||||
return;
|
||||
}
|
||||
|
||||
/* New Timer Based Update scheme ...
|
||||
* means correct thread seperation
|
||||
*
|
||||
* uses Flags, to detect changes
|
||||
*/
|
||||
|
||||
void NotifyQt::resetCachedPassphrases()
|
||||
{
|
||||
std::cerr << "Clearing PGP passphrase." << std::endl;
|
||||
|
||||
rsNotify->clearPgpPassphrase() ;
|
||||
}
|
||||
|
||||
void NotifyQt::enable()
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
|
@ -67,9 +67,6 @@ class NotifyQt: public QObject, public NotifyClient
|
||||
virtual void notifyChatStatus(const ChatId &chat_id,const std::string& status_string);
|
||||
virtual void notifyChatCleared(const ChatId &chat_id);
|
||||
virtual void notifyCustomState(const std::string& peer_id, const std::string& status_string);
|
||||
#ifdef TO_REMOVE
|
||||
virtual void notifyHashingInfo(uint32_t type, const std::string& fileinfo);
|
||||
#endif
|
||||
virtual void notifyTurtleSearchResult(const RsPeerId &pid, uint32_t search_id, const std::list<TurtleFileInfo>& found_files);
|
||||
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleGxsInfo>& found_groups);
|
||||
virtual void notifyPeerHasNewAvatar(std::string peer_id) ;
|
||||
@ -87,27 +84,9 @@ class NotifyQt: public QObject, public NotifyClient
|
||||
virtual void notifyHistoryChanged(uint32_t msgId, int type);
|
||||
|
||||
virtual void notifyDiscInfoChanged() ;
|
||||
#ifdef TO_REMOVE
|
||||
virtual void notifyDownloadComplete(const std::string& fileHash);
|
||||
virtual void notifyDownloadCompleteCount(uint32_t count);
|
||||
#endif
|
||||
virtual bool askForPassword(const std::string& title, const std::string& key_details, bool prev_is_bad, std::string& password, bool &cancelled);
|
||||
virtual bool askForPluginConfirmation(const std::string& plugin_filename, const std::string& plugin_file_hash,bool first_time);
|
||||
|
||||
// Queues the signature event so that it canhappen in the main GUI thread (to ask for passwd).
|
||||
// To use this function: call is multiple times as soon as it returns true.
|
||||
//
|
||||
// Dont' use a while, if you're in a mutexed part, otherwize it will lock. You need to call the function
|
||||
// and periodically exit the locked code between calls to allow the signature to happen.
|
||||
//
|
||||
// Returns:
|
||||
// false = the signature is registered, but the result is not there yet. Call again soon.
|
||||
// true = signature done. Data is ready. signature_result takes the following values:
|
||||
// 1: signature success
|
||||
// 2: signature failed. Wrong passwd, user pressed cancel, etc.
|
||||
//
|
||||
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen, int& signature_result, std::string reason = "") ;
|
||||
|
||||
/* Notify from GUI */
|
||||
void notifyChatFontChanged();
|
||||
void notifyChatStyleChanged(int /*ChatStyle::enumStyleType*/ styleType);
|
||||
@ -132,10 +111,6 @@ class NotifyQt: public QObject, public NotifyClient
|
||||
void neighboursChanged() const ;
|
||||
void messagesChanged() const ;
|
||||
void messagesTagsChanged() const;
|
||||
#ifdef REMOVE
|
||||
void forumsChanged() const ; // use connect with Qt::QueuedConnection
|
||||
void channelsChanged(int type) const ; // use connect with Qt::QueuedConnection
|
||||
#endif
|
||||
void configChanged() const ;
|
||||
void logInfoChanged(const QString&) const ;
|
||||
void chatStatusChanged(const ChatId&,const QString&) const ;
|
||||
@ -150,17 +125,9 @@ class NotifyQt: public QObject, public NotifyClient
|
||||
void peerStatusChanged(const QString& /* peer_id */, int /* status */);
|
||||
void peerStatusChangedSummary() const;
|
||||
void gxsChange(const RsGxsChanges& /* changes */);
|
||||
#ifdef REMOVE
|
||||
void publicChatChanged(int type) const ;
|
||||
void privateChatChanged(int list, int type) const ;
|
||||
#endif
|
||||
void chatMessageReceived(ChatMessage msg);
|
||||
void groupsChanged(int type) const ;
|
||||
void discInfoChanged() const ;
|
||||
#ifdef REMOVE
|
||||
void forumMsgReadSatusChanged(const QString& forumId, const QString& msgId, int status);
|
||||
void channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int status);
|
||||
#endif
|
||||
void historyChanged(uint msgId, int type);
|
||||
void chatLobbyInviteReceived() ;
|
||||
void deferredSignatureHandlingRequested() ;
|
||||
@ -176,7 +143,6 @@ class NotifyQt: public QObject, public NotifyClient
|
||||
public slots:
|
||||
void UpdateGUI(); /* called by timer */
|
||||
void SetDisableAll(bool bValue);
|
||||
void resetCachedPassphrases() ;
|
||||
|
||||
private slots:
|
||||
void runningTick();
|
||||
|
@ -580,11 +580,6 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
||||
#endif
|
||||
#endif // RS_JSONAPI
|
||||
|
||||
// This is done using a timer, because the passphrase request from notify is asynchrouneous and therefore clearing the
|
||||
// passphrase here makes it request for a passphrase when creating the default chat identity.
|
||||
|
||||
QTimer::singleShot(10000, notify, SLOT(resetCachedPassphrases())) ;
|
||||
|
||||
/* dive into the endless loop */
|
||||
int ti = rshare.exec();
|
||||
delete w ;
|
||||
|
@ -164,15 +164,6 @@ bool rs_nxs_test::RsDummyPgpUtils::VerifySignBin(const void* /*data*/,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rs_nxs_test::RsDummyPgpUtils::askForDeferredSelfSignature(const void* /*data*/,
|
||||
const uint32_t /*len*/,
|
||||
unsigned char* /*sign*/,
|
||||
unsigned int* /*signlen*/,
|
||||
int& /*signature_result*/,
|
||||
std::string /*reason*/
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -170,7 +170,6 @@ namespace rs_nxs_test
|
||||
|
||||
bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const;
|
||||
bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint);
|
||||
bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen, int& signature_result , std::string reason = "");
|
||||
|
||||
|
||||
private:
|
||||
|
@ -101,13 +101,4 @@ bool FakePgpAuxUtils::getGPGAllList(std::list<RsPgpId> &ids)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FakePgpAuxUtils::askForDeferredSelfSignature(const void* /*data*/, const uint32_t /*len*/, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string /*reason = ""*/ )
|
||||
{
|
||||
for(unsigned int i = 0; i < *signlen; i++)
|
||||
{
|
||||
sign[i] = 0;
|
||||
}
|
||||
signature_result = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@ public:
|
||||
|
||||
virtual bool parseSignature(unsigned char *sign, unsigned int signlen, RsPgpId& issuer) const;
|
||||
virtual bool VerifySignBin(const void *data, uint32_t len, unsigned char *sign, unsigned int signlen, const PGPFingerprintType& withfingerprint);
|
||||
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen, int& signature_result , std::string reason);
|
||||
|
||||
virtual void addPeerListToPgpList(const std::list<RsPeerId> &ids);
|
||||
virtual void addPeerIdToPgpList(const RsPeerId &id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user