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:
electron128 2015-05-29 10:07:12 +00:00
parent 562c7c2c20
commit cec8a15b28
3 changed files with 48 additions and 5 deletions

View file

@ -451,6 +451,35 @@ void MessageComposer::processSettings(bool bLoad)
/* 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())
{
QString text;

View file

@ -56,6 +56,8 @@ public:
~MessageComposer();
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 msgGroup(const std::string& group_id) ;