mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-31 11:08:16 -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
@ -86,6 +86,11 @@ GxsChannelPostItem::~GxsChannelPostItem()
|
||||
delete(ui);
|
||||
}
|
||||
|
||||
bool GxsChannelPostItem::isUnread() const
|
||||
{
|
||||
return IS_MSG_UNREAD(mPost.mMeta.mMsgStatus) ;
|
||||
}
|
||||
|
||||
void GxsChannelPostItem::setup()
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
|
@ -58,6 +58,8 @@ public:
|
||||
/* FeedItem */
|
||||
virtual void expand(bool open);
|
||||
|
||||
bool isUnread() const ;
|
||||
|
||||
protected:
|
||||
/* GxsGroupFeedItem */
|
||||
virtual QString groupName();
|
||||
|
@ -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…
x
Reference in New Issue
Block a user