mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added proper timeout of 5 secs to all forum async-ed interactions
This commit is contained in:
parent
b38c635649
commit
8f9c9295b2
@ -389,7 +389,7 @@ bool p3GxsForums::createForum(RsGxsForumGroup& forum)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(waitToken(token) != RsTokenService::COMPLETE)
|
||||
if(waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE)
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed."
|
||||
<< std::endl;
|
||||
@ -416,7 +416,7 @@ bool p3GxsForums::editForum(RsGxsForumGroup& forum)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(waitToken(token) != RsTokenService::COMPLETE)
|
||||
if(waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE)
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed."
|
||||
<< std::endl;
|
||||
@ -440,7 +440,7 @@ bool p3GxsForums::getForumsSummaries(
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_META;
|
||||
if( !requestGroupInfo(token, opts)
|
||||
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
|| waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false;
|
||||
return getGroupSummary(token, forums);
|
||||
}
|
||||
|
||||
@ -452,7 +452,7 @@ bool p3GxsForums::getForumsInfo(
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA;
|
||||
if( !requestGroupInfo(token, opts, forumIds)
|
||||
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
|| waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false;
|
||||
return getGroupData(token, forumsInfo);
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ bool p3GxsForums::getForumsContent( const RsGxsGroupId& forumId, std::set<RsGxsM
|
||||
GxsMsgReq msgIds;
|
||||
msgIds[forumId] = msgs_to_request;
|
||||
|
||||
if( !requestMsgInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
if( !requestMsgInfo(token, opts, msgIds) || waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false;
|
||||
|
||||
return getMsgData(token, msgs) ;
|
||||
}
|
||||
@ -486,7 +486,7 @@ bool p3GxsForums::markRead(const RsGxsGrpMsgIdPair& msgId, bool read)
|
||||
{
|
||||
uint32_t token;
|
||||
setMessageReadStatus(token, msgId, read);
|
||||
if(waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
if(waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -522,7 +522,7 @@ bool p3GxsForums::createMessage(RsGxsForumMsg& message)
|
||||
{
|
||||
uint32_t token;
|
||||
if( !createMsg(token, message)
|
||||
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
|| waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false;
|
||||
|
||||
if(RsGenExchange::getPublishedMsgMeta(token, message.mMeta)) return true;
|
||||
|
||||
|
@ -83,6 +83,7 @@
|
||||
|
||||
// We need consts for that!! Defined in multiple places.
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
#define ROLE_THREAD_MSGID Qt::UserRole
|
||||
#define ROLE_THREAD_STATUS Qt::UserRole + 1
|
||||
#define ROLE_THREAD_MISSING Qt::UserRole + 2
|
||||
@ -94,6 +95,7 @@
|
||||
#define ROLE_THREAD_PINNED Qt::UserRole + 7
|
||||
|
||||
#define ROLE_THREAD_COUNT 4
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_FORUMS
|
||||
static std::ostream& operator<<(std::ostream& o,const QModelIndex& q)
|
||||
@ -174,7 +176,7 @@ public:
|
||||
unsigned int read_status = qvariant_cast<uint32_t>(index.data(Qt::DecorationRole));
|
||||
|
||||
bool unread = IS_MSG_UNREAD(read_status);
|
||||
bool missing = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(ROLE_THREAD_MISSING).toBool();
|
||||
bool missing = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::MissingRole).toBool();
|
||||
|
||||
// set icon
|
||||
if (missing)
|
||||
|
Loading…
Reference in New Issue
Block a user