1
This commit is contained in:
parent
16e36e091f
commit
40bdddabf2
@ -363,12 +363,12 @@ void Player::_CMFriendAddBlack(f8::MsgHdr& hdr, const cs::CMFriendAddBlack& msg)
|
||||
ShowErrorMsg("添加失败,黑名单已满");
|
||||
return;
|
||||
}
|
||||
Friend* p = GetFriendById(msg.account_id());
|
||||
Friend* p = GetFriendById(msg.user_info().base_data().account_id());
|
||||
if (p) {
|
||||
if (!GetBlackListById(msg.account_id())) {
|
||||
if (!GetBlackListById(msg.user_info().base_data().account_id())) {
|
||||
{
|
||||
cs::SMDeleteFriendNotify notifymsg;
|
||||
notifymsg.add_user_list(msg.account_id());
|
||||
notifymsg.add_user_list(msg.user_info().base_data().account_id());
|
||||
SendMsg(notifymsg);
|
||||
}
|
||||
{
|
||||
@ -384,7 +384,19 @@ void Player::_CMFriendAddBlack(f8::MsgHdr& hdr, const cs::CMFriendAddBlack& msg)
|
||||
}
|
||||
ShowErrorMsg("成功添加到黑名单");
|
||||
} else {
|
||||
ShowErrorMsg("对方不是你的好友");
|
||||
if (msg.user_info().base_data().account_id() == AccountId()) {
|
||||
return;
|
||||
}
|
||||
p = new Friend();
|
||||
TypeConvert::Convert(msg.user_info().base_data(), p->base_data);
|
||||
AddBlackList(p);
|
||||
{
|
||||
cs::SMAddBlackListNotify notifymsg;
|
||||
auto user_info = notifymsg.add_user_infos();
|
||||
TypeConvert::Convert(p->base_data, *user_info->mutable_base_data());
|
||||
TypeConvert::Convert(p->temp_custom_data, *user_info->mutable_temp_custom_data());
|
||||
SendMsg(notifymsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -919,7 +931,6 @@ void Player::AddBlackList(Friend* friendobj)
|
||||
if (friendobj->base_data.account_id == AccountId()) {
|
||||
return;
|
||||
}
|
||||
if (!GetFriendById(friendobj->base_data.account_id)) {
|
||||
INIT_LIST_HEAD(&friendobj->watch_node);
|
||||
friendobj->crc32_code = a8::openssl::Crc32
|
||||
(
|
||||
@ -930,7 +941,6 @@ void Player::AddBlackList(Friend* friendobj)
|
||||
black_hash_[friendobj->base_data.account_id] = friendobj;
|
||||
PlayerMgr::Instance()->WatchPlayer(friendobj);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::RemoveFriend(const std::string& account_id, bool need_sync)
|
||||
{
|
||||
|
@ -198,7 +198,7 @@ message SMFriendBlackList
|
||||
//添加黑名单
|
||||
message CMFriendAddBlack
|
||||
{
|
||||
optional string account_id = 1; //好友id
|
||||
optional MFUserInfo user_info = 1; //好友信息
|
||||
}
|
||||
//添加黑名单回复
|
||||
message SMFriendAddBlack
|
||||
|
Loading…
x
Reference in New Issue
Block a user