From 64fecf42f426d32c88d917129ee91e7602f62ef1 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 14 Apr 2019 15:50:25 +0200 Subject: [PATCH 1/2] moved MessagesDialog.* to msgs/ --- retroshare-gui/src/gui/{ => msgs}/MessagesDialog.cpp | 0 retroshare-gui/src/gui/{ => msgs}/MessagesDialog.h | 0 retroshare-gui/src/gui/{ => msgs}/MessagesDialog.ui | 0 retroshare-gui/src/retroshare-gui.pro | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename retroshare-gui/src/gui/{ => msgs}/MessagesDialog.cpp (100%) rename retroshare-gui/src/gui/{ => msgs}/MessagesDialog.h (100%) rename retroshare-gui/src/gui/{ => msgs}/MessagesDialog.ui (100%) diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp similarity index 100% rename from retroshare-gui/src/gui/MessagesDialog.cpp rename to retroshare-gui/src/gui/msgs/MessagesDialog.cpp diff --git a/retroshare-gui/src/gui/MessagesDialog.h b/retroshare-gui/src/gui/msgs/MessagesDialog.h similarity index 100% rename from retroshare-gui/src/gui/MessagesDialog.h rename to retroshare-gui/src/gui/msgs/MessagesDialog.h diff --git a/retroshare-gui/src/gui/MessagesDialog.ui b/retroshare-gui/src/gui/msgs/MessagesDialog.ui similarity index 100% rename from retroshare-gui/src/gui/MessagesDialog.ui rename to retroshare-gui/src/gui/msgs/MessagesDialog.ui diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 5769274b8..70050a727 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -443,6 +443,7 @@ HEADERS += rshare.h \ gui/connect/ConfCertDialog.h \ gui/connect/PGPKeyDialog.h \ gui/connect/FriendRecommendDialog.h \ + gui/msgs/MessagesDialog.h \ gui/msgs/MessageInterface.h \ gui/msgs/MessageComposer.h \ gui/msgs/MessageWindow.h \ @@ -541,7 +542,6 @@ HEADERS += rshare.h \ gui/common/ToasterNotify.h \ gui/style/RSStyle.h \ gui/style/StyleDialog.h \ - gui/MessagesDialog.h \ gui/help/browser/helpbrowser.h \ gui/help/browser/helptextbrowser.h \ gui/statusbar/peerstatus.h \ @@ -621,7 +621,6 @@ FORMS += gui/StartDialog.ui \ gui/FriendsDialog.ui \ gui/ShareManager.ui \ # gui/ShareDialog.ui \ - gui/MessagesDialog.ui \ gui/help/browser/helpbrowser.ui \ gui/HelpDialog.ui \ gui/ServicePermissionDialog.ui \ @@ -640,6 +639,7 @@ FORMS += gui/StartDialog.ui \ gui/connect/ConnectFriendWizard.ui \ gui/connect/ConnectProgressDialog.ui \ gui/connect/FriendRecommendDialog.ui \ + gui/msgs/MessagesDialog.ui \ gui/msgs/MessageComposer.ui \ gui/msgs/MessageWindow.ui\ gui/msgs/MessageWidget.ui\ @@ -745,7 +745,6 @@ SOURCES += main.cpp \ # gui/ShareDialog.cpp \ # gui/SFListDelegate.cpp \ gui/SoundManager.cpp \ - gui/MessagesDialog.cpp \ gui/im_history/ImHistoryBrowser.cpp \ gui/im_history/IMHistoryItemDelegate.cpp \ gui/im_history/IMHistoryItemPainter.cpp \ @@ -800,6 +799,7 @@ SOURCES += main.cpp \ gui/chat/ChatLobbyUserNotify.cpp \ gui/connect/ConfCertDialog.cpp \ gui/connect/PGPKeyDialog.cpp \ + gui/msgs/MessagesDialog.cpp \ gui/msgs/MessageComposer.cpp \ gui/msgs/MessageWidget.cpp \ gui/msgs/MessageWindow.cpp \ From 0bcbe14b2c7cf37cc3419bc1550609a7f46731ca Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 14 Apr 2019 16:25:26 +0200 Subject: [PATCH 2/2] fixed wrong display of trash messages in inbox --- libretroshare/src/retroshare/rsmsgs.h | 4 +-- retroshare-gui/src/gui/MainWindow.cpp | 2 +- retroshare-gui/src/gui/msgs/MessageModel.cpp | 14 +++++----- .../src/gui/msgs/MessagesDialog.cpp | 26 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libretroshare/src/retroshare/rsmsgs.h b/libretroshare/src/retroshare/rsmsgs.h index 6658a53bc..f1e42c4c3 100644 --- a/libretroshare/src/retroshare/rsmsgs.h +++ b/libretroshare/src/retroshare/rsmsgs.h @@ -563,8 +563,8 @@ public: /** * @brief MessageToTrash * @jsonapi{development} - * @param[in] msgId - * @param[in] bTrash + * @param[in] msgId Id of the message to mode to trash box + * @param[in] bTrash Move to trash if true, otherwise remove from trash * @return true on success */ virtual bool MessageToTrash(const std::string &msgId, bool bTrash) = 0; diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index c9e2e9c0b..3a81877ce 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -40,7 +40,7 @@ #include "gui/FileTransfer/SearchDialog.h" #include "gui/FileTransfer/SharedFilesDialog.h" #include "gui/FileTransfer/TransfersDialog.h" -#include "MessagesDialog.h" +#include "gui/msgs/MessagesDialog.h" #include "PluginsPage.h" #include "NewsFeed.h" #include "ShareManager.h" diff --git a/retroshare-gui/src/gui/msgs/MessageModel.cpp b/retroshare-gui/src/gui/msgs/MessageModel.cpp index 3f30b2342..441b02bbc 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.cpp +++ b/retroshare-gui/src/gui/msgs/MessageModel.cpp @@ -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()) || (mQuickViewFilter==QUICK_VIEW_STARRED && (fmpe.msgflags & RS_MSG_STAR)) || (mQuickViewFilter==QUICK_VIEW_SYSTEM && (fmpe.msgflags & RS_MSG_SYSTEM)); - - std::cerr << "Passes filter: type=" << mFilterType << " s=\"" << s.toStdString() - << "MsgFlags=" << fmpe.msgflags << " msgtags=" ; +#ifdef DEBUG_MESSAGE_MODEL + std::cerr << "Passes filter: type=" << mFilterType << " s=\"" << s.toStdString() << "MsgFlags=" << fmpe.msgflags << " msgtags=" ; foreach(uint32_t i,fmpe.msgtags) std::cerr << i << " " ; std::cerr << "\" strings:" << passes_strings << " quick_view:" << passes_quick_view << std::endl; +#endif return passes_quick_view && passes_strings; } @@ -621,10 +621,10 @@ void RsMessageModel::getMessageSummaries(BoxName box,std::listmsgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX ; break ; - case BOX_SENT : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_SENTBOX; break ; - case BOX_OUTBOX : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX ; break ; - case BOX_DRAFTS : ok = (it->msgflags & RS_MSG_BOXMASK) == RS_MSG_DRAFTBOX ; 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 && !(it->msgflags & RS_MSG_TRASH); 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 && !(it->msgflags & RS_MSG_TRASH); break ; case BOX_TRASH : ok = (it->msgflags & RS_MSG_TRASH) ; break ; default: ++it; diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index e8c130e88..2837b5b3a 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -27,21 +27,21 @@ #include "MessagesDialog.h" -#include "notifyqt.h" -#include "common/TagDefs.h" -#include "common/PeerDefs.h" -#include "common/RSElidedItemDelegate.h" -#include "gxs/GxsIdTreeWidgetItem.h" -#include "gxs/GxsIdDetails.h" +#include "gui/notifyqt.h" +#include "gui/common/TagDefs.h" +#include "gui/common/PeerDefs.h" +#include "gui/common/RSElidedItemDelegate.h" +#include "gui/gxs/GxsIdTreeWidgetItem.h" +#include "gui/gxs/GxsIdDetails.h" #include "gui/Identity/IdDialog.h" #include "gui/MainWindow.h" -#include "msgs/MessageComposer.h" -#include "msgs/MessageInterface.h" -#include "msgs/MessageUserNotify.h" -#include "msgs/MessageWidget.h" -#include "msgs/TagsMenu.h" -#include "msgs/MessageModel.h" -#include "settings/rsharesettings.h" +#include "gui/msgs/MessageComposer.h" +#include "gui/msgs/MessageInterface.h" +#include "gui/msgs/MessageUserNotify.h" +#include "gui/msgs/MessageWidget.h" +#include "gui/msgs/TagsMenu.h" +#include "gui/msgs/MessageModel.h" +#include "gui/settings/rsharesettings.h" #include "util/DateTime.h" #include "util/RsProtectedTimer.h"