This commit is contained in:
aozhiwei 2020-06-22 20:01:33 +08:00
parent f0501aaf11
commit 1807268f9e
3 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include "dbhelper.h" #include "dbhelper.h"
#include "player.h" #include "player.h"
#include "app.h" #include "app.h"
#include "synchelper.h"
void DBHelper::Init() void DBHelper::Init()
{ {
@ -107,6 +108,7 @@ void DBHelper::AddFriendApply(Player* hum, const std::string& target_id)
on_error, on_error,
friend_crc32_code friend_crc32_code
); );
SyncHelper::Instance()->SyncApplyFriend(hum, target_id);
} }
void DBHelper::AddEvent(const std::string& sender_id, void DBHelper::AddEvent(const std::string& sender_id,

View File

@ -85,6 +85,15 @@ void SyncHelper::SyncUpdateFriend(Player* hum, const std::string& target_id)
} }
void SyncHelper::SyncApplyFriend(Player* hum, const std::string& target_id)
{
ss::SS_IM_FriendApply* notifymsg = new ss::SS_IM_FriendApply();
hum->FillIMMsgConext(notifymsg->mutable_context());
notifymsg->set_target_id(target_id);
BroadcastIMConnMsg(*notifymsg);
delete notifymsg;
}
void SyncHelper::BroadcastIMConnMsg(int msgid, ::google::protobuf::Message& msg) void SyncHelper::BroadcastIMConnMsg(int msgid, ::google::protobuf::Message& msg)
{ {
IMConnMgr::Instance()->TraverseIMConn IMConnMgr::Instance()->TraverseIMConn

View File

@ -26,6 +26,7 @@ public:
void SyncNewFriend(Player* hum, const std::string& target_id); void SyncNewFriend(Player* hum, const std::string& target_id);
void SyncDeleteFriend(Player* hum, const std::string& target_id); void SyncDeleteFriend(Player* hum, const std::string& target_id);
void SyncUpdateFriend(Player* hum, const std::string& target_id); void SyncUpdateFriend(Player* hum, const std::string& target_id);
void SyncApplyFriend(Player* hum, const std::string& target_id);
void _SS_IM_FriendAgreeResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendAgreeResponse& msg); void _SS_IM_FriendAgreeResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendAgreeResponse& msg);
void _SS_IM_FriendDeleteResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendDeleteResponse& msg); void _SS_IM_FriendDeleteResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendDeleteResponse& msg);