Disable node chat by default at compile-time

This commit is contained in:
Gioacchino Mazzurco 2018-11-20 11:32:00 +01:00
parent f8c25fd967
commit 1699a6a25a
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
2 changed files with 23 additions and 4 deletions

View File

@ -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()));

View File

@ -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
}