From 5a4d0f57d1948baee0004af2532ee4ac1f56935f Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 23 Feb 2018 14:26:23 +0100 Subject: [PATCH] made the invite system non automatic, because it was confusing and could generate unwanted emails --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 5 +++-- retroshare-gui/src/gui/feeds/MsgItem.cpp | 8 ++++---- retroshare-gui/src/gui/msgs/MessageComposer.cpp | 8 ++++---- retroshare-gui/src/gui/msgs/MessageComposer.h | 2 +- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 8 ++++---- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index d901c813d..71bf7be40 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -2608,9 +2608,10 @@ void IdDialog::sendInvite() RsGxsId id(ui->lineEdit_KeyId->text().toStdString()); - if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) + //if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) { - MessageComposer::sendInvite(id); + MessageComposer::sendInvite(id,false); + ui->inviteFrame->show(); ui->inviteButton->setEnabled(false); } diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index 8bed391bd..97570a537 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -370,9 +370,9 @@ void MsgItem::sendInvite() if (!rsMail->getMessage(mMsgId, mi)) return; - if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) - { - MessageComposer::sendInvite(mi.rsgxsid_srcId); - } + //if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) + //{ + MessageComposer::sendInvite(mi.rsgxsid_srcId,false); + //} } diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index c7b21df03..a402ee3b9 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -2775,12 +2775,12 @@ QString MessageComposer::inviteMessage() return tr("Hi,
I want to be friends with you on RetroShare.
"); } -void MessageComposer::sendInvite(const RsGxsId &to, const QString &/*msg*/, bool autoSend) +void MessageComposer::sendInvite(const RsGxsId &to, bool autoSend) { /* create a message */ MessageComposer *composer = MessageComposer::newMsg(); - composer->setTitleText(tr("You have a friend invite")); + composer->setTitleText(tr("Invite message")); composer->msgFlags |= RS_MSG_USER_REQUEST; @@ -2803,8 +2803,8 @@ void MessageComposer::sendInvite(const RsGxsId &to, const QString &/*msg*/, bool return; } } - - //composer->show(); + else + composer->show(); /* window will destroy itself! */ } diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.h b/retroshare-gui/src/gui/msgs/MessageComposer.h index 6dddf17ff..1891c0312 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.h +++ b/retroshare-gui/src/gui/msgs/MessageComposer.h @@ -64,7 +64,7 @@ public: static QString recommendMessage(); static void recommendFriend(const std::set &sslIds, const RsPeerId &to = RsPeerId(), const QString &msg = "", bool autoSend = false); static void sendConnectAttemptMsg(const RsPgpId &gpgId, const RsPeerId &sslId, const QString &sslName); - static void sendInvite(const RsGxsId &to = RsGxsId(), const QString &msg = "", bool autoSend = true); + static void sendInvite(const RsGxsId &to, bool autoSend); #ifdef UNUSED_CODE static void sendChannelPublishKey(RsGxsChannelGroup &group); static void sendForumPublishKey(RsGxsForumGroup &group); diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index 38319bafc..8fbf30039 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -789,9 +789,9 @@ void MessageWidget::sendInvite() if (!rsMail->getMessage(currMsgId, mi)) return; - if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) - { - MessageComposer::sendInvite(mi.rsgxsid_srcId); - } + //if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) + //{ + MessageComposer::sendInvite(mi.rsgxsid_srcId,false); + //} }