diff --git a/.github/workflows/ci-mingw64.yml b/.github/workflows/ci-mingw64.yml index d562938b3..c3b9d345c 100644 --- a/.github/workflows/ci-mingw64.yml +++ b/.github/workflows/ci-mingw64.yml @@ -66,5 +66,5 @@ jobs: - name: CI-Build run: | - qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + qmake-qt5.exe . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" mingw32-make -j3 diff --git a/.github/workflows/ci-ucrt64.yml b/.github/workflows/ci-ucrt64.yml index df569b8bf..4e7323d03 100644 --- a/.github/workflows/ci-ucrt64.yml +++ b/.github/workflows/ci-ucrt64.yml @@ -66,5 +66,5 @@ jobs: - name: CI-Build run: | - qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + qmake-qt5.exe . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" mingw32-make -j3 diff --git a/.gitignore b/.gitignore index 606e522a3..89009c395 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ Thumbs.db /retroshare-gui/src/temp/ /retroshare-service/src/retroshare-service /*.tar.?z + +# Build artifacts +build/ +.vscode/ diff --git a/libretroshare b/libretroshare index 764365440..cb57e66e2 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 7643654403b5779e56dd20c5e73e4e47583f27e6 +Subproject commit cb57e66e2741ad985cdf31b8f92ef9b0a4cfebd0 diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp index 7f2dac811..d3fb34dd8 100644 --- a/retroshare-gui/src/gui/AboutWidget.cpp +++ b/retroshare-gui/src/gui/AboutWidget.cpp @@ -71,7 +71,7 @@ AboutWidget::AboutWidget(QWidget* parent) void AboutWidget::installAWidget() { assert(tWidget == NULL); aWidget = new AWidget(); - QVBoxLayout* l = (QVBoxLayout*)specialFrame->layout(); + QHBoxLayout* l = (QHBoxLayout*)specialFrame->layout(); l->insertWidget(0, aWidget); l->setStretchFactor(aWidget, 100); aWidget->setFocus(); @@ -87,7 +87,7 @@ void AboutWidget::installTWidget() { tWidget->setNextPieceLabel(npLabel); QWidget* pan = new QWidget(); - QVBoxLayout* vl = new QVBoxLayout(pan); + QHBoxLayout* vl = new QHBoxLayout(pan); QLabel* topRecLabel = new QLabel(tr("Max score: %1").arg(tWidget->getMaxScore())); QLabel* scoreLabel = new QLabel(pan); QLabel* levelLabel = new QLabel(pan); diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 062ee6a7c..0a3db692e 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -37,7 +37,7 @@ #include "util/qtthreadsutils.h" #include "util/RsQtVersion.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rschats.h" #include "retroshare/rspeers.h" #include "retroshare/rsidentity.h" @@ -484,7 +484,7 @@ void ChatLobbyWidget::addChatPage(ChatLobbyDialog *d) _lobby_infos[id].last_typing_event = time(nullptr) ; ChatLobbyInfo linfo ; - if(rsMsgs->getChatLobbyInfo(id,linfo)) + if(rsChats->getChatLobbyInfo(id,linfo)) _lobby_infos[id].default_icon = (linfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(IMAGE_PUBLIC):FilesDefs::getIconFromQtResourcePath(IMAGE_PRIVATE) ; else std::cerr << "(EE) cannot find info for room " << std::hex << id << std::dec << std::endl; @@ -528,10 +528,10 @@ void ChatLobbyWidget::updateDisplay() std::cerr << "updating chat room display!" << std::endl; #endif std::vector visibleLobbies; - rsMsgs->getListOfNearbyChatLobbies(visibleLobbies); + rsChats->getListOfNearbyChatLobbies(visibleLobbies); std::list lobbies; - rsMsgs->getChatLobbyList(lobbies); + rsChats->getChatLobbyList(lobbies); #ifdef CHAT_LOBBY_GUI_DEBUG std::cerr << "got " << visibleLobbies.size() << " visible lobbies" << std::endl; @@ -683,7 +683,7 @@ void ChatLobbyWidget::updateDisplay() // In the new model (after lobby save to disk) the auto-subscribe flag is used to automatically join lobbies that where // previously being used when the t software quits. - bool autoSubscribe = rsMsgs->getLobbyAutoSubscribe(lobby.lobby_id); + bool autoSubscribe = rsChats->getLobbyAutoSubscribe(lobby.lobby_id); if (autoSubscribe && subscribed && _lobby_infos.find(lobby.lobby_id) == _lobby_infos.end()) { @@ -702,7 +702,7 @@ void ChatLobbyWidget::updateDisplay() for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) { ChatLobbyInfo lobby ; - rsMsgs->getChatLobbyInfo(*lobbyIt,lobby) ; + rsChats->getChatLobbyInfo(*lobbyIt,lobby) ; #ifdef CHAT_LOBBY_GUI_DEBUG std::cerr << "adding " << lobby.lobby_name << "topic " << lobby.lobby_topic << " #" << std::hex << lobby.lobby_id << std::dec << " private " << lobby.nick_names.size() << " peers." << std::endl; @@ -745,7 +745,7 @@ void ChatLobbyWidget::updateDisplay() item->setIcon(COLUMN_NAME, icon); } - bool autoSubscribe = rsMsgs->getLobbyAutoSubscribe(lobby.lobby_id); + bool autoSubscribe = rsChats->getLobbyAutoSubscribe(lobby.lobby_id); updateItem(ui.lobbyTreeWidget, item, lobby.lobby_id, lobby.lobby_name,lobby.lobby_topic, lobby.gxs_ids.size(), true, autoSubscribe,lobby_flags); @@ -753,7 +753,7 @@ void ChatLobbyWidget::updateDisplay() // look for chat rooms that are subscribed but not displayed as such - if(it == _lobby_infos.end() && rsMsgs->joinVisibleChatLobby(lobby.lobby_id,lobby.gxs_id)) + if(it == _lobby_infos.end() && rsChats->joinVisibleChatLobby(lobby.lobby_id,lobby.gxs_id)) { std::cerr << "Adding back ChatLobbyDialog for subscribed lobby " << std::hex << lobby.lobby_id << std::dec << std::endl; ChatDialog::chatFriend(ChatId(lobby.lobby_id),true) ; @@ -819,7 +819,7 @@ void ChatLobbyWidget::createIdentityAndSubscribe() if(!rsIdentity->getOwnIds(own_ids) || own_ids.empty()) return; - if(rsMsgs->joinVisibleChatLobby(id,own_ids.front())) + if(rsChats->joinVisibleChatLobby(id,own_ids.front())) ChatDialog::chatFriend(ChatId(id),true) ; } @@ -839,7 +839,7 @@ void ChatLobbyWidget::subscribeChatLobbyAs() RsGxsId gxs_id(action->data().toString().toStdString()); //uint32_t error_code ; - if(rsMsgs->joinVisibleChatLobby(id,gxs_id)) + if(rsChats->joinVisibleChatLobby(id,gxs_id)) ChatDialog::chatFriend(ChatId(id),true) ; } @@ -879,7 +879,7 @@ void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item) RsGxsId gxs_id ; std::list own_ids; - // not using rsMsgs->getDefaultIdentityForChatLobby(), to check if we have an identity + // not using rsChats->getDefaultIdentityForChatLobby(), to check if we have an identity // to work around the case when the identity was deleted and is invalid // (the chatservice does not know if a default identity was deleted) // only rsIdentity knows the truth at the moment! @@ -902,7 +902,7 @@ void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item) } else { - rsMsgs->getDefaultIdentityForChatLobby(gxs_id); + rsChats->getDefaultIdentityForChatLobby(gxs_id); RsIdentityDetails idd ; if(!rsIdentity->getIdDetails(gxs_id,idd)) @@ -915,7 +915,7 @@ void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item) } } - if(rsMsgs->joinVisibleChatLobby(id,gxs_id)) + if(rsChats->joinVisibleChatLobby(id,gxs_id)) ChatDialog::chatFriend(ChatId(id),true) ; } @@ -926,8 +926,8 @@ void ChatLobbyWidget::autoSubscribeLobby(QTreeWidgetItem *item) } ChatLobbyId id = item->data(COLUMN_DATA, ROLE_ID).toULongLong(); - bool isAutoSubscribe = rsMsgs->getLobbyAutoSubscribe(id); - rsMsgs->setLobbyAutoSubscribe(id, !isAutoSubscribe); + bool isAutoSubscribe = rsChats->getLobbyAutoSubscribe(id); + rsChats->setLobbyAutoSubscribe(id, !isAutoSubscribe); if (!isAutoSubscribe && !item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool()) subscribeChatLobbyAtItem(item); } @@ -939,7 +939,7 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id, bool subscribed /*= false*/) // Update information std::vector lobbies; - rsMsgs->getListOfNearbyChatLobbies(lobbies); + rsChats->getListOfNearbyChatLobbies(lobbies); std::list my_ids ; rsIdentity->getOwnIds(my_ids) ; @@ -1122,9 +1122,9 @@ void ChatLobbyWidget::unsubscribeChatLobby(ChatLobbyId id) // Unsubscribe the chat lobby ChatDialog::closeChat(ChatId(id)); - rsMsgs->unsubscribeChatLobby(id); - bool isAutoSubscribe = rsMsgs->getLobbyAutoSubscribe(id); - if (isAutoSubscribe) rsMsgs->setLobbyAutoSubscribe(id, !isAutoSubscribe); + rsChats->unsubscribeChatLobby(id); + bool isAutoSubscribe = rsChats->getLobbyAutoSubscribe(id); + if (isAutoSubscribe) rsChats->setLobbyAutoSubscribe(id, !isAutoSubscribe); ChatLobbyDialog *cldCW=NULL ; if (NULL != (cldCW = dynamic_cast(ui.stackedWidget->currentWidget()))) @@ -1205,13 +1205,13 @@ void ChatLobbyWidget::handleChatLobbyEvent(uint64_t lobby_id, RsChatLobbyEventCo void ChatLobbyWidget::readChatLobbyInvites() { std::list invites; - rsMsgs->getPendingChatLobbyInvites(invites); + rsChats->getPendingChatLobbyInvites(invites); RsGxsId default_id ; - rsMsgs->getDefaultIdentityForChatLobby(default_id) ; + rsChats->getDefaultIdentityForChatLobby(default_id) ; std::list subscribed_lobbies ; - rsMsgs->getChatLobbyList(subscribed_lobbies) ; + rsChats->getChatLobbyList(subscribed_lobbies) ; for(std::list::const_iterator it(invites.begin());it!=invites.end();++it) { @@ -1265,7 +1265,7 @@ void ChatLobbyWidget::readChatLobbyInvites() if (res == QMessageBox::No) { - rsMsgs->denyLobbyInvite((*it).lobby_id); + rsChats->denyLobbyInvite((*it).lobby_id); continue ; } @@ -1274,11 +1274,11 @@ void ChatLobbyWidget::readChatLobbyInvites() if(chosen_id.isNull()) { - rsMsgs->denyLobbyInvite((*it).lobby_id); + rsChats->denyLobbyInvite((*it).lobby_id); continue ; } - if(rsMsgs->acceptLobbyInvite((*it).lobby_id,chosen_id)) + if(rsChats->acceptLobbyInvite((*it).lobby_id,chosen_id)) ChatDialog::chatFriend(ChatId((*it).lobby_id),true); else std::cerr << "Can't join chat room with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl; diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.h b/retroshare-gui/src/gui/ChatLobbyWidget.h index 8b355515a..751b35127 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.h +++ b/retroshare-gui/src/gui/ChatLobbyWidget.h @@ -28,7 +28,7 @@ #include "util/FontSizeHandler.h" -#include +#include #include #include diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 34a19d609..785bbe4d9 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "chat/ChatUserNotify.h" #include "connect/ConnectFriendWizard.h" @@ -283,14 +284,14 @@ void FriendsDialog::getAvatar() std::cerr << "Avatar image size = " << ba.size() << std::endl ; #endif - rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()), ba.size()) ; // last char 0 included. + rsChats->setOwnNodeAvatarData((unsigned char *)(ba.data()), ba.size()) ; // last char 0 included. } } /** Loads own personal status */ void FriendsDialog::loadmypersonalstatus() { - QString statustring = QString::fromUtf8(rsMsgs->getCustomStateString().c_str()); + QString statustring = QString::fromUtf8(rsChats->getOwnCustomStateString().c_str()); if (statustring.isEmpty()) ui.mypersonalstatusLabel->setText(tr("Set your status message here.")); diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index f363f898b..63bbc521e 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -53,7 +53,7 @@ #include "util/DateTime.h" #include "retroshare/rsgxsflags.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rschats.h" #include "retroshare/rspeers.h" #include "retroshare/rsservicecontrol.h" @@ -1917,7 +1917,7 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const { ChatId id = ChatId(ChatLobbyId(u.mAdditionalId)); ChatLobbyInfo linfo ; - rsMsgs->getChatLobbyInfo(ChatLobbyId(u.mAdditionalId),linfo); + rsChats->getChatLobbyInfo(ChatLobbyId(u.mAdditionalId),linfo); RetroShareLink l = RetroShareLink::createChatRoom(id, QString::fromUtf8(linfo.lobby_name.c_str())); return tr("Message in chat room %1").arg(l.toHtml()) ; } @@ -2456,7 +2456,7 @@ void IdDialog::chatIdentity(const RsGxsId& toGxsId) uint32_t error_code; DistantChatPeerId did; - if(!rsMsgs->initiateDistantChatConnexion(toGxsId, fromGxsId, did, error_code)) + if(!rsChats->initiateDistantChatConnexion(toGxsId, fromGxsId, did, error_code)) QMessageBox::information( nullptr, tr("Distant chat cannot work") , QString("%1 %2: %3") diff --git a/retroshare-gui/src/gui/Identity/IdentityListModel.h b/retroshare-gui/src/gui/Identity/IdentityListModel.h index 0e1fb5e28..2314a406e 100644 --- a/retroshare-gui/src/gui/Identity/IdentityListModel.h +++ b/retroshare-gui/src/gui/Identity/IdentityListModel.h @@ -24,7 +24,8 @@ #include #include "retroshare/rsstatus.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rschats.h" +#include "retroshare/rsmail.h" #include "retroshare/rspeers.h" #include "retroshare/rsidentity.h" diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index fca08966f..0c4c78986 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -27,7 +27,7 @@ #include "common/StatusDefs.h" #include -#include +#include #include #include "rshare.h" @@ -223,13 +223,13 @@ void MessengerWindow::openShareManager() /** Loads own personal status message */ void MessengerWindow::loadmystatusmessage() { - ui.messagelineEdit->setEditText( QString::fromUtf8(rsMsgs->getCustomStateString().c_str())); + ui.messagelineEdit->setEditText( QString::fromUtf8(rsChats->getOwnCustomStateString().c_str())); } /** Save own status message */ void MessengerWindow::savestatusmessage() { - rsMsgs->setCustomStateString(ui.messagelineEdit->currentText().toUtf8().constData()); + rsChats->setCustomStateString(ui.messagelineEdit->currentText().toUtf8().constData()); } void MessengerWindow::updateOwnStatus(const QString &peer_id, RsStatusValue status) diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index e0e7f2494..460e6001a 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include "common/vmessagebox.h" #include "common/RSTreeWidgetItem.h" diff --git a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp index 9da32fe2a..b01eb48d5 100644 --- a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp +++ b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp @@ -24,7 +24,6 @@ #include #include #include -#include bool pgpid_item_proxy::lessThan(const QModelIndex &left, const QModelIndex &right) const { diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index 1b67c92a9..cf901d1e7 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -26,7 +26,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -69,6 +70,8 @@ * #define NEWS_DEBUG 1 ****/ +using namespace Rs::Mail; + static NewsFeed* instance = nullptr; /** Constructor */ diff --git a/retroshare-gui/src/gui/People/IdentityItem.cpp b/retroshare-gui/src/gui/People/IdentityItem.cpp index e1096d726..914015d54 100644 --- a/retroshare-gui/src/gui/People/IdentityItem.cpp +++ b/retroshare-gui/src/gui/People/IdentityItem.cpp @@ -1,6 +1,7 @@ #include -#include +#include +#include #include #include diff --git a/retroshare-gui/src/gui/People/PeopleDialog.cpp b/retroshare-gui/src/gui/People/PeopleDialog.cpp index 42bf448a4..ad7c955de 100644 --- a/retroshare-gui/src/gui/People/PeopleDialog.cpp +++ b/retroshare-gui/src/gui/People/PeopleDialog.cpp @@ -35,8 +35,9 @@ #include "retroshare/rsidentity.h" #include "retroshare/rsgxscircles.h" #include "retroshare/rsgxsflags.h" -#include "retroshare/rsmsgs.h" -#include "retroshare/rsids.h" +#include "retroshare/rsmail.h" +#include "retroshare/rschats.h" +#include "retroshare/rsids.h" #include #include @@ -604,7 +605,7 @@ void PeopleDialog::chatIdentity() DistantChatPeerId dpid ; - if(!rsMsgs->initiateDistantChatConnexion(RsGxsId(gxs_id), from_gxs_id, dpid,error_code)) + if(!rsChats->initiateDistantChatConnexion(RsGxsId(gxs_id), from_gxs_id, dpid,error_code)) QMessageBox::information(NULL, tr("Distant chat cannot work"), QString("%1 %2: %3").arg(tr("Distant chat refused with this person.")).arg(tr("Error code")).arg(error_code)) ; } diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index a22f9ced8..935091469 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/retroshare-gui/src/gui/RetroShareLink.h b/retroshare-gui/src/gui/RetroShareLink.h index 61c794b11..2225392fe 100644 --- a/retroshare-gui/src/gui/RetroShareLink.h +++ b/retroshare-gui/src/gui/RetroShareLink.h @@ -35,8 +35,9 @@ // #include -#include #include +#include +#include #include #include diff --git a/retroshare-gui/src/gui/RsGUIEventManager.cpp b/retroshare-gui/src/gui/RsGUIEventManager.cpp index 73bdb8a3a..c9ff5faef 100644 --- a/retroshare-gui/src/gui/RsGUIEventManager.cpp +++ b/retroshare-gui/src/gui/RsGUIEventManager.cpp @@ -23,7 +23,8 @@ #include #include -#include +#include +#include #include #include #include @@ -259,8 +260,8 @@ void RsGUIEventManager::async_handleIncomingEvent(std::shared_ptr { for(auto msgid:ev1->mChangedMsgIds) { - Rs::Msgs::MessageInfo msgInfo; - if(rsMsgs->getMessage(msgid, msgInfo)) + Rs::Mail::MessageInfo msgInfo; + if(rsMail->getMessage(msgid, msgInfo)) insertToaster(new ToasterItem(new MessageToaster(msgInfo.from.toStdString(), QString::fromUtf8(msgInfo.title.c_str()), QString::fromUtf8(msgInfo.msg.c_str())))); } } diff --git a/retroshare-gui/src/gui/RsGUIEventManager.h b/retroshare-gui/src/gui/RsGUIEventManager.h index 2ae4ab464..99ccf1a1e 100644 --- a/retroshare-gui/src/gui/RsGUIEventManager.h +++ b/retroshare-gui/src/gui/RsGUIEventManager.h @@ -23,7 +23,8 @@ #include #include -#include +#include +#include #include #include #include diff --git a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp index 7f411a25e..084c9a808 100644 --- a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp +++ b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp @@ -33,6 +33,8 @@ #include "util/DateTime.h" #include +#include "util/qtthreadsutils.h" + // These should be in retroshare/ folder. #include "retroshare/rsgxsflags.h" @@ -79,60 +81,68 @@ /** Constructor */ -WikiDialog::WikiDialog(QWidget *parent) : RsGxsUpdateBroadcastPage(rsWiki, parent) +WikiDialog::WikiDialog(QWidget *parent) : + RsGxsUpdateBroadcastPage(rsWiki, parent), + mEventHandlerId(0) // Initialize handler ID { - /* Invoke the Qt Designer generated object setup routine */ - ui.setupUi(this); + /* Invoke the Qt Designer generated object setup routine */ + ui.setupUi(this); - mAddPageDialog = NULL; - mAddGroupDialog = NULL; - mEditDialog = NULL; + mAddPageDialog = NULL; + mAddGroupDialog = NULL; + mEditDialog = NULL; - connect( ui.toolButton_NewPage, SIGNAL(clicked()), this, SLOT(OpenOrShowAddPageDialog())); - connect( ui.toolButton_Edit, SIGNAL(clicked()), this, SLOT(OpenOrShowEditDialog())); - connect( ui.toolButton_Republish, SIGNAL(clicked()), this, SLOT(OpenOrShowRepublishDialog())); + connect( ui.toolButton_NewPage, SIGNAL(clicked()), this, SLOT(OpenOrShowAddPageDialog())); + connect( ui.toolButton_Edit, SIGNAL(clicked()), this, SLOT(OpenOrShowEditDialog())); + connect( ui.toolButton_Republish, SIGNAL(clicked()), this, SLOT(OpenOrShowRepublishDialog())); - // Usurped until Refresh works normally - connect( ui.toolButton_Delete, SIGNAL(clicked()), this, SLOT(insertWikiGroups())); - connect( ui.pushButton, SIGNAL(clicked()), this, SLOT(todo())); + connect( ui.treeWidget_Pages, SIGNAL(itemSelectionChanged()), this, SLOT(groupTreeChanged())); - connect( ui.treeWidget_Pages, SIGNAL(itemSelectionChanged()), this, SLOT(groupTreeChanged())); + // GroupTreeWidget. + connect(ui.groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupListCustomPopupMenu(QPoint))); + connect(ui.groupTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(wikiGroupChanged(QString))); - // GroupTreeWidget. - connect(ui.groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupListCustomPopupMenu(QPoint))); - connect(ui.groupTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(wikiGroupChanged(QString))); + /* setup TokenQueue */ + mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this); - /* setup TokenQueue */ - mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this); + // Set initial size of the splitter + ui.listSplitter->setStretchFactor(0, 0); + ui.listSplitter->setStretchFactor(1, 1); - // Set initial size of the splitter - ui.listSplitter->setStretchFactor(0, 0); - ui.listSplitter->setStretchFactor(1, 1); + /* Setup Group Tree */ + mYourGroups = ui.groupTreeWidget->addCategoryItem(tr("My Groups"), QIcon(), true); + mSubscribedGroups = ui.groupTreeWidget->addCategoryItem(tr("Subscribed Groups"), QIcon(), true); + mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(), false); + mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(), false); + + /* Add the New Group button */ + QToolButton *newGroupButton = new QToolButton(this); + newGroupButton->setIcon(QIcon(":/icons/png/add.png")); + newGroupButton->setToolTip(tr("Create Group")); + connect(newGroupButton, SIGNAL(clicked()), this, SLOT(OpenOrShowAddGroupDialog())); + ui.groupTreeWidget->addToolButton(newGroupButton); - /* Setup Group Tree */ - mYourGroups = ui.groupTreeWidget->addCategoryItem(tr("My Groups"), QIcon(), true); - mSubscribedGroups = ui.groupTreeWidget->addCategoryItem(tr("Subscribed Groups"), QIcon(), true); - mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(), false); - mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(), false); - - /* Add the New Group button */ - QToolButton *newGroupButton = new QToolButton(this); - newGroupButton->setIcon(QIcon(":/icons/png/add.png")); - newGroupButton->setToolTip(tr("Create Group")); - connect(newGroupButton, SIGNAL(clicked()), this, SLOT(OpenOrShowAddGroupDialog())); - ui.groupTreeWidget->addToolButton(newGroupButton); + // load settings + processSettings(true); + updateDisplay(true); - //QTimer *timer = new QTimer(this); - //timer->connect(timer, SIGNAL(timeout()), this, SLOT(insertWikiGroups())); - //timer->start(5000); + /* Get dynamic event type ID for Wiki. This avoids hardcoding IDs in rsevents.h */ + RsEventType wikiEventType = (RsEventType)rsEvents->getDynamicEventType("GXS_WIKI"); - // load settings - processSettings(true); - updateDisplay(true); + /* Register events handler using the dynamic type */ + rsEvents->registerEventsHandler( + [this](std::shared_ptr event) { + RsQThreadUtils::postToObject([=]() { + handleEvent_main_thread(event); + }, this ); + }, + mEventHandlerId, wikiEventType); } WikiDialog::~WikiDialog() { + rsEvents->unregisterEventsHandler(mEventHandlerId); + // save settings processSettings(false); @@ -158,6 +168,7 @@ void WikiDialog::processSettings(bool load) Settings->endGroup(); } + void WikiDialog::OpenOrShowAddPageDialog() { RsGxsGroupId groupId = getSelectedGroup(); @@ -722,13 +733,6 @@ void WikiDialog::GroupMetaDataToGroupItemInfo(const RsGroupMetaData &groupInfo, groupItemInfo.icon = QIcon(IMAGE_WIKI); } -void WikiDialog::todo() -{ - QMessageBox::information(this, "Todo", - "Open points:
    " - "
  • Auto update Group trees" - "
"); -} void WikiDialog::updateDisplay(bool complete) { @@ -751,3 +755,26 @@ void WikiDialog::insertWikiGroups() { updateDisplay(true); } + +void WikiDialog::handleEvent_main_thread(std::shared_ptr event) +{ + // Cast to the specific Wiki event + const RsGxsWikiEvent *e = dynamic_cast(event.get()); + + if(e) { + std::cerr << "WikiDialog: Received event for group " << e->mWikiGroupId.toStdString() << std::endl; + + switch(e->mWikiEventCode) { + case RsWikiEventCode::UPDATED_COLLECTION: + updateDisplay(true); // Refresh global list + break; + case RsWikiEventCode::UPDATED_SNAPSHOT: + // Only refresh if we are currently looking at the changed group + if (e->mWikiGroupId == mGroupId) { + wikiGroupChanged(QString::fromStdString(mGroupId.toStdString())); + } + break; + } + } +} + diff --git a/retroshare-gui/src/gui/WikiPoos/WikiDialog.h b/retroshare-gui/src/gui/WikiPoos/WikiDialog.h index 7d03bca7e..6338356e4 100644 --- a/retroshare-gui/src/gui/WikiPoos/WikiDialog.h +++ b/retroshare-gui/src/gui/WikiPoos/WikiDialog.h @@ -36,6 +36,7 @@ class WikiAddDialog; class WikiEditDialog; +class UserNotify; class WikiDialog : public RsGxsUpdateBroadcastPage, public TokenResponse { @@ -54,6 +55,8 @@ public: public: virtual void updateDisplay(bool complete); + + private slots: void OpenOrShowAddPageDialog(); @@ -73,7 +76,6 @@ private slots: void unsubscribeToGroup(); void wikiGroupChanged(const QString &groupId); - void todo(); void insertWikiGroups(); private: @@ -87,6 +89,9 @@ private: std::string getSelectedPage(); const RsGxsGroupId &getSelectedGroup(); + uint32_t mEventHandlerId; + void handleEvent_main_thread(std::shared_ptr event); + // Using GroupTreeWidget. void wikiSubscribe(bool subscribe); void GroupMetaDataToGroupItemInfo(const RsGroupMetaData &groupInfo, GroupItemInfo &groupItemInfo); diff --git a/retroshare-gui/src/gui/chat/ChatDialog.cpp b/retroshare-gui/src/gui/chat/ChatDialog.cpp index 515a52065..64fd53127 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatDialog.cpp @@ -196,14 +196,14 @@ void ChatDialog::init(const ChatId &id, const QString &title) uint32_t distant_peer_status ; - if(rsMsgs->getDistantChatStatus(RsGxsId(peerId),distant_peer_status)) + if(rsChats->getDistantChatStatus(RsGxsId(peerId),distant_peer_status)) { getChat(peerId, forceFocus ? RS_CHAT_OPEN | RS_CHAT_FOCUS : RS_CHAT_OPEN ); // use own flags return ; } ChatLobbyId lid; - if (rsMsgs->isLobbyId(peerId, lid)) { + if (rsChats->isLobbyId(peerId, lid)) { getChat(peerId, (forceFocus ? (RS_CHAT_OPEN | RS_CHAT_FOCUS) : RS_CHAT_OPEN)); } diff --git a/retroshare-gui/src/gui/chat/ChatDialog.h b/retroshare-gui/src/gui/chat/ChatDialog.h index 9f173f39e..4cc46578d 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.h +++ b/retroshare-gui/src/gui/chat/ChatDialog.h @@ -26,7 +26,7 @@ #include "retroshare/rsstatus.h" #include -#include +#include #include "gui/chat/ChatWidget.h" diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 51026c946..640b38b52 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -165,11 +165,11 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi getChatWidget()->addTitleBarWidget(inviteFriendsButton) ; RsGxsId current_id; - rsMsgs->getIdentityForChatLobby(lobbyId, current_id); + rsChats->getIdentityForChatLobby(lobbyId, current_id); uint32_t idChooserFlag = IDCHOOSER_ID_REQUIRED; ChatLobbyInfo lobbyInfo ; - if(rsMsgs->getChatLobbyInfo(lobbyId,lobbyInfo)) { + if(rsChats->getChatLobbyInfo(lobbyId,lobbyInfo)) { if (lobbyInfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED) { idChooserFlag |= IDCHOOSER_NON_ANONYMOUS; } @@ -236,7 +236,7 @@ void ChatLobbyDialog::inviteFriends() { std::cerr << " " << *it << std::endl; - rsMsgs->invitePeerToLobby(mChatId.toLobbyId(),*it) ; + rsChats->invitePeerToLobby(mChatId.toLobbyId(),*it) ; } } @@ -388,7 +388,7 @@ void ChatLobbyDialog::init(const ChatId &/*id*/, const QString &/*title*/) QString title; - if(rsMsgs->getChatLobbyInfo(lobbyId,linfo)) + if(rsChats->getChatLobbyInfo(lobbyId,linfo)) { title = QString::fromUtf8(linfo.lobby_name.c_str()); @@ -403,7 +403,7 @@ void ChatLobbyDialog::init(const ChatId &/*id*/, const QString &/*title*/) ChatDialog::init(ChatId(lobbyId), title); RsGxsId gxs_id; - rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id); + rsChats->getIdentityForChatLobby(lobbyId, gxs_id); RsIdentityDetails details ; @@ -443,7 +443,7 @@ ChatLobbyDialog::~ChatLobbyDialog() // check that the lobby still exists. // announce leaving of lobby if (mChatId.isLobbyId()) - rsMsgs->sendLobbyStatusPeerLeaving(mChatId.toLobbyId()); + rsChats->sendLobbyStatusPeerLeaving(mChatId.toLobbyId()); // save settings processSettings(false); @@ -494,12 +494,12 @@ void ChatLobbyDialog::processSettings(bool load) */ void ChatLobbyDialog::setIdentity(const RsGxsId& gxs_id) { - rsMsgs->setIdentityForChatLobby(lobbyId, gxs_id) ; + rsChats->setIdentityForChatLobby(lobbyId, gxs_id) ; // get new nick name RsGxsId newid; - if (rsMsgs->getIdentityForChatLobby(lobbyId, newid)) + if (rsChats->getIdentityForChatLobby(lobbyId, newid)) { RsIdentityDetails details ; rsIdentity->getIdDetails(gxs_id,details) ; @@ -514,7 +514,7 @@ void ChatLobbyDialog::setIdentity(const RsGxsId& gxs_id) void ChatLobbyDialog::changeNickname() { RsGxsId current_id; - rsMsgs->getIdentityForChatLobby(lobbyId, current_id); + rsChats->getIdentityForChatLobby(lobbyId, current_id); RsGxsId new_id ; ownIdChooser->getChosenId(new_id) ; @@ -583,7 +583,7 @@ void ChatLobbyDialog::updateParticipantsList() { ChatLobbyInfo linfo; - if(rsMsgs->getChatLobbyInfo(lobbyId,linfo)) + if(rsChats->getChatLobbyInfo(lobbyId,linfo)) { ChatLobbyInfo cliInfo=linfo; QList qlOldParticipants=ui.participantsList->findItems("*",Qt::MatchWildcard,COLUMN_ID); @@ -643,7 +643,7 @@ void ChatLobbyDialog::updateParticipantsList() widgetitem->setIcon(COLUMN_ICON, bullet_green_128); RsGxsId gxs_id; - rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id); + rsChats->getIdentityForChatLobby(lobbyId, gxs_id); if (RsGxsId(participant.toStdString()) == gxs_id) widgetitem->setIcon(COLUMN_ICON, bullet_blue_128); @@ -739,12 +739,12 @@ void ChatLobbyDialog::distantChatParticipant() return; RsGxsId own_id; - rsMsgs->getIdentityForChatLobby(lobbyId, own_id); + rsChats->getIdentityForChatLobby(lobbyId, own_id); DistantChatPeerId tunnel_id; uint32_t error_code ; - if(! rsMsgs->initiateDistantChatConnexion(gxs_id,own_id,tunnel_id,error_code)) + if(! rsChats->initiateDistantChatConnexion(gxs_id,own_id,tunnel_id,error_code)) { QString error_str ; switch(error_code) @@ -791,7 +791,7 @@ void ChatLobbyDialog::muteParticipant(const RsGxsId& nickname) std::cerr << " Mute " << std::endl; RsGxsId gxs_id; - rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id); + rsChats->getIdentityForChatLobby(lobbyId, gxs_id); if (gxs_id!=nickname) mutedParticipants.insert(nickname); @@ -810,7 +810,7 @@ bool ChatLobbyDialog::isNicknameInLobby(const RsGxsId& nickname) { ChatLobbyInfo clinfo; - if(! rsMsgs->getChatLobbyInfo(lobbyId,clinfo)) + if(! rsChats->getChatLobbyInfo(lobbyId,clinfo)) return false ; return clinfo.gxs_ids.find(nickname) != clinfo.gxs_ids.end() ; @@ -917,7 +917,7 @@ bool ChatLobbyDialog::canClose() // check that the lobby still exists. /* TODO ChatLobbyId lid; - if (!rsMsgs->isLobbyId(getPeerId(), lid)) { + if (!rsChats->isLobbyId(getPeerId(), lid)) { return true; } */ diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp index 9a876d702..88cb479f4 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp @@ -147,7 +147,7 @@ void ChatLobbyUserNotify::iconClicked() { #if defined(Q_OS_DARWIN) std::list lobbies; - rsMsgs->getChatLobbyList(lobbies); + rsChats->getChatLobbyList(lobbies); bool doUpdate=false; for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();) @@ -160,7 +160,7 @@ void ChatLobbyUserNotify::iconClicked() ChatLobbyId clId = *lobbyIt; if (clId==itCL->first) { ChatLobbyInfo clInfo; - if (rsMsgs->getChatLobbyInfo(clId,clInfo)) + if (rsChats->getChatLobbyInfo(clId,clInfo)) strLobbyName=QString::fromUtf8(clInfo.lobby_name.c_str()) ; bFound=true; break; @@ -188,7 +188,7 @@ void ChatLobbyUserNotify::iconClicked() /// Tray icon Menu /// QMenu* trayMenu = createMenu(); std::list lobbies; - rsMsgs->getChatLobbyList(lobbies); + rsChats->getChatLobbyList(lobbies); bool doUpdate=false; for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();) @@ -202,7 +202,7 @@ void ChatLobbyUserNotify::iconClicked() ChatLobbyId clId = *lobbyIt; if (clId==itCL->first) { ChatLobbyInfo clInfo; - if (rsMsgs->getChatLobbyInfo(clId,clInfo)) + if (rsChats->getChatLobbyInfo(clId,clInfo)) strLobbyName=QString::fromUtf8(clInfo.lobby_name.c_str()) ; icoLobby=(clInfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(":/images/chat_red24.png") : FilesDefs::getIconFromQtResourcePath(":/images/chat_x24.png"); bFound=true; @@ -289,7 +289,7 @@ void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime ti bool bGetNickName = false; if (_bCheckForNickName) { RsGxsId gxs_id; - rsMsgs->getIdentityForChatLobby(lobby_id,gxs_id); + rsChats->getIdentityForChatLobby(lobby_id,gxs_id); RsIdentityDetails details ; rsIdentity->getIdDetails(gxs_id,details) ; bGetNickName = checkWord(msg, QString::fromUtf8(details.mNickname.c_str())); diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.h b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.h index 6b601aa60..9085b2078 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.h @@ -24,7 +24,7 @@ #define CHATLOBBYUSERNOTIFY_H #include "gui/common/UserNotify.h" -#include +#include #include #include diff --git a/retroshare-gui/src/gui/chat/ChatUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatUserNotify.cpp index e362c5486..7caa05685 100644 --- a/retroshare-gui/src/gui/chat/ChatUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatUserNotify.cpp @@ -28,7 +28,7 @@ #include "util/qtthreadsutils.h" #include -#include +#include static std::map waitingChats; static ChatUserNotify* instance = 0; diff --git a/retroshare-gui/src/gui/chat/ChatUserNotify.h b/retroshare-gui/src/gui/chat/ChatUserNotify.h index 209e6093b..77bf203ad 100644 --- a/retroshare-gui/src/gui/chat/ChatUserNotify.h +++ b/retroshare-gui/src/gui/chat/ChatUserNotify.h @@ -23,7 +23,7 @@ #ifndef CHATUSERNOTIFY_H #define CHATUSERNOTIFY_H -#include +#include #include "gui/common/UserNotify.h" // this class uses lots of global state diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 8d20e5d61..99b65e1f5 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include @@ -398,7 +398,7 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title) updateStatus(chatId, peerStatusInfo.status); // initialize first custom state string - QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(chatId.toPeerId()).c_str()); + QString customStateString = QString::fromUtf8(rsChats->getCustomStateString(chatId.toPeerId()).c_str()); updatePeersCustomStateString(chatId, customStateString); } else if (chatType() == CHATTYPE_DISTANT){ hist_chat_type = RS_HISTORY_TYPE_DISTANT ; @@ -517,13 +517,13 @@ uint32_t ChatWidget::maxMessageSize() case CHATTYPE_UNKNOWN: break; case CHATTYPE_PRIVATE: - maxMessageSize = rsMsgs->getMaxMessageSecuritySize(RS_CHAT_TYPE_PRIVATE); + maxMessageSize = rsChats->getMaxMessageSecuritySize(RS_CHAT_TYPE_PRIVATE); break; case CHATTYPE_LOBBY: - maxMessageSize = rsMsgs->getMaxMessageSecuritySize(RS_CHAT_TYPE_LOBBY); + maxMessageSize = rsChats->getMaxMessageSecuritySize(RS_CHAT_TYPE_LOBBY); break; case CHATTYPE_DISTANT: - maxMessageSize = rsMsgs->getMaxMessageSecuritySize(RS_CHAT_TYPE_DISTANT); + maxMessageSize = rsChats->getMaxMessageSecuritySize(RS_CHAT_TYPE_DISTANT); break; } return maxMessageSize; @@ -810,7 +810,7 @@ void ChatWidget::completeNickname(bool reverse) // Find lobby we belong to ChatLobbyInfo lobby; - if (! rsMsgs->getChatLobbyInfo(chatId.toLobbyId(),lobby)) + if (! rsChats->getChatLobbyInfo(chatId.toLobbyId(),lobby)) return; QTextCursor cursor = ui->chatTextEdit->textCursor(); @@ -905,7 +905,7 @@ QAbstractItemModel *ChatWidget::modelFromPeers() // Find lobby we belong to ChatLobbyInfo lobby ; - if(! rsMsgs->getChatLobbyInfo(chatId.toLobbyId(),lobby)) + if(! rsChats->getChatLobbyInfo(chatId.toLobbyId(),lobby)) return new QStringListModel(completer); #ifndef QT_NO_CURSOR @@ -1256,7 +1256,7 @@ void ChatWidget::updateStatusTyping() #ifdef ONLY_FOR_LINGUIST tr("is typing..."); #endif - rsMsgs->sendStatusString(chatId, "is typing..."); + rsChats->sendStatusString(chatId, "is typing..."); lastStatusSendTime = time(NULL) ; } } @@ -1322,7 +1322,7 @@ void ChatWidget::sendChat() #ifdef CHAT_DEBUG std::cout << "ChatWidget:sendChat " << std::endl; #endif - rsMsgs->sendChat(chatId, msg); + rsChats->sendChat(chatId, msg); chatWidget->clear(); // workaround for Qt bug - http://bugreports.qt.nokia.com/browse/QTBUG-2533 @@ -1673,7 +1673,7 @@ void ChatWidget::sendSticker() if (RsHtml::makeEmbeddedImage(sticker, encodedImage, 640*480, maxMessageSize() - 200)) { //-200 for the html stuff RsHtml::optimizeHtml(encodedImage, 0); std::string msg = encodedImage.toUtf8().constData(); - rsMsgs->sendChat(chatId, msg); + rsChats->sendChat(chatId, msg); } } @@ -1685,7 +1685,7 @@ void ChatWidget::clearChatHistory() if (chatType() == CHATTYPE_LOBBY) { if (notify) notify->chatLobbyCleared(chatId.toLobbyId(),""); } - rsMsgs->clearChatLobby(chatId); + rsChats->clearChatLobby(chatId); } void ChatWidget::deleteChatHistory() @@ -1847,7 +1847,7 @@ void ChatWidget::updateStatus(const ChatId& cid, RsStatusValue status) DistantChatPeerInfo dcpinfo ; RsIdentityDetails details ; - if(rsMsgs->getDistantChatStatus(chatId.toDistantChatId(),dcpinfo)) + if(rsChats->getDistantChatStatus(chatId.toDistantChatId(),dcpinfo)) { if(rsIdentity->getIdDetails(dcpinfo.to_id,details)) peerName = QString::fromUtf8( details.mNickname.c_str() ) ; diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index 5e4675ed1..e983a0349 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -29,7 +29,7 @@ #include "gui/common/RsButtonOnText.h" #include "gui/style/RSStyle.h" -#include +#include #include #include diff --git a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp index 5c3e20e01..43d3fbd38 100644 --- a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -45,7 +45,7 @@ CreateLobbyDialog::CreateLobbyDialog(const std::set& peer_list, int pr ui->headerFrame->setHeaderText(tr("Create Chat Room")); RsGxsId default_identity ; - rsMsgs->getDefaultIdentityForChatLobby(default_identity) ; + rsChats->getDefaultIdentityForChatLobby(default_identity) ; ui->idChooser_CB->loadIds(IDCHOOSER_ID_REQUIRED, default_identity); @@ -149,7 +149,7 @@ void CreateLobbyDialog::createLobby() if(ui->pgp_signed_CB->isChecked()) lobby_flags |= RS_CHAT_LOBBY_FLAGS_PGP_SIGNED ; - ChatLobbyId id = rsMsgs->createChatLobby(lobby_name,gxs_id, lobby_topic, shareList, lobby_flags); + ChatLobbyId id = rsChats->createChatLobby(lobby_name,gxs_id, lobby_topic, shareList, lobby_flags); std::cerr << "gui: Created chat room " << std::hex << id << std::dec << std::endl ; diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index fa63ce506..c8a8ac4ea 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -183,7 +183,7 @@ void PopupChatDialog::clearOfflineMessages() manualDelete = true; // TODO #ifdef REMOVE - rsMsgs->clearPrivateChatQueue(false, peerId); + rsChats->clearPrivateChatQueue(false, peerId); #endif manualDelete = false; } diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.h b/retroshare-gui/src/gui/chat/PopupChatDialog.h index 60e764628..5d8e79311 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.h @@ -26,7 +26,7 @@ #include "ui_PopupChatDialog.h" #include "ChatDialog.h" -#include +#include class PopupChatDialog : public ChatDialog { diff --git a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp index bf6d8ceb2..6ba64dcaf 100644 --- a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp @@ -38,7 +38,7 @@ #include "rshare.h" #include -#include +#include #define IMAGE_TYPING ":/images/white-bubble-64.png" @@ -134,7 +134,7 @@ void PopupChatWindow::showContextMenu(QPoint) if (ch_id.isDistantChatId()) { DistantChatPeerId dc_id = ch_id.toDistantChatId(); DistantChatPeerInfo dc_info; - if(rsMsgs->getDistantChatStatus(dc_id, dc_info)) { + if(rsChats->getDistantChatStatus(dc_id, dc_info)) { RsGxsId gxs_id = dc_info.to_id; if(!gxs_id.isNull() && !rsIdentity->isOwnId(gxs_id)) { contextMnu.addAction(votePositive); @@ -384,7 +384,7 @@ void PopupChatWindow::getAvatar() if (misc::getOpenAvatarPicture(this, ba)) { std::cerr << "Avatar image size = " << ba.size() << std::endl ; - rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()), ba.size()); // last char 0 included. + rsChats->setOwnNodeAvatarData((unsigned char *)(ba.data()), ba.size()); // last char 0 included. } } diff --git a/retroshare-gui/src/gui/chat/PopupChatWindow.h b/retroshare-gui/src/gui/chat/PopupChatWindow.h index 036df8924..71a333577 100644 --- a/retroshare-gui/src/gui/chat/PopupChatWindow.h +++ b/retroshare-gui/src/gui/chat/PopupChatWindow.h @@ -26,7 +26,7 @@ #include #include "ui_PopupChatWindow.h" #include -#include +#include #include "gui/chat/ChatWidget.h" diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp index e65ea55af..d908c4111 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp @@ -72,7 +72,7 @@ void PopupDistantChatDialog::init(const ChatId &chat_id, const QString &/*title* _tunnel_id = chat_id.toDistantChatId(); DistantChatPeerInfo tinfo; - if(!rsMsgs->getDistantChatStatus(_tunnel_id,tinfo)) + if(!rsChats->getDistantChatStatus(_tunnel_id,tinfo)) return ; RsIdentityDetails iddetails ; @@ -160,7 +160,7 @@ void PopupDistantChatDialog::handleEvent_main_thread(std::shared_ptrgetDistantChatStatus(_tunnel_id,tinfo) ; + rsChats->getDistantChatStatus(_tunnel_id,tinfo) ; if(tinfo.pending_items > 0) msg += QObject::tr("(some undelivered messages)") ; // we cannot use the pending_items count because it accounts for ACKS and keep alive packets as well. @@ -190,14 +190,14 @@ void PopupDistantChatDialog::closeEvent(QCloseEvent *e) { DistantChatPeerInfo tinfo ; - rsMsgs->getDistantChatStatus(_tunnel_id,tinfo) ; + rsChats->getDistantChatStatus(_tunnel_id,tinfo) ; if(tinfo.status != RS_DISTANT_CHAT_STATUS_REMOTELY_CLOSED) { QString msg = tr("Closing this window will end the conversation. Unsent messages will be dropped.") ; if(QMessageBox::Ok == QMessageBox::critical(NULL,tr("Close conversation?"),msg, QMessageBox::Ok | QMessageBox::Cancel)) - rsMsgs->closeDistantChatConnexion(_tunnel_id) ; + rsChats->closeDistantChatConnexion(_tunnel_id) ; else { e->ignore() ; @@ -214,7 +214,7 @@ QString PopupDistantChatDialog::getPeerName(const ChatId& /*id*/, QString& addit { DistantChatPeerInfo tinfo; - rsMsgs->getDistantChatStatus(_tunnel_id,tinfo) ; + rsChats->getDistantChatStatus(_tunnel_id,tinfo) ; additional_info = QString("Identity ID: ") + QString::fromStdString(tinfo.to_id.toStdString()); @@ -229,7 +229,7 @@ QString PopupDistantChatDialog::getOwnName() const { DistantChatPeerInfo tinfo; - rsMsgs->getDistantChatStatus(_tunnel_id,tinfo) ; + rsChats->getDistantChatStatus(_tunnel_id,tinfo) ; RsIdentityDetails details ; if(rsIdentity->getIdDetails(tinfo.own_id,details)) diff --git a/retroshare-gui/src/gui/common/AvatarDefs.cpp b/retroshare-gui/src/gui/common/AvatarDefs.cpp index d0804b13f..608e6e285 100644 --- a/retroshare-gui/src/gui/common/AvatarDefs.cpp +++ b/retroshare-gui/src/gui/common/AvatarDefs.cpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include #include @@ -34,7 +34,7 @@ void AvatarDefs::getOwnAvatar(QPixmap &avatar, const QString& defaultImage) int size = 0; /* get avatar */ - rsMsgs->getOwnAvatarData(data, size); + rsChats->getOwnNodeAvatarData(data, size); if (size == 0) { avatar = FilesDefs::getPixmapFromQtResourcePath(defaultImage); @@ -52,7 +52,7 @@ bool AvatarDefs::getAvatarFromSslId(const RsPeerId& sslId, QPixmap &avatar, cons int size = 0; /* get avatar */ - rsMsgs->getAvatarData(RsPeerId(sslId), data, size); + rsChats->getAvatarData(RsPeerId(sslId), data, size); if (size == 0) { if (!defaultImage.isEmpty()) { avatar = FilesDefs::getPixmapFromQtResourcePath(defaultImage); @@ -94,14 +94,14 @@ bool AvatarDefs::getAvatarFromGpgId(const RsPgpId& gpgId, QPixmap &avatar, const if (gpgId == rsPeers->getGPGOwnId()) { /* Its me */ - rsMsgs->getOwnAvatarData(data,size); + rsChats->getOwnNodeAvatarData(data,size); } else { /* get the first available avatar of one of the ssl ids */ std::list sslIds; if (rsPeers->getAssociatedSSLIds(gpgId, sslIds)) { std::list::iterator sslId; for (sslId = sslIds.begin(); sslId != sslIds.end(); ++sslId) { - rsMsgs->getAvatarData(*sslId, data, size); + rsChats->getAvatarData(*sslId, data, size); if (size) { break; } diff --git a/retroshare-gui/src/gui/common/AvatarWidget.cpp b/retroshare-gui/src/gui/common/AvatarWidget.cpp index e7c793479..5aa2effe7 100644 --- a/retroshare-gui/src/gui/common/AvatarWidget.cpp +++ b/retroshare-gui/src/gui/common/AvatarWidget.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "util/misc.h" #include "util/qtthreadsutils.h" @@ -124,7 +124,7 @@ void AvatarWidget::mouseReleaseEvent(QMouseEvent */*event*/) QByteArray newAvatar; dialog.getAvatar(newAvatar); - rsMsgs->setOwnAvatarData((unsigned char *)(newAvatar.data()), newAvatar.size()) ; // last char 0 included. + rsChats->setOwnNodeAvatarData((unsigned char *)(newAvatar.data()), newAvatar.size()) ; // last char 0 included. } } @@ -226,7 +226,7 @@ void AvatarWidget::refreshStatus() { DistantChatPeerInfo dcpinfo ; - if(rsMsgs->getDistantChatStatus(mId.toDistantChatId(),dcpinfo)) + if(rsChats->getDistantChatStatus(mId.toDistantChatId(),dcpinfo)) { switch (dcpinfo.status) { @@ -321,7 +321,7 @@ void AvatarWidget::refreshAvatarImage() DistantChatPeerInfo dcpinfo ; - if(rsMsgs->getDistantChatStatus(mId.toDistantChatId(),dcpinfo)) + if(rsChats->getDistantChatStatus(mId.toDistantChatId(),dcpinfo)) { if(mFlag.isOwnId) AvatarDefs::getAvatarFromGxsId(dcpinfo.own_id, avatar, defaultAvatar); diff --git a/retroshare-gui/src/gui/common/AvatarWidget.h b/retroshare-gui/src/gui/common/AvatarWidget.h index 86ff0a610..05c8c5017 100644 --- a/retroshare-gui/src/gui/common/AvatarWidget.h +++ b/retroshare-gui/src/gui/common/AvatarWidget.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include namespace Ui { diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index 5418b8e10..5c9d3a43b 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -35,7 +35,7 @@ #include "gui/gxs/GxsIdDetails.h" #include "gui/gxs/GxsIdTreeWidgetItem.h" #include "retroshare/rsexpr.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rschats.h" //#define DEBUG_MODEL //#define DEBUG_MODEL_INDEX @@ -775,7 +775,7 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const return QVariant(QString::fromStdString(node->node_info.id.toStdString())); { - std::string css = rsMsgs->getCustomStateString(node->node_info.id); + std::string css = rsChats->getCustomStateString(node->node_info.id); if (mDisplayStatusString) if(!css.empty()) diff --git a/retroshare-gui/src/gui/common/FriendListModel.h b/retroshare-gui/src/gui/common/FriendListModel.h index 4020e6fc7..17bbabd35 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.h +++ b/retroshare-gui/src/gui/common/FriendListModel.h @@ -24,7 +24,8 @@ #include #include "retroshare/rsstatus.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rschats.h" +#include "retroshare/rsmail.h" #include "retroshare/rspeers.h" typedef uint32_t ForumModelIndex; diff --git a/retroshare-gui/src/gui/common/PeerDefs.cpp b/retroshare-gui/src/gui/common/PeerDefs.cpp index a1fcf3364..369dfe7ba 100644 --- a/retroshare-gui/src/gui/common/PeerDefs.cpp +++ b/retroshare-gui/src/gui/common/PeerDefs.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "PeerDefs.h" diff --git a/retroshare-gui/src/gui/common/TagDefs.cpp b/retroshare-gui/src/gui/common/TagDefs.cpp index ca4d617c0..4dcea8fa0 100644 --- a/retroshare-gui/src/gui/common/TagDefs.cpp +++ b/retroshare-gui/src/gui/common/TagDefs.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "TagDefs.h" diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index 32eeaebae..a042d55b3 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -163,7 +163,7 @@ void ConfCertDialog::load() ui.version->setText(QString::fromStdString(version)); /* Custom state string */ - QString statustring = QString::fromUtf8(rsMsgs->getCustomStateString(detail.id).c_str()); + QString statustring = QString::fromUtf8(rsChats->getCustomStateString(detail.id).c_str()); ui.statusmessage->setText(statustring); diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index ce410f47e..b18a294db 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include diff --git a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp index fdbd678d8..0309486eb 100644 --- a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp @@ -31,7 +31,7 @@ #include "gui/settings/rsharesettings.h" -#include +#include #include #include "gui/msgs/MessageInterface.h" @@ -43,6 +43,8 @@ * #define DEBUG_ITEM 1 ****/ +using namespace Rs::Mail; + /** Constructor */ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, const std::string &message) : FeedItem(parent,feedId,NULL), mPeerId(peerId) diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index f1e7a8a69..9e8fa4da2 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -32,7 +32,8 @@ #include "gui/common/FilesDefs.h" #include "util/qtthreadsutils.h" -#include +#include +#include #include #include @@ -42,6 +43,8 @@ * #define DEBUG_ITEM 1 ****/ +using namespace Rs::Mail; + /** Constructor */ MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, const std::string &msgId, bool isHome) : FeedItem(parent,feedId,NULL), mMsgId(msgId), mIsHome(isHome) @@ -122,6 +125,7 @@ void MsgItem::handleEvent_main_thread(std::shared_ptr event) case RsMailStatusEventCode::TAG_CHANGED: case RsMailStatusEventCode::MESSAGE_RECEIVED_ACK: case RsMailStatusEventCode::SIGNATURE_FAILED: + default: break; } } diff --git a/retroshare-gui/src/gui/feeds/PeerItem.cpp b/retroshare-gui/src/gui/feeds/PeerItem.cpp index 3dc7c4901..12cc594a1 100644 --- a/retroshare-gui/src/gui/feeds/PeerItem.cpp +++ b/retroshare-gui/src/gui/feeds/PeerItem.cpp @@ -31,7 +31,7 @@ #include "util/qtthreadsutils.h" #include "util/DateTime.h" -#include +#include #include #include diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index 4d21440a4..c0d352860 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -35,7 +35,7 @@ #include "util/DateTime.h" #include "util/qtthreadsutils.h" -#include +#include #include /***** diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h index 0ebf2353e..cfe77472c 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include "gui/chat/ChatStyle.h" #include "ui_ImHistoryBrowser.h" diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index de8863449..015fbbbeb 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include #include @@ -99,6 +99,8 @@ static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000; +using namespace Rs::Mail; + class MessageItemDelegate : public QItemDelegate { public: @@ -678,7 +680,7 @@ void MessageComposer::addConnectAttemptMsg(const RsPgpId &gpgId, const RsPeerId std::list msgList; std::list::const_iterator it; - rsMail->getMessageSummaries(Rs::Msgs::BoxName::BOX_INBOX,msgList); + rsMail->getMessageSummaries(Rs::Mail::BoxName::BOX_INBOX,msgList); // do not re-add an existing request. // note: the test with name() is very unsecure. We should use the ID instead. @@ -1502,7 +1504,7 @@ bool MessageComposer::buildMessage(MessageInfo& mi) } if(!at_least_one_gxsid) - mi.from = Rs::Msgs::MsgAddress(rsPeers->getOwnId(),MsgAddress::MSG_ADDRESS_MODE_TO); + mi.from = Rs::Mail::MsgAddress(rsPeers->getOwnId(),MsgAddress::MSG_ADDRESS_MODE_TO); else { auto gxs_id_from = RsGxsId(ui.respond_to_CB->itemData(ui.respond_to_CB->currentIndex()).toString().toStdString()); diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.h b/retroshare-gui/src/gui/msgs/MessageComposer.h index 180840208..c182701eb 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.h +++ b/retroshare-gui/src/gui/msgs/MessageComposer.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include "ui_MessageComposer.h" @@ -172,8 +172,8 @@ private slots: void checkLength(); private: - static QString buildReplyHeader(const MessageInfo &msgInfo); - bool buildMessage(MessageInfo& mi); + static QString buildReplyHeader(const Rs::Mail::MessageInfo &msgInfo); + bool buildMessage(Rs::Mail::MessageInfo& mi); void processSettings(bool bLoad); diff --git a/retroshare-gui/src/gui/msgs/MessageInterface.h b/retroshare-gui/src/gui/msgs/MessageInterface.h index 77cf4b534..81af45171 100644 --- a/retroshare-gui/src/gui/msgs/MessageInterface.h +++ b/retroshare-gui/src/gui/msgs/MessageInterface.h @@ -29,23 +29,6 @@ * */ -#define USE_OLD_MAIL 1 - -#ifdef USE_OLD_MAIL - - #include - - using namespace Rs::Msgs; - - #define rsMail rsMsgs - -#else - - #include - - using namespace Rs::Mail; - -#endif - +#include #endif // MRK_MESSAGE_INTERFACE diff --git a/retroshare-gui/src/gui/msgs/MessageModel.cpp b/retroshare-gui/src/gui/msgs/MessageModel.cpp index 17185771b..8b52f8183 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.cpp +++ b/retroshare-gui/src/gui/msgs/MessageModel.cpp @@ -34,10 +34,12 @@ #include "gui/gxs/GxsIdTreeWidgetItem.h" #include "MessageModel.h" #include "retroshare/rsexpr.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rsmail.h" //#define DEBUG_MESSAGE_MODEL +using namespace Rs::Mail; + #define IS_MESSAGE_UNREAD(flags) (flags & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER)) #define IMAGE_STAR_ON ":/images/star-on-16.png" @@ -53,7 +55,7 @@ const QString RsMessageModel::FilterString("filtered"); RsMessageModel::RsMessageModel(QObject *parent) : QAbstractItemModel(parent) { - mCurrentBox = Rs::Msgs::BoxName::BOX_NONE; + mCurrentBox = Rs::Mail::BoxName::BOX_NONE; mQuickViewFilter = QUICK_VIEW_ALL; mFilterType = FILTER_TYPE_NONE; mFilterStrings.clear(); @@ -92,7 +94,7 @@ int RsMessageModel::columnCount(const QModelIndex &/*parent*/) const return COLUMN_THREAD_NB_COLUMNS; } -bool RsMessageModel::getMessageData(const QModelIndex& i,Rs::Msgs::MessageInfo& fmpe) const +bool RsMessageModel::getMessageData(const QModelIndex& i,Rs::Mail::MessageInfo& fmpe) const { if(!i.isValid()) return true; @@ -103,7 +105,7 @@ bool RsMessageModel::getMessageData(const QModelIndex& i,Rs::Msgs::MessageInfo& if(!convertInternalIdToMsgIndex(ref,index) || index >= mMessages.size()) return false ; - return rsMsgs->getMessage(mMessages[index].msgId,fmpe); + return rsMail->getMessage(mMessages[index].msgId,fmpe); } bool RsMessageModel::hasChildren(const QModelIndex &parent) const @@ -245,7 +247,7 @@ QVariant RsMessageModel::data(const QModelIndex &index, int role) const return QVariant() ; } - const Rs::Msgs::MsgInfoSummary& fmpe(mMessages[entry]); + const Rs::Mail::MsgInfoSummary& fmpe(mMessages[entry]); if(role == Qt::FontRole) { @@ -288,10 +290,10 @@ QVariant RsMessageModel::data(const QModelIndex &index, int role) const } } -QVariant RsMessageModel::textColorRole(const Rs::Msgs::MsgInfoSummary& fmpe,int /*column*/) const +QVariant RsMessageModel::textColorRole(const Rs::Mail::MsgInfoSummary& fmpe,int /*column*/) const { - Rs::Msgs::MsgTagType tags; - rsMsgs->getMessageTagTypes(tags); + Rs::Mail::MsgTagType tags; + rsMail->getMessageTagTypes(tags); for(auto it(fmpe.msgtags.begin());it!=fmpe.msgtags.end();++it) for(auto it2(tags.types.begin());it2!=tags.types.end();++it2) @@ -301,7 +303,7 @@ QVariant RsMessageModel::textColorRole(const Rs::Msgs::MsgInfoSummary& fmpe,int return QVariant(); } -QVariant RsMessageModel::statusRole(const Rs::Msgs::MsgInfoSummary& /*fmpe*/,int /*column*/) const +QVariant RsMessageModel::statusRole(const Rs::Mail::MsgInfoSummary& /*fmpe*/,int /*column*/) const { // if(column != COLUMN_THREAD_DATA) // return QVariant(); @@ -309,7 +311,7 @@ QVariant RsMessageModel::statusRole(const Rs::Msgs::MsgInfoSummary& /*fmpe*/,int return QVariant();//fmpe.mMsgStatus); } -bool RsMessageModel::passesFilter(const Rs::Msgs::MsgInfoSummary& fmpe,int /*column*/) const +bool RsMessageModel::passesFilter(const Rs::Mail::MsgInfoSummary& fmpe,int /*column*/) const { QString s ; bool passes_strings = true ; @@ -333,8 +335,8 @@ bool RsMessageModel::passesFilter(const Rs::Msgs::MsgInfoSummary& fmpe,int /*col case FILTER_TYPE_DATE: s = displayRole(fmpe,COLUMN_THREAD_DATE).toString(); break; case FILTER_TYPE_CONTENT: { - Rs::Msgs::MessageInfo minfo; - rsMsgs->getMessage(fmpe.msgId,minfo); + Rs::Mail::MessageInfo minfo; + rsMail->getMessage(fmpe.msgId,minfo); s = QTextDocument(QString::fromUtf8(minfo.msg.c_str())).toPlainText(); } break; @@ -343,8 +345,8 @@ bool RsMessageModel::passesFilter(const Rs::Msgs::MsgInfoSummary& fmpe,int /*col case FILTER_TYPE_ATTACHMENTS: { - Rs::Msgs::MessageInfo minfo; - rsMsgs->getMessage(fmpe.msgId,minfo); + Rs::Mail::MessageInfo minfo; + rsMail->getMessage(fmpe.msgId,minfo); for(auto it(minfo.files.begin());it!=minfo.files.end();++it) s += QString::fromUtf8((*it).fname.c_str())+" "; @@ -375,7 +377,7 @@ bool RsMessageModel::passesFilter(const Rs::Msgs::MsgInfoSummary& fmpe,int /*col return passes_quick_view && passes_strings; } -QVariant RsMessageModel::filterRole(const Rs::Msgs::MsgInfoSummary& fmpe,int column) const +QVariant RsMessageModel::filterRole(const Rs::Mail::MsgInfoSummary& fmpe,int column) const { if(passesFilter(fmpe,column)) return QVariant(FilterString); @@ -414,7 +416,7 @@ void RsMessageModel::setFont(const QFont &font) } } -QVariant RsMessageModel::toolTipRole(const Rs::Msgs::MsgInfoSummary& fmpe,int column) const +QVariant RsMessageModel::toolTipRole(const Rs::Mail::MsgInfoSummary& fmpe,int column) const { if(column == COLUMN_THREAD_AUTHOR || column == COLUMN_THREAD_TO) { @@ -443,7 +445,7 @@ QVariant RsMessageModel::toolTipRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co return QVariant(); } -QVariant RsMessageModel::backgroundRole(const Rs::Msgs::MsgInfoSummary &/*fmpe*/, int /*column*/) const +QVariant RsMessageModel::backgroundRole(const Rs::Mail::MsgInfoSummary &/*fmpe*/, int /*column*/) const { return QVariant(); } @@ -462,12 +464,12 @@ QVariant RsMessageModel::sizeHintRole(int col) const } } -QVariant RsMessageModel::authorRole(const Rs::Msgs::MsgInfoSummary& /*fmpe*/,int /*column*/) const +QVariant RsMessageModel::authorRole(const Rs::Mail::MsgInfoSummary& /*fmpe*/,int /*column*/) const { return QVariant(); } -QVariant RsMessageModel::sortRole(const Rs::Msgs::MsgInfoSummary& fmpe,int column) const +QVariant RsMessageModel::sortRole(const Rs::Mail::MsgInfoSummary& fmpe,int column) const { switch(column) { @@ -493,7 +495,7 @@ QVariant RsMessageModel::sortRole(const Rs::Msgs::MsgInfoSummary& fmpe,int colum } } -QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int col) const +QVariant RsMessageModel::displayRole(const Rs::Mail::MsgInfoSummary& fmpe,int col) const { switch(col) { @@ -511,11 +513,11 @@ QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co case COLUMN_THREAD_TAGS:{ // Tags - Rs::Msgs::MsgTagInfo tagInfo; - rsMsgs->getMessageTag(fmpe.msgId, tagInfo); + Rs::Mail::MsgTagInfo tagInfo; + rsMail->getMessageTag(fmpe.msgId, tagInfo); - Rs::Msgs::MsgTagType Tags; - rsMsgs->getMessageTagTypes(Tags); + Rs::Mail::MsgTagType Tags; + rsMail->getMessageTagTypes(Tags); QString text; @@ -539,9 +541,9 @@ QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co switch(mCurrentBox) { - case Rs::Msgs::BoxName::BOX_DRAFTS: // in this case, we display the full list of destinations - case Rs::Msgs::BoxName::BOX_TRASH: // in this case, we display the full list of destinations - case Rs::Msgs::BoxName::BOX_SENT: // in this case, we display the full list of destinations + case Rs::Mail::BoxName::BOX_DRAFTS: // in this case, we display the full list of destinations + case Rs::Mail::BoxName::BOX_TRASH: // in this case, we display the full list of destinations + case Rs::Mail::BoxName::BOX_SENT: // in this case, we display the full list of destinations { for(auto d:fmpe.destinations) { @@ -556,9 +558,9 @@ QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co return name; } break; - case Rs::Msgs::BoxName::BOX_NONE: // in these cases, we display the actual destination - case Rs::Msgs::BoxName::BOX_INBOX: // in these cases, we display the actual destination - case Rs::Msgs::BoxName::BOX_OUTBOX: + case Rs::Mail::BoxName::BOX_NONE: // in these cases, we display the actual destination + case Rs::Mail::BoxName::BOX_INBOX: // in these cases, we display the actual destination + case Rs::Mail::BoxName::BOX_OUTBOX: { RsGxsId id = RsGxsId(fmpe.to.toStdString()); // use "to" field, which is populated in Outbox, . if(id.isNull()) @@ -592,7 +594,7 @@ QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co return QVariant("[ERROR]"); } -QVariant RsMessageModel::userRole(const Rs::Msgs::MsgInfoSummary& fmpe,int col) const +QVariant RsMessageModel::userRole(const Rs::Mail::MsgInfoSummary& fmpe,int col) const { switch(col) { @@ -615,7 +617,7 @@ QVariant RsMessageModel::userRole(const Rs::Msgs::MsgInfoSummary& fmpe,int col) } } -QVariant RsMessageModel::decorationRole(const Rs::Msgs::MsgInfoSummary& fmpe,int col) const +QVariant RsMessageModel::decorationRole(const Rs::Mail::MsgInfoSummary& fmpe,int col) const { bool exist=false; switch(col) @@ -674,7 +676,7 @@ void RsMessageModel::clear() emit messagesLoaded(); } -void RsMessageModel::setMessages(const std::list& msgs) +void RsMessageModel::setMessages(const std::list& msgs) { clear(); @@ -700,7 +702,7 @@ void RsMessageModel::setMessages(const std::list& msgs emit messagesLoaded(); } -void RsMessageModel::setCurrentBox(Rs::Msgs::BoxName bn) +void RsMessageModel::setCurrentBox(Rs::Mail::BoxName bn) { if(mCurrentBox != bn) { @@ -709,7 +711,7 @@ void RsMessageModel::setCurrentBox(Rs::Msgs::BoxName bn) } } -Rs::Msgs::BoxName RsMessageModel::currentBox() const +Rs::Mail::BoxName RsMessageModel::currentBox() const { return mCurrentBox; } @@ -732,9 +734,9 @@ void RsMessageModel::updateMessages() { emit messagesAboutToLoad(); - std::list msgs; + std::list msgs; - rsMsgs->getMessageSummaries(mCurrentBox,msgs); + rsMail->getMessageSummaries(mCurrentBox,msgs); setMessages(msgs); emit messagesLoaded(); @@ -746,7 +748,7 @@ void RsMessageModel::setMsgReadStatus(const QModelIndex& i,bool read_status) return ; preMods(); - rsMsgs->MessageRead(i.data(MsgIdRole).toString().toStdString(),!read_status); + rsMail->MessageRead(i.data(MsgIdRole).toString().toStdString(),!read_status); emit dataChanged(i,i); } @@ -766,7 +768,7 @@ void RsMessageModel::setMsgsReadStatus(const QModelIndexList& mil,bool read_stat preMods(); for(auto& it : list) - rsMsgs->MessageRead(it,!read_status); + rsMail->MessageRead(it,!read_status); emit dataChanged(createIndex(start,0),createIndex(stop,RsMessageModel::columnCount()-1)); } @@ -777,7 +779,7 @@ void RsMessageModel::setMsgStar(const QModelIndex& i,bool star) return ; preMods(); - rsMsgs->MessageStar(i.data(MsgIdRole).toString().toStdString(),star); + rsMail->MessageStar(i.data(MsgIdRole).toString().toStdString(),star); emit dataChanged(i,i); } @@ -797,7 +799,7 @@ void RsMessageModel::setMsgsStar(const QModelIndexList& mil,bool star) preMods(); for(auto& it : list) - rsMsgs->MessageStar(it,star); + rsMail->MessageStar(it,star); emit dataChanged(createIndex(start,0),createIndex(stop,RsMessageModel::columnCount()-1)); } @@ -808,7 +810,7 @@ void RsMessageModel::setMsgJunk(const QModelIndex& i,bool junk) return ; preMods(); - rsMsgs->MessageJunk(i.data(MsgIdRole).toString().toStdString(),junk); + rsMail->MessageJunk(i.data(MsgIdRole).toString().toStdString(),junk); emit dataChanged(i,i); } @@ -828,7 +830,7 @@ void RsMessageModel::setMsgsJunk(const QModelIndexList& mil,bool junk) preMods(); for(auto& it : list) - rsMsgs->MessageJunk(it,junk); + rsMail->MessageJunk(it,junk); emit dataChanged(createIndex(start,0),createIndex(stop,RsMessageModel::columnCount()-1)); } diff --git a/retroshare-gui/src/gui/msgs/MessageModel.h b/retroshare-gui/src/gui/msgs/MessageModel.h index 3bbd6ee31..e938aa72e 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.h +++ b/retroshare-gui/src/gui/msgs/MessageModel.h @@ -24,7 +24,7 @@ #include #include -#include "retroshare/rsmsgs.h" +#include "retroshare/rsmail.h" // This class holds the actual hierarchy of posts, represented by identifiers // It is responsible for auto-updating when necessary and holds a mutex to allow the Model to @@ -61,7 +61,7 @@ public: enum QuickViewFilter { QUICK_VIEW_ALL = 0x00, - QUICK_VIEW_IMPORTANT = 0x01, // These numbers have been carefuly chosen to match the ones in rsmsgs.h + QUICK_VIEW_IMPORTANT = 0x01, // These numbers have been carefuly chosen to match the ones in rsmail.h QUICK_VIEW_WORK = 0x02, QUICK_VIEW_PERSONAL = 0x03, QUICK_VIEW_TODO = 0x04, @@ -75,7 +75,7 @@ public: enum FilterType { FILTER_TYPE_NONE = 0x00, - FILTER_TYPE_SUBJECT = 0x01, // These numbers have been carefuly chosen to match the ones in rsmsgs.h + FILTER_TYPE_SUBJECT = 0x01, // These numbers have been carefuly chosen to match the ones in rsmail.h FILTER_TYPE_FROM = 0x02, FILTER_TYPE_TO = 0x03, FILTER_TYPE_DATE = 0x04, @@ -100,8 +100,8 @@ public: // This method will asynchroneously update the data - void setCurrentBox(Rs::Msgs::BoxName bn) ; - Rs::Msgs::BoxName currentBox() const ; + void setCurrentBox(Rs::Mail::BoxName bn) ; + Rs::Mail::BoxName currentBox() const ; void setQuickViewFilter(QuickViewFilter fn) ; void setFilter(FilterType filter_type, const QStringList& strings) ; @@ -118,22 +118,22 @@ public: QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - bool getMessageData(const QModelIndex& i,Rs::Msgs::MessageInfo& fmpe) const; + bool getMessageData(const QModelIndex& i,Rs::Mail::MessageInfo& fmpe) const; void clear() ; QVariant sizeHintRole (int col) const; - QVariant displayRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant decorationRole(const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant toolTipRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant userRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant statusRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant authorRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant sortRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant fontRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant filterRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant textColorRole (const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; - QVariant backgroundRole(const Rs::Msgs::MsgInfoSummary& fmpe, int col) const; + QVariant displayRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant decorationRole(const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant toolTipRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant userRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant statusRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant authorRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant sortRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant fontRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant filterRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant textColorRole (const Rs::Mail::MsgInfoSummary& fmpe, int col) const; + QVariant backgroundRole(const Rs::Mail::MsgInfoSummary& fmpe, int col) const; #ifdef DEBUG_MESSAGE_MODEL /*! @@ -159,7 +159,7 @@ signals: void messagesAboutToLoad(); private: - bool passesFilter(const Rs::Msgs::MsgInfoSummary& fmpe,int column) const; + bool passesFilter(const Rs::Mail::MsgInfoSummary& fmpe,int column) const; void preMods() ; void postMods() ; @@ -174,7 +174,7 @@ private: uint32_t updateFilterStatus(ForumModelIndex i,int column,const QStringList& strings); - void setMessages(const std::list& msgs); + void setMessages(const std::list& msgs); QColor mTextColorRead ; QColor mTextColorUnread ; @@ -182,12 +182,12 @@ private: QColor mTextColorNotSubscribed ; QColor mTextColorMissing ; - Rs::Msgs::BoxName mCurrentBox ; + Rs::Mail::BoxName mCurrentBox ; QuickViewFilter mQuickViewFilter ; QStringList mFilterStrings; FilterType mFilterType; QFont mFont; - std::vector mMessages; + std::vector mMessages; std::map mMessagesMap; }; diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index 2f81b749d..540196ab5 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include /* Images for context menu icons */ #define IMAGE_DOWNLOAD ":/icons/png/download.png" @@ -62,6 +62,8 @@ #include "gui/msgs/MessageInterface.h" +using namespace Rs::Mail; + class RsHtmlMsg : public RsHtml { public: @@ -687,7 +689,7 @@ void MessageWidget::fill(const std::string &msgId) // link.createMessage(ownId, ""); // } - if(msgInfo.from.type()==Rs::Msgs::MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) // distant message + if(msgInfo.from.type()==Rs::Mail::MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) // distant message { tooltip_string = PeerDefs::rsidFromId(msgInfo.from.toGxsId()) ; link = RetroShareLink::createMessage(msgInfo.from.toGxsId(), ""); diff --git a/retroshare-gui/src/gui/msgs/MessageWindow.cpp b/retroshare-gui/src/gui/msgs/MessageWindow.cpp index 0c9abf2a2..2be440116 100644 --- a/retroshare-gui/src/gui/msgs/MessageWindow.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWindow.cpp @@ -25,10 +25,12 @@ #include "TagsMenu.h" #include "gui/settings/rsharesettings.h" -#include +#include #include "gui/msgs/MessageInterface.h" +using namespace Rs::Mail; + /** Constructor */ MessageWindow::MessageWindow(QWidget *parent, Qt::WindowFlags flags) : RWindow("MessageWindow", parent, flags) diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index f678adeb4..1adae858c 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -49,7 +49,7 @@ #include "util/RsProtectedTimer.h" #include -#include +#include #include @@ -96,6 +96,8 @@ // #define DEBUG_MESSAGES_DIALOG 1 +using namespace Rs::Mail; + class MessageSortFilterProxyModel: public QSortFilterProxyModel { public: @@ -929,18 +931,18 @@ void MessagesDialog::changeBox(int box_row) QString placeholderText = tr("No message available in your %1.").arg(item->text()); switch(box_row) { - case ROW_INBOX: mMessageModel->setCurrentBox(Rs::Msgs::BoxName::BOX_INBOX ); + case ROW_INBOX: mMessageModel->setCurrentBox(Rs::Mail::BoxName::BOX_INBOX ); break; - case ROW_OUTBOX: mMessageModel->setCurrentBox(Rs::Msgs::BoxName::BOX_OUTBOX); + case ROW_OUTBOX: mMessageModel->setCurrentBox(Rs::Mail::BoxName::BOX_OUTBOX); break; - case ROW_DRAFTBOX: mMessageModel->setCurrentBox(Rs::Msgs::BoxName::BOX_DRAFTS); + case ROW_DRAFTBOX: mMessageModel->setCurrentBox(Rs::Mail::BoxName::BOX_DRAFTS); break; - case ROW_SENTBOX: mMessageModel->setCurrentBox(Rs::Msgs::BoxName::BOX_SENT ); + case ROW_SENTBOX: mMessageModel->setCurrentBox(Rs::Mail::BoxName::BOX_SENT ); break; - case ROW_TRASHBOX: mMessageModel->setCurrentBox(Rs::Msgs::BoxName::BOX_TRASH ); + case ROW_TRASHBOX: mMessageModel->setCurrentBox(Rs::Mail::BoxName::BOX_TRASH ); break; default: - mMessageModel->setCurrentBox(Rs::Msgs::BoxName::BOX_NONE); + mMessageModel->setCurrentBox(Rs::Mail::BoxName::BOX_NONE); } insertMsgTxtAndFiles(ui.messageTreeWidget->currentIndex()); @@ -955,7 +957,7 @@ void MessagesDialog::changeBox(int box_row) } else { - mMessageModel->setCurrentBox(Rs::Msgs::BoxName::BOX_NONE); + mMessageModel->setCurrentBox(Rs::Mail::BoxName::BOX_NONE); } inChange = false; @@ -1320,7 +1322,7 @@ void MessagesDialog::updateMessageSummaryList() /* calculating the new messages */ std::list msgList; - rsMail->getMessageSummaries(Rs::Msgs::BoxName::BOX_ALL,msgList); + rsMail->getMessageSummaries(Rs::Mail::BoxName::BOX_ALL,msgList); QMap tagCount; @@ -1566,8 +1568,8 @@ void MessagesDialog::tagSet(int tagId, bool set) void MessagesDialog::emptyTrash() { - std::list msgs ; - rsMsgs->getMessageSummaries(Rs::Msgs::BoxName::BOX_TRASH,msgs); + std::list msgs ; + rsMail->getMessageSummaries(Rs::Mail::BoxName::BOX_TRASH,msgs); for(auto it(msgs.begin());it!=msgs.end();++it) rsMail->MessageDelete(it->msgId); diff --git a/retroshare-gui/src/gui/msgs/TagsMenu.cpp b/retroshare-gui/src/gui/msgs/TagsMenu.cpp index 986416514..46a0ff943 100644 --- a/retroshare-gui/src/gui/msgs/TagsMenu.cpp +++ b/retroshare-gui/src/gui/msgs/TagsMenu.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include "TagsMenu.h" #include "gui/common/TagDefs.h" @@ -42,6 +42,8 @@ #define ACTION_TAGS_TAG 1 #define ACTION_TAGS_NEWTAG 2 +using namespace Rs::Mail; + TagsMenu::TagsMenu(const QString &title, QWidget *parent) : QMenu (title, parent) { diff --git a/retroshare-gui/src/gui/profile/StatusMessage.cpp b/retroshare-gui/src/gui/profile/StatusMessage.cpp index 723fe77ce..4ef888c05 100644 --- a/retroshare-gui/src/gui/profile/StatusMessage.cpp +++ b/retroshare-gui/src/gui/profile/StatusMessage.cpp @@ -20,7 +20,7 @@ #include "StatusMessage.h" -#include +#include /** Default constructor */ StatusMessage::StatusMessage(QWidget *parent) @@ -32,13 +32,13 @@ StatusMessage::StatusMessage(QWidget *parent) connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(save())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close())); - ui.txt_StatusMessage->setText(QString::fromUtf8(rsMsgs->getCustomStateString().c_str())); + ui.txt_StatusMessage->setText(QString::fromUtf8(rsChats->getOwnCustomStateString().c_str())); } /** Saves the changes on this page */ void StatusMessage::save() { - rsMsgs->setCustomStateString(ui.txt_StatusMessage->text().toUtf8().constData()); + rsChats->setCustomStateString(ui.txt_StatusMessage->text().toUtf8().constData()); accept(); } diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 344257480..91c2d6774 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -30,7 +30,7 @@ #include "retroshare/rsconfig.h" #include "retroshare/rshistory.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rschats.h" #include "retroshare/rspeers.h" #include @@ -153,7 +153,7 @@ void ChatPage::updateDefaultLobbyIdentity() { case GxsIdChooser::KnowId: case GxsIdChooser::UnKnowId: - rsMsgs->setDefaultIdentityForChatLobby(chosen_id) ; + rsChats->setDefaultIdentityForChatLobby(chosen_id) ; break ; default:; @@ -395,7 +395,7 @@ ChatPage::load() // state of distant Chat combobox - switch(rsMsgs->getDistantChatPermissionFlags()) + switch(rsChats->getDistantChatPermissionFlags()) { default: case RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NONE: @@ -466,7 +466,7 @@ ChatPage::load() historyStylePath = loadStyleInfo(ChatStyle::TYPE_HISTORY, ui.historyStyle, ui.historyComboBoxVariant, historyStyleVariant); RsGxsId gxs_id ; - rsMsgs->getDefaultIdentityForChatLobby(gxs_id) ; + rsChats->getDefaultIdentityForChatLobby(gxs_id) ; ui.chatLobbyIdentity_IC->setFlags(IDCHOOSER_ID_REQUIRED) ; @@ -700,13 +700,13 @@ void ChatPage::distantChatComboBoxChanged(int i) switch(i) { default: - case 0: rsMsgs->setDistantChatPermissionFlags(RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NONE) ; + case 0: rsChats->setDistantChatPermissionFlags(RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NONE) ; break ; - case 1: rsMsgs->setDistantChatPermissionFlags(RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS) ; + case 1: rsChats->setDistantChatPermissionFlags(RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS) ; break ; - case 2: rsMsgs->setDistantChatPermissionFlags(RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY) ; + case 2: rsChats->setDistantChatPermissionFlags(RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY) ; break ; } diff --git a/retroshare-gui/src/gui/settings/MessagePage.cpp b/retroshare-gui/src/gui/settings/MessagePage.cpp index ac16048b2..2ab887ecf 100644 --- a/retroshare-gui/src/gui/settings/MessagePage.cpp +++ b/retroshare-gui/src/gui/settings/MessagePage.cpp @@ -22,7 +22,8 @@ #include "rshare.h" #include "rsharesettings.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rschats.h" +#include "retroshare/rsmail.h" #include "MessagePage.h" #include "util/misc.h" @@ -32,6 +33,8 @@ #include "NewTag.h" #include "util/qtthreadsutils.h" +using namespace Rs::Mail; + MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags) : ConfigPage(parent, flags) { diff --git a/retroshare-gui/src/gui/settings/MessagePage.h b/retroshare-gui/src/gui/settings/MessagePage.h index e226a4387..8a23c18f5 100644 --- a/retroshare-gui/src/gui/settings/MessagePage.h +++ b/retroshare-gui/src/gui/settings/MessagePage.h @@ -66,8 +66,8 @@ private: void handleEvent_main_thread(std::shared_ptr event); void fillTags(); - /* Pointer for not include of rsmsgs.h */ - MsgTagType *m_pTags; + /* Pointer for not include of rsmail.h */ + Rs::Mail::MsgTagType *m_pTags; std::list m_changedTagIds; RsEventsHandlerId_t mTagEventHandlerId; diff --git a/retroshare-gui/src/gui/settings/NewTag.cpp b/retroshare-gui/src/gui/settings/NewTag.cpp index bfc1b16b9..39cbe666a 100644 --- a/retroshare-gui/src/gui/settings/NewTag.cpp +++ b/retroshare-gui/src/gui/settings/NewTag.cpp @@ -20,10 +20,12 @@ #include "NewTag.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rsmail.h" #include +using namespace Rs::Mail; + /** Default constructor */ NewTag::NewTag(MsgTagType &Tags, uint32_t nId /* = 0*/, QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags), m_Tags(Tags) diff --git a/retroshare-gui/src/gui/settings/NewTag.h b/retroshare-gui/src/gui/settings/NewTag.h index f4ebe5479..f8499bdb4 100644 --- a/retroshare-gui/src/gui/settings/NewTag.h +++ b/retroshare-gui/src/gui/settings/NewTag.h @@ -35,7 +35,7 @@ class NewTag : public QDialog public: /** Default constructor */ - NewTag(MsgTagType &Tags, uint32_t nId = 0, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); + NewTag(Rs::Mail::MsgTagType &Tags, uint32_t nId = 0, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); uint32_t m_nId; @@ -50,7 +50,7 @@ private slots: private: void showColor(QRgb color); - MsgTagType &m_Tags; + Rs::Mail::MsgTagType &m_Tags; QRgb m_Color; /** Qt Designer generated object */ diff --git a/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp b/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp index a9ea1394a..d27a5f381 100644 --- a/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp +++ b/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp @@ -28,6 +28,7 @@ #include #include +#include #include "RsharePeerSettings.h" #include "rsharesettings.h" diff --git a/retroshare-gui/src/gui/settings/RsharePeerSettings.h b/retroshare-gui/src/gui/settings/RsharePeerSettings.h index 27de2eaae..d8f4e5345 100644 --- a/retroshare-gui/src/gui/settings/RsharePeerSettings.h +++ b/retroshare-gui/src/gui/settings/RsharePeerSettings.h @@ -23,9 +23,9 @@ #include #include -#include class RSStyle; +class ChatId; /** Handles saving and restoring RShares's settings for peers */ class RsharePeerSettings : public QSettings diff --git a/retroshare-gui/src/gui/toaster/ChatLobbyToaster.cpp b/retroshare-gui/src/gui/toaster/ChatLobbyToaster.cpp index ae61c7b3b..eb3b9a6cb 100644 --- a/retroshare-gui/src/gui/toaster/ChatLobbyToaster.cpp +++ b/retroshare-gui/src/gui/toaster/ChatLobbyToaster.cpp @@ -23,7 +23,8 @@ #include "util/HandleRichText.h" #include -#include +#include +#include ChatLobbyToaster::ChatLobbyToaster(const ChatLobbyId &lobby_id, const RsGxsId &sender_id, const QString &message): QWidget(NULL), mLobbyId(lobby_id) @@ -51,7 +52,7 @@ ChatLobbyToaster::ChatLobbyToaster(const ChatLobbyId &lobby_id, const RsGxsId &s QString lobbyName = RsHtml::plainText(idd.mNickname); ChatLobbyInfo clinfo ; - if(rsMsgs->getChatLobbyInfo(mLobbyId,clinfo)) + if(rsChats->getChatLobbyInfo(mLobbyId,clinfo)) lobbyName += "@" + RsHtml::plainText(clinfo.lobby_name); ui.toasterLabel->setText(lobbyName); diff --git a/retroshare-gui/src/gui/toaster/ChatLobbyToaster.h b/retroshare-gui/src/gui/toaster/ChatLobbyToaster.h index e507554da..8a2bdaa97 100644 --- a/retroshare-gui/src/gui/toaster/ChatLobbyToaster.h +++ b/retroshare-gui/src/gui/toaster/ChatLobbyToaster.h @@ -23,7 +23,7 @@ #include "ui_ChatLobbyToaster.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rsmail.h" /** * Shows a toaster when a chat is incoming. diff --git a/retroshare-gui/src/gui/toaster/MessageToaster.cpp b/retroshare-gui/src/gui/toaster/MessageToaster.cpp index 1f4894ba3..9772a0622 100644 --- a/retroshare-gui/src/gui/toaster/MessageToaster.cpp +++ b/retroshare-gui/src/gui/toaster/MessageToaster.cpp @@ -21,7 +21,7 @@ #include "MessageToaster.h" #include "../MainWindow.h" -#include +#include #include #include @@ -43,7 +43,7 @@ MessageToaster::MessageToaster(const std::string &peerId, const QString &title, ui.textLabel->setText(message); ui.textLabel->setToolTip(message); - MessageInfo mi; + Rs::Mail::MessageInfo mi; if (!rsMail->getMessage(peerId, mi)) return; diff --git a/retroshare-gui/src/gui/unfinished/profile/ProfileView.cpp b/retroshare-gui/src/gui/unfinished/profile/ProfileView.cpp index 1573e939d..bf96220f7 100644 --- a/retroshare-gui/src/gui/unfinished/profile/ProfileView.cpp +++ b/retroshare-gui/src/gui/unfinished/profile/ProfileView.cpp @@ -24,7 +24,8 @@ #include "gui/common/AvatarDefs.h" #include -#include +#include +#include //#include #include diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index e8362a885..6fd08381d 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -432,7 +432,6 @@ HEADERS += rshare.h \ util/RsNetUtil.h \ util/DateTime.h \ util/RetroStyleLabel.h \ - util/dllexport.h \ util/NonCopyable.h \ util/rsutildll.h \ util/dllexport.h \ @@ -1179,27 +1178,31 @@ gxsphotoshare { wikipoos { - DEFINES += RS_USE_WIKI - - DEPENDPATH += ../../supportlibs/pegmarkdown - INCLUDEPATH += ../../supportlibs/pegmarkdown - - HEADERS += gui/WikiPoos/WikiDialog.h \ - gui/WikiPoos/WikiAddDialog.h \ - gui/WikiPoos/WikiEditDialog.h \ - gui/gxs/WikiGroupDialog.h \ + message(Including WikiPoos) + DEFINES += RS_USE_WIKI + INCLUDEPATH += ../../supportlibs/pegmarkdown - FORMS += gui/WikiPoos/WikiDialog.ui \ - gui/WikiPoos/WikiAddDialog.ui \ - gui/WikiPoos/WikiEditDialog.ui \ - - SOURCES += gui/WikiPoos/WikiDialog.cpp \ - gui/WikiPoos/WikiAddDialog.cpp \ - gui/WikiPoos/WikiEditDialog.cpp \ - gui/gxs/WikiGroupDialog.cpp \ + HEADERS += gui/WikiPoos/WikiDialog.h \ + gui/WikiPoos/WikiAddDialog.h \ + gui/WikiPoos/WikiEditDialog.h \ + gui/gxs/WikiGroupDialog.h \ + gui/gxs/RsGxsUpdateBroadcastBase.h \ + gui/gxs/RsGxsUpdateBroadcastWidget.h \ + gui/gxs/RsGxsUpdateBroadcastPage.h - RESOURCES += gui/WikiPoos/Wiki_images.qrc + SOURCES += gui/WikiPoos/WikiDialog.cpp \ + gui/WikiPoos/WikiAddDialog.cpp \ + gui/WikiPoos/WikiEditDialog.cpp \ + gui/gxs/WikiGroupDialog.cpp \ + gui/gxs/RsGxsUpdateBroadcastBase.cpp \ + gui/gxs/RsGxsUpdateBroadcastWidget.cpp \ + gui/gxs/RsGxsUpdateBroadcastPage.cpp + FORMS += gui/WikiPoos/WikiDialog.ui \ + gui/WikiPoos/WikiAddDialog.ui \ + gui/WikiPoos/WikiEditDialog.ui + + RESOURCES += gui/WikiPoos/Wiki_images.qrc } @@ -1474,18 +1477,6 @@ gxsgui { } -wikipoos { - HEADERS += \ - gui/gxs/RsGxsUpdateBroadcastBase.h \ - gui/gxs/RsGxsUpdateBroadcastWidget.h \ - gui/gxs/RsGxsUpdateBroadcastPage.h - - SOURCES += \ - gui/gxs/RsGxsUpdateBroadcastBase.cpp \ - gui/gxs/RsGxsUpdateBroadcastWidget.cpp \ - gui/gxs/RsGxsUpdateBroadcastPage.cpp \ -} - ################################################################ #Define qmake_info.h file so GUI can get wath was used to compil # This must be at end to get all informations diff --git a/retroshare.pri b/retroshare.pri index 1a993f731..983fda4e9 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -227,6 +227,10 @@ CONFIG *= rs_sam3_libsam3 no_rs_sam3_libsam3:CONFIG -= rs_sam3_libsam3 + +#Wikipoos +#CONFIG *= wikipoos + # Specify host precompiled jsonapi-generator path, appending the following # assignation to qmake command line # 'JSONAPI_GENERATOR_EXE=/myBuildDir/jsonapi-generator'. Required for JSON API @@ -334,7 +338,7 @@ DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_001 DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_002 DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_003 -#CONFIG += rs_v07_changes +#CONFIG *= wikipoos rs_v07_changes rs_v07_changes { DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_001 DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_002 @@ -532,7 +536,7 @@ versionAtLeast(CMAKE_VERSION, 3.5) { } gxsdistsync:DEFINES *= RS_USE_GXS_DISTANT_SYNC -wikipoos:DEFINES *= RS_USE_WIKI +#wikipoos:DEFINES *= RS_USE_WIKI rs_gxs:DEFINES *= RS_ENABLE_GXS rs_gxs_send_all:DEFINES *= RS_GXS_SEND_ALL rs_service_webui_terminal_password:DEFINES *= RS_SERVICE_TERMINAL_WEBUI_PASSWORD