fixed mistake that causes missing FeedItems for messages and posted

This commit is contained in:
csoler 2020-01-17 21:22:39 +01:00
parent 5df7f7667f
commit 8941a19db9
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 5 additions and 8 deletions

View File

@ -2134,8 +2134,7 @@ bool p3MsgService::receiveGxsTransMail( const RsGxsId& authorId,
{ {
RS_STACK_MUTEX(recentlyReceivedMutex); RS_STACK_MUTEX(recentlyReceivedMutex);
if( mRecentlyReceivedMessageHashes.find(hash) != if( mRecentlyReceivedMessageHashes.find(hash) != mRecentlyReceivedMessageHashes.end() )
mRecentlyReceivedMessageHashes.end() )
{ {
RsInfo() << __PRETTY_FUNCTION__ << " (II) receiving " RsInfo() << __PRETTY_FUNCTION__ << " (II) receiving "
<< "message of hash " << hash << " more than once. " << "message of hash " << hash << " more than once. "
@ -2143,14 +2142,12 @@ bool p3MsgService::receiveGxsTransMail( const RsGxsId& authorId,
<< std::endl; << std::endl;
return true; return true;
} }
mRecentlyReceivedMessageHashes[hash] = mRecentlyReceivedMessageHashes[hash] = static_cast<uint32_t>(time(nullptr));
static_cast<uint32_t>(time(nullptr));
} }
IndicateConfigChanged(); IndicateConfigChanged();
RsItem *item = _serialiser->deserialise( RsItem *item = _serialiser->deserialise( const_cast<uint8_t*>(data), &dataSize );
const_cast<uint8_t*>(data), &dataSize );
RsMsgItem *msg_item = dynamic_cast<RsMsgItem*>(item); RsMsgItem *msg_item = dynamic_cast<RsMsgItem*>(item);
if(msg_item) if(msg_item)

View File

@ -188,10 +188,10 @@ void NewsFeed::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
handleForumEvent(event); handleForumEvent(event);
if(event->mType == RsEventType::GXS_POSTED && (flags & RS_FEED_TYPE_POSTED)) if(event->mType == RsEventType::GXS_POSTED && (flags & RS_FEED_TYPE_POSTED))
handleMailEvent(event); handlePostedEvent(event);
if(event->mType == RsEventType::MAIL_STATUS_CHANGE && (flags & RS_FEED_TYPE_MSG)) if(event->mType == RsEventType::MAIL_STATUS_CHANGE && (flags & RS_FEED_TYPE_MSG))
handlePostedEvent(event); handleMailEvent(event);
} }
void NewsFeed::handleMailEvent(std::shared_ptr<const RsEvent> event) void NewsFeed::handleMailEvent(std::shared_ptr<const RsEvent> event)