simplification of the chat interface to libretroshare using a single unified class for chat IDs. Used a common chat widget for all chats including broadcast. Opens the way to having plugins send/recv chat messages. Patch from Electron.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7800 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-12-29 21:41:05 +00:00
parent 535fe875e4
commit 13d7866171
53 changed files with 1180 additions and 2280 deletions

View file

@ -896,7 +896,7 @@ bool DistributedChatService::locked_initLobbyBouncableObject(const ChatLobbyId&
return true ;
}
bool DistributedChatService::sendLobbyChat(const RsPeerId &id, const std::string& msg, const ChatLobbyId& lobby_id)
bool DistributedChatService::sendLobbyChat(const ChatLobbyId& lobby_id, const std::string& msg)
{
#ifdef CHAT_DEBUG
std::cerr << "Sending chat lobby message to lobby " << std::hex << lobby_id << std::dec << std::endl;
@ -923,7 +923,17 @@ bool DistributedChatService::sendLobbyChat(const RsPeerId &id, const std::string
RsPeerId ownId = rsPeers->getOwnId();
mHistMgr->addMessage(false, id, ownId, &item);
ChatMessage message;
message.chatflags = 0;
message.chat_id = ChatId(lobby_id);
message.msg = msg;
message.lobby_peer_nickname = item.nick;
message.recvTime = item.recvTime;
message.sendTime = item.sendTime;
message.incoming = false;
message.online = true;
RsServer::notify()->notifyChatMessage(message);
mHistMgr->addMessage(message);
bounceLobbyObject(&item, ownId) ;