From 816a47780648bbeb52896a5d4f79ab996ad5accf Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 7 Dec 2011 00:12:17 +0000 Subject: [PATCH] bug corrections git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ChatLobby@4712 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3chatservice.cc | 11 +++++++---- retroshare-gui/src/gui/FriendsDialog.cpp | 6 ++++++ retroshare-gui/src/gui/chat/PopupChatDialog.cpp | 10 ++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/services/p3chatservice.cc b/libretroshare/src/services/p3chatservice.cc index af6d23f2f..ffc113fb4 100644 --- a/libretroshare/src/services/p3chatservice.cc +++ b/libretroshare/src/services/p3chatservice.cc @@ -1303,11 +1303,11 @@ bool p3ChatService::recvLobbyChat(RsChatLobbyMsgItem *item) for(std::set::const_iterator it(lobby.participating_friends.begin());it!=lobby.participating_friends.end();++it) if((*it)!=item->PeerId() && mLinkMgr->isOnline(*it)) { - RsChatLobbyMsgItem *item = new RsChatLobbyMsgItem(*item) ; // copy almost everything + RsChatLobbyMsgItem *item2 = new RsChatLobbyMsgItem(*item) ; // copy almost everything - item->PeerId(*it) ; + item2->PeerId(*it) ; - sendItem(item); + sendItem(item2); } return true ; } @@ -1318,7 +1318,7 @@ bool p3ChatService::sendLobbyChat(const std::wstring& msg, const ChatLobbyId& lo std::cerr << "Sending chat lobby message to lobby " << lobby_id << std::endl; std::cerr << "msg:" << std::endl; - std::cerr << msg.c_str() << std::endl; + std::wcerr << msg << std::endl; // get a pointer to the info for that chat lobby. // @@ -1489,6 +1489,9 @@ bool p3ChatService::acceptLobbyInvite(const ChatLobbyId& lobby_id) rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD); + // send AKN item + + sendLobbyChat(L"[...] joined the lobby",lobby_id) ; return true ; } diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 88da9c5ab..a02962227 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -319,6 +319,12 @@ void FriendsDialog::readChatLobbyInvites() std::cerr << "Accepting invite to lobby " << (*it).lobby_name << std::endl; rsMsgs->acceptLobbyInvite( (*it).lobby_id ) ; + + std::string vpid ; + if(rsMsgs->getVirtualPeerId( (*it).lobby_id,vpid ) ) + PopupChatDialog::chatFriend(vpid) ; + else + std::cerr << "No lobby known with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl; } else rsMsgs->denyLobbyInvite( (*it).lobby_id ) ; diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 4f859a2ea..e07359671 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -359,10 +359,16 @@ void PopupChatDialog::chatFriend(const std::string &id) } std::cerr<<" popup dialog chat friend 1"<isLobbyId(id,lid)) + { + getPrivateChat(id, RS_CHAT_OPEN | RS_CHAT_FOCUS); + return ; + } + RsPeerDetails detail; - if (!rsPeers->getPeerDetails(id, detail)) { + if (!rsPeers->getPeerDetails(id, detail)) return; - } std::string firstId;