fixed wrong display of trash messages in inbox

This commit is contained in:
csoler 2019-04-14 16:25:26 +02:00
parent 64fecf42f4
commit 0bcbe14b2c
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
4 changed files with 23 additions and 23 deletions

View File

@ -563,8 +563,8 @@ public:
/** /**
* @brief MessageToTrash * @brief MessageToTrash
* @jsonapi{development} * @jsonapi{development}
* @param[in] msgId * @param[in] msgId Id of the message to mode to trash box
* @param[in] bTrash * @param[in] bTrash Move to trash if true, otherwise remove from trash
* @return true on success * @return true on success
*/ */
virtual bool MessageToTrash(const std::string &msgId, bool bTrash) = 0; virtual bool MessageToTrash(const std::string &msgId, bool bTrash) = 0;

View File

@ -40,7 +40,7 @@
#include "gui/FileTransfer/SearchDialog.h" #include "gui/FileTransfer/SearchDialog.h"
#include "gui/FileTransfer/SharedFilesDialog.h" #include "gui/FileTransfer/SharedFilesDialog.h"
#include "gui/FileTransfer/TransfersDialog.h" #include "gui/FileTransfer/TransfersDialog.h"
#include "MessagesDialog.h" #include "gui/msgs/MessagesDialog.h"
#include "PluginsPage.h" #include "PluginsPage.h"
#include "NewsFeed.h" #include "NewsFeed.h"
#include "ShareManager.h" #include "ShareManager.h"

View File

@ -336,11 +336,11 @@ bool RsMessageModel::passesFilter(const Rs::Msgs::MsgInfoSummary& fmpe,int colum
|| (std::find(fmpe.msgtags.begin(),fmpe.msgtags.end(),mQuickViewFilter) != fmpe.msgtags.end()) || (std::find(fmpe.msgtags.begin(),fmpe.msgtags.end(),mQuickViewFilter) != fmpe.msgtags.end())
|| (mQuickViewFilter==QUICK_VIEW_STARRED && (fmpe.msgflags & RS_MSG_STAR)) || (mQuickViewFilter==QUICK_VIEW_STARRED && (fmpe.msgflags & RS_MSG_STAR))
|| (mQuickViewFilter==QUICK_VIEW_SYSTEM && (fmpe.msgflags & RS_MSG_SYSTEM)); || (mQuickViewFilter==QUICK_VIEW_SYSTEM && (fmpe.msgflags & RS_MSG_SYSTEM));
#ifdef DEBUG_MESSAGE_MODEL
std::cerr << "Passes filter: type=" << mFilterType << " s=\"" << s.toStdString() std::cerr << "Passes filter: type=" << mFilterType << " s=\"" << s.toStdString() << "MsgFlags=" << fmpe.msgflags << " msgtags=" ;
<< "MsgFlags=" << fmpe.msgflags << " msgtags=" ;
foreach(uint32_t i,fmpe.msgtags) std::cerr << i << " " ; foreach(uint32_t i,fmpe.msgtags) std::cerr << i << " " ;
std::cerr << "\" strings:" << passes_strings << " quick_view:" << passes_quick_view << std::endl; std::cerr << "\" strings:" << passes_strings << " quick_view:" << passes_quick_view << std::endl;
#endif
return passes_quick_view && passes_strings; return passes_quick_view && passes_strings;
} }
@ -621,10 +621,10 @@ void RsMessageModel::getMessageSummaries(BoxName box,std::list<Rs::Msgs::MsgInfo
switch(box) switch(box)
{ {
case BOX_INBOX : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX ; break ; case BOX_INBOX : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX && !(it->msgflags & RS_MSG_TRASH); break ;
case BOX_SENT : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_SENTBOX; break ; case BOX_SENT : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_SENTBOX && !(it->msgflags & RS_MSG_TRASH); break ;
case BOX_OUTBOX : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX ; break ; case BOX_OUTBOX : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX && !(it->msgflags & RS_MSG_TRASH); break ;
case BOX_DRAFTS : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_DRAFTBOX ; break ; case BOX_DRAFTS : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_DRAFTBOX && !(it->msgflags & RS_MSG_TRASH); break ;
case BOX_TRASH : ok = (it->msgflags & RS_MSG_TRASH) ; break ; case BOX_TRASH : ok = (it->msgflags & RS_MSG_TRASH) ; break ;
default: default:
++it; ++it;

View File

@ -27,21 +27,21 @@
#include "MessagesDialog.h" #include "MessagesDialog.h"
#include "notifyqt.h" #include "gui/notifyqt.h"
#include "common/TagDefs.h" #include "gui/common/TagDefs.h"
#include "common/PeerDefs.h" #include "gui/common/PeerDefs.h"
#include "common/RSElidedItemDelegate.h" #include "gui/common/RSElidedItemDelegate.h"
#include "gxs/GxsIdTreeWidgetItem.h" #include "gui/gxs/GxsIdTreeWidgetItem.h"
#include "gxs/GxsIdDetails.h" #include "gui/gxs/GxsIdDetails.h"
#include "gui/Identity/IdDialog.h" #include "gui/Identity/IdDialog.h"
#include "gui/MainWindow.h" #include "gui/MainWindow.h"
#include "msgs/MessageComposer.h" #include "gui/msgs/MessageComposer.h"
#include "msgs/MessageInterface.h" #include "gui/msgs/MessageInterface.h"
#include "msgs/MessageUserNotify.h" #include "gui/msgs/MessageUserNotify.h"
#include "msgs/MessageWidget.h" #include "gui/msgs/MessageWidget.h"
#include "msgs/TagsMenu.h" #include "gui/msgs/TagsMenu.h"
#include "msgs/MessageModel.h" #include "gui/msgs/MessageModel.h"
#include "settings/rsharesettings.h" #include "gui/settings/rsharesettings.h"
#include "util/DateTime.h" #include "util/DateTime.h"
#include "util/RsProtectedTimer.h" #include "util/RsProtectedTimer.h"