1
This commit is contained in:
parent
d03402c6a6
commit
012a135b93
@ -388,20 +388,23 @@ void Player::_CMFriendAddBlack(f8::MsgHdr& hdr, const cs::CMFriendAddBlack& msg)
|
||||
ShowErrorMsg("添加失败,黑名单已满");
|
||||
return;
|
||||
}
|
||||
if (GetBlackListById(msg.user_info().base_data().account_id())) {
|
||||
cs::SMFriendAddBlack respmsg;
|
||||
SendMsg(respmsg);
|
||||
return;
|
||||
}
|
||||
Friend* p = GetFriendById(msg.user_info().base_data().account_id());
|
||||
if (p) {
|
||||
if (!GetBlackListById(msg.user_info().base_data().account_id())) {
|
||||
{
|
||||
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);
|
||||
}
|
||||
black_hash_[p->base_data.account_id] = p;
|
||||
InternalRemoveFriend(p->base_data.account_id, true, false);
|
||||
MarkDirty();
|
||||
{
|
||||
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);
|
||||
}
|
||||
black_hash_[p->base_data.account_id] = p;
|
||||
InternalRemoveFriend(p->base_data.account_id, true, false);
|
||||
MarkDirty();
|
||||
ShowErrorMsg("成功添加到黑名单");
|
||||
} else {
|
||||
if (msg.user_info().base_data().account_id().empty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user