mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
The channel message (in channels) is set to read when the user clicks on the show more button.
The forum/channel news feed is removed when the user reads the message in forums/channels. Recompile needed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4927 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d828d23ca7
commit
07ea6829b6
7 changed files with 57 additions and 8 deletions
|
@ -198,6 +198,7 @@ class NotifyBase
|
|||
virtual void notifyPeerStatusChanged(const std::string& /* peer_id */, uint32_t /* status */) {}
|
||||
/* one or more peers has changed the states */
|
||||
virtual void notifyPeerStatusChangedSummary() {}
|
||||
virtual void notifyForumMsgReadSatusChanged(const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) {}
|
||||
virtual void notifyChannelMsgReadSatusChanged(const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) {}
|
||||
virtual void notifyDiscInfoChanged() {}
|
||||
virtual void notifyDownloadComplete(const std::string& /* fileHash */) {};
|
||||
|
|
|
@ -367,6 +367,9 @@ bool p3Forums::ForumMessageSend(ForumMsgInfo &info)
|
|||
|
||||
bool p3Forums::setMessageStatus(const std::string& fId,const std::string& mId,const uint32_t status, const uint32_t statusMask)
|
||||
{
|
||||
bool changed = false;
|
||||
uint32_t newStatus = 0;
|
||||
|
||||
{
|
||||
RsStackMutex stack(distribMtx); /***** STACK LOCKED MUTEX *****/
|
||||
|
||||
|
@ -374,8 +377,14 @@ bool p3Forums::setMessageStatus(const std::string& fId,const std::string& mId,co
|
|||
if (mit != mReadStatus.end())
|
||||
{
|
||||
RsForumReadStatus* rsi = mit->second;
|
||||
uint32_t oldStatus = rsi->msgReadStatus[mId];
|
||||
rsi->msgReadStatus[mId] &= ~statusMask;
|
||||
rsi->msgReadStatus[mId] |= (status & statusMask);
|
||||
|
||||
newStatus = rsi->msgReadStatus[mId];
|
||||
if (oldStatus != newStatus) {
|
||||
changed = true;
|
||||
}
|
||||
} else {
|
||||
// if forum id does not exist create one
|
||||
RsForumReadStatus* rsi = new RsForumReadStatus();
|
||||
|
@ -383,12 +392,18 @@ bool p3Forums::setMessageStatus(const std::string& fId,const std::string& mId,co
|
|||
rsi->msgReadStatus[mId] = status & statusMask;
|
||||
mReadStatus[fId] = rsi;
|
||||
mSaveList.push_back(rsi);
|
||||
|
||||
newStatus = rsi->msgReadStatus[mId];
|
||||
changed = true;
|
||||
}
|
||||
|
||||
IndicateConfigChanged();
|
||||
} /******* UNLOCKED ********/
|
||||
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_FORUMLIST_LOCKED, NOTIFY_TYPE_MOD);
|
||||
if (changed) {
|
||||
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_FORUMLIST_LOCKED, NOTIFY_TYPE_MOD);
|
||||
rsicontrol->getNotify().notifyForumMsgReadSatusChanged(fId, mId, newStatus);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue