From 1699a6a25afac7e2a7b5c49f4bae06596f6fbe4b Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Tue, 20 Nov 2018 11:32:00 +0100 Subject: [PATCH] Disable node chat by default at compile-time --- retroshare-gui/src/gui/common/FriendList.cpp | 17 +++++++++++++---- retroshare.pri | 10 ++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index ddca59bed..c496bb79e 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -120,10 +120,16 @@ FriendList::FriendList(QWidget *parent) : ui->setupUi(this); connect(ui->peerTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(peerTreeWidgetCustomPopupMenu())); - connect(ui->peerTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(chatfriend(QTreeWidgetItem *))); connect(ui->peerTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(expandItem(QTreeWidgetItem *))); connect(ui->peerTreeWidget, SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, SLOT(collapseItem(QTreeWidgetItem *))); +#ifdef RS_DIRECT_CHAT + connect(ui->peerTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(chatfriend(QTreeWidgetItem *))); +#else + connect( ui->peerTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), + this, SLOT(expandItem(QTreeWidgetItem *)) ); +#endif + connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(groupsChanged())); connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(insertPeers())); @@ -346,9 +352,10 @@ void FriendList::peerTreeWidgetCustomPopupMenu() case TYPE_GROUP: { bool standard = c->data(COLUMN_DATA, ROLE_STANDARD).toBool(); - +#ifdef RS_DIRECT_CHAT contextMenu->addAction(QIcon(IMAGE_MSG), tr("Send message to whole group"), this, SLOT(msgfriend())); contextMenu->addSeparator(); +#endif // RS_DIRECT_CHAT contextMenu->addAction(QIcon(IMAGE_EDIT), tr("Edit Group"), this, SLOT(editGroup())); QAction *action = contextMenu->addAction(QIcon(IMAGE_REMOVE), tr("Remove Group"), this, SLOT(removeGroup())); @@ -357,10 +364,11 @@ void FriendList::peerTreeWidgetCustomPopupMenu() break; case TYPE_GPG: { +#ifdef RS_DIRECT_CHAT contextMenu->addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy())); contextMenu->addAction(QIcon(IMAGE_MSG), tr("Send message"), this, SLOT(msgfriend())); - contextMenu->addSeparator(); +#endif // RS_DIRECT_CHAT contextMenu->addAction(QIcon(IMAGE_FRIENDINFO), tr("Profile details"), this, SLOT(configurefriend())); contextMenu->addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny connections"), this, SLOT(removefriend())); @@ -437,10 +445,11 @@ void FriendList::peerTreeWidgetCustomPopupMenu() case TYPE_SSL: { +#ifdef RS_DIRECT_CHAT contextMenu->addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy())); contextMenu->addAction(QIcon(IMAGE_MSG), tr("Send message to this node"), this, SLOT(msgfriend())); - contextMenu->addSeparator(); +#endif // RS_DIRECT_CHAT contextMenu->addAction(QIcon(IMAGE_FRIENDINFO), tr("Node details"), this, SLOT(configurefriend())); diff --git a/retroshare.pri b/retroshare.pri index 1d8dcc36e..c65c43b57 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -136,6 +136,11 @@ CONFIG *= rs_gxs_trans CONFIG *= no_rs_async_chat rs_async_chat:CONFIG -= no_rs_async_chat +# To enable direct chat which has been deprecated since RetroShare 0.6.5 append +# the following assignation to qmake command line "CONFIG+=direct_chat" +CONFIG *= no_direct_chat +direct_chat:CONFIG -= no_direct_chat + # To disable bitdht append the following assignation to qmake command line # "CONFIG+=no_bitdht" CONFIG *= bitdht @@ -436,6 +441,11 @@ bitdht { DEFINES *= RS_USE_BITDHT } +direct_chat { + warning("You have enabled RetroShare direct chat which is deprecated!") + DEFINES *= RS_DIRECT_CHAT +} + rs_async_chat { DEFINES *= RS_ASYNC_CHAT }