mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-16 02:19:34 -04:00
Preparation for mute Peers in the Chat Lobby.
RS_CHAT_LOBBY_EVENT_PEER_CHANGE_NICKNAME is send, when changing nickname, so the blocklist can be updated (in future). This will never wort for 100% as discussed in the developer forum, but should stop the most spam. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5150 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
22a8e6f3c9
commit
22bfcb62bc
7 changed files with 82 additions and 6 deletions
|
@ -372,6 +372,7 @@ bool p3ChatService::isLobbyId(const std::string& id,ChatLobbyId& lobby_id)
|
|||
return false ;
|
||||
}
|
||||
|
||||
|
||||
bool p3ChatService::sendPrivateChat(const std::string &id, const std::wstring &msg)
|
||||
{
|
||||
// look into ID. Is it a peer, or a chat lobby?
|
||||
|
@ -1768,6 +1769,22 @@ void p3ChatService::sendLobbyStatusString(const ChatLobbyId& lobby_id,const std:
|
|||
{
|
||||
sendLobbyStatusItem(lobby_id,RS_CHAT_LOBBY_EVENT_PEER_STATUS,status_string) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform other Clients of a nickname change
|
||||
*
|
||||
* as example for updating their ChatLobby Blocklist for muted peers
|
||||
* */
|
||||
bool p3ChatService::sendLobbyStatusPeerChangedNickname(const ChatLobbyId& lobby_id)
|
||||
{
|
||||
std::string nick ;
|
||||
getNickNameForChatLobby(lobby_id,nick) ;
|
||||
|
||||
sendLobbyStatusItem(lobby_id,RS_CHAT_LOBBY_EVENT_PEER_CHANGE_NICKNAME,nick) ;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void p3ChatService::sendLobbyStatusPeerLiving(const ChatLobbyId& lobby_id)
|
||||
{
|
||||
std::string nick ;
|
||||
|
@ -2426,6 +2443,7 @@ bool p3ChatService::setNickNameForChatLobby(const ChatLobbyId& lobby_id,const st
|
|||
{
|
||||
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
|
||||
#ifdef CHAT_DEBUG
|
||||
std::cerr << "Changing nickname for chat lobby " << std::hex << lobby_id << std::dec << " to " << nick << std::endl;
|
||||
#endif
|
||||
|
@ -2437,6 +2455,10 @@ bool p3ChatService::setNickNameForChatLobby(const ChatLobbyId& lobby_id,const st
|
|||
return false;
|
||||
}
|
||||
|
||||
// // inform other user about name change
|
||||
// sendLobbyStatusPeerChangedNickname(lobby_id);
|
||||
|
||||
|
||||
it->second.nick_name = nick ;
|
||||
return true ;
|
||||
}
|
||||
|
|
|
@ -76,6 +76,8 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
|
|||
*/
|
||||
bool sendPrivateChat(const std::string &id, const std::wstring &msg);
|
||||
|
||||
bool sendLobbyStatusPeerChangedNickname(const ChatLobbyId& lobby_id) ;
|
||||
|
||||
/*!
|
||||
* can be used to send 'immediate' status msgs, these status updates are meant for immediate use by peer (not saved by rs)
|
||||
* e.g currently used to update user when a peer 'is typing' during a chat
|
||||
|
@ -241,6 +243,7 @@ class p3ChatService: public p3Service, public p3Config, public pqiMonitor
|
|||
|
||||
void sendLobbyStatusItem(const ChatLobbyId&, int type, const std::string& status_string) ;
|
||||
void sendLobbyStatusPeerLiving(const ChatLobbyId& lobby_id) ;
|
||||
|
||||
void sendLobbyStatusNewPeer(const ChatLobbyId& lobby_id) ;
|
||||
void sendLobbyStatusKeepAlive(const ChatLobbyId&) ;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue