This commit is contained in:
aozhiwei 2020-12-09 10:24:18 +08:00
parent 387fa32e65
commit 526a057eb9
3 changed files with 16 additions and 6 deletions

View File

@ -31,7 +31,7 @@ void ChatMgr::FillSMUpdateChatRedPointNotify(Player* hum, cs::SMUpdateChatRedPoi
}
ChatedUserRec* chated_user = GetChatedUser(hum->AccountId());
if (chated_user && chated_user->has_unread_msg) {
msg.add_has_unread_msg_channels(kCCFriend);
msg.add_has_unread_msg_channels(kCCPrivate);
}
}
@ -117,7 +117,9 @@ void ChatMgr::SyncWorldChatMsg(Player* hum)
hum->world_channel_last_id = chat_msg->msg_uuid();
}
}
hum->SendMsg(notifymsg);
if (!notifymsg.msg_list().size() > 0) {
hum->SendMsg(notifymsg);
}
} else {
hum->MarkNewMsg();
}
@ -137,7 +139,15 @@ void ChatMgr::SyncGuildChatMsg(Player* hum)
auto itr = guild_msgrec_.find(hum->GuildId());
if (itr != guild_msgrec_.end()) {
if (hum->chat_channel == kCCGuild) {
if (itr->second.curr_id > hum->guild_channel_last_id) {
cs::SMChatMsgNotify notifymsg;
for (cs::MFChatMsg* chat_msg : world_msgrec_.msg_list) {
if (chat_msg->msg_uuid() > hum->guild_channel_last_id) {
*notifymsg.add_msg_list() = *chat_msg;
hum->guild_channel_last_id = chat_msg->msg_uuid();
}
}
if (!notifymsg.msg_list().size() > 0) {
hum->SendMsg(notifymsg);
}
} else {
hum->MarkNewMsg();

View File

@ -78,7 +78,7 @@ enum GuildMemberUpdateReason
enum ChatChannel_e
{
kCCWorld = 1,
kCCFriend = 2,
kCCPrivate = 2,
kCCGuild = 3
};

View File

@ -570,7 +570,7 @@ void Player::_CMSendChatMsg(f8::MsgHdr& hdr, const cs::CMSendChatMsg& msg)
case kCCWorld:
ChatMgr::Instance()->ProcWorldChat(this, msg);
break;
case kCCFriend:
case kCCPrivate:
ChatMgr::Instance()->ProcPrivateChat(this, msg);
break;
case kCCGuild:
@ -595,7 +595,7 @@ void Player::_CMReadMsgAndOpenChatNotify(f8::MsgHdr& hdr, const cs::CMReadMsgAnd
{
if (IsValidChatChannel(msg.curr_channel())) {
chat_channel = msg.curr_channel();
if (chat_channel == kCCFriend) {
if (chat_channel == kCCPrivate) {
SyncPrivateChatRedPoint();
}