mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added chat friend and message friend actions to FriendsList/Friend context menu
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8309 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
562c7c2c20
commit
cec8a15b28
@ -380,6 +380,11 @@ void FriendList::peerTreeWidgetCustomPopupMenu()
|
|||||||
break;
|
break;
|
||||||
case TYPE_GPG:
|
case TYPE_GPG:
|
||||||
{
|
{
|
||||||
|
contextMnu.addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy()));
|
||||||
|
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Send message"), this, SLOT(msgfriend()));
|
||||||
|
|
||||||
|
contextMnu.addSeparator();
|
||||||
|
|
||||||
contextMnu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Details"), this, SLOT(configurefriend()));
|
contextMnu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Details"), this, SLOT(configurefriend()));
|
||||||
contextMnu.addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny"), this, SLOT(removefriend()));
|
contextMnu.addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny"), this, SLOT(removefriend()));
|
||||||
|
|
||||||
@ -1269,14 +1274,21 @@ void FriendList::addFriend()
|
|||||||
|
|
||||||
void FriendList::msgfriend()
|
void FriendList::msgfriend()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *peer = getCurrentPeer();
|
QTreeWidgetItem *item = getCurrentPeer();
|
||||||
|
|
||||||
if (!peer)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string id = getRsId(peer);
|
switch (item->type()) {
|
||||||
|
case TYPE_GROUP:
|
||||||
MessageComposer::msgFriend(RsPeerId(id)) ;
|
break;
|
||||||
|
case TYPE_GPG:
|
||||||
|
MessageComposer::msgFriend(RsPgpId(getRsId(item)));
|
||||||
|
break;
|
||||||
|
case TYPE_SSL:
|
||||||
|
MessageComposer::msgFriend(RsPeerId(getRsId(item)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendList::recommendfriend()
|
void FriendList::recommendfriend()
|
||||||
|
@ -451,6 +451,35 @@ void MessageComposer::processSettings(bool bLoad)
|
|||||||
/* window will destroy itself! */
|
/* window will destroy itself! */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*static*/ void MessageComposer::msgFriend(const RsPgpId &id)
|
||||||
|
{
|
||||||
|
// std::cerr << "MessageComposer::msgfriend()" << std::endl;
|
||||||
|
|
||||||
|
/* check if pgp id is a friend */
|
||||||
|
std::list<RsPgpId> friends;
|
||||||
|
rsPeers->getGPGAcceptedList(friends);
|
||||||
|
if(std::find(friends.begin(), friends.end(), id) == friends.end())
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* create a message */
|
||||||
|
MessageComposer *pMsgDialog = MessageComposer::newMsg();
|
||||||
|
if (pMsgDialog == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* add all locations */
|
||||||
|
std::list<RsPeerId> locations;
|
||||||
|
rsPeers->getAssociatedSSLIds(id, locations);
|
||||||
|
for(std::list<RsPeerId>::iterator it = locations.begin(); it != locations.end(); ++it)
|
||||||
|
{
|
||||||
|
pMsgDialog->addRecipient(TO, *it);
|
||||||
|
}
|
||||||
|
|
||||||
|
pMsgDialog->show();
|
||||||
|
|
||||||
|
/* window will destroy itself! */
|
||||||
|
}
|
||||||
|
|
||||||
static QString buildRecommendHtml(const std::set<RsPeerId> &sslIds, const RsPeerId& excludeId = RsPeerId())
|
static QString buildRecommendHtml(const std::set<RsPeerId> &sslIds, const RsPeerId& excludeId = RsPeerId())
|
||||||
{
|
{
|
||||||
QString text;
|
QString text;
|
||||||
|
@ -56,6 +56,8 @@ public:
|
|||||||
~MessageComposer();
|
~MessageComposer();
|
||||||
|
|
||||||
static void msgFriend(const RsPeerId &id);
|
static void msgFriend(const RsPeerId &id);
|
||||||
|
// send msg to all locations
|
||||||
|
static void msgFriend(const RsPgpId &id);
|
||||||
static void msgGxsIdentity(const RsGxsId& gxs_id) ;
|
static void msgGxsIdentity(const RsGxsId& gxs_id) ;
|
||||||
static void msgGroup(const std::string& group_id) ;
|
static void msgGroup(const std::string& group_id) ;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user