mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
avoid calling rsGxsChannels::setMessageReadStatus() when the message status is already what we want. Removed one warning that has been cleared.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7964 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ab9cb2b600
commit
7178285d60
4 changed files with 23 additions and 11 deletions
|
@ -411,10 +411,10 @@ void CreateGxsChannelMsg::addAttachment(const std::string &path)
|
|||
|
||||
rsGxsChannels->ExtraFileHash(path, filename);
|
||||
|
||||
#warning: hash is used uninitialized below ?!?
|
||||
|
||||
// only path and filename are valid.
|
||||
// destroyed when fileFrame (this subfileitem) is destroyed
|
||||
// Only path and filename are valid.
|
||||
// Destroyed when fileFrame (this subfileitem) is destroyed
|
||||
// Hash will be retrieved later when the file is finished hashing.
|
||||
//
|
||||
//SubFileItem *file = new SubFileItem(hash, filename, path, size, flags, mChannelId);
|
||||
SubFileItem *file = new SubFileItem(hash, filename, path, size, flags, RsPeerId());
|
||||
|
||||
|
|
|
@ -505,15 +505,20 @@ void GxsChannelPostsWidget::insertRelatedPosts(const uint32_t &token)
|
|||
|
||||
static void setAllMessagesReadCallback(FeedItem *feedItem, void *data)
|
||||
{
|
||||
GxsChannelPostItem *channelPostItem = dynamic_cast<GxsChannelPostItem*>(feedItem);
|
||||
if (!channelPostItem) {
|
||||
return;
|
||||
}
|
||||
GxsChannelPostItem *channelPostItem = dynamic_cast<GxsChannelPostItem*>(feedItem);
|
||||
if (!channelPostItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
RsGxsGrpMsgIdPair msgPair = std::make_pair(channelPostItem->groupId(), channelPostItem->messageId());
|
||||
bool is_not_new = !channelPostItem->isUnread() ;
|
||||
|
||||
uint32_t token;
|
||||
rsGxsChannels->setMessageReadStatus(token, msgPair, *((bool*) data));
|
||||
if(is_not_new == *(bool*)data)
|
||||
return ;
|
||||
|
||||
RsGxsGrpMsgIdPair msgPair = std::make_pair(channelPostItem->groupId(), channelPostItem->messageId());
|
||||
|
||||
uint32_t token;
|
||||
rsGxsChannels->setMessageReadStatus(token, msgPair, *((bool*) data));
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::setAllMessagesRead(bool read)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue