完成事件记录

This commit is contained in:
aozhiwei 2020-06-19 14:56:02 +08:00
parent 154959fbce
commit 9e3e8d4011
2 changed files with 20 additions and 2 deletions

View File

@ -37,6 +37,7 @@ enum NetHandler_e
const char* const PROJ_NAME_FMT = "friend_imserver"; const char* const PROJ_NAME_FMT = "friend_imserver";
const char* const PROJ_ROOT_FMT = "/data/logs/%s"; const char* const PROJ_ROOT_FMT = "/data/logs/%s";
const char* const EVENT_FRIEND_AGREE = "friend.agree";
const char* const EVENT_FRIEND_DELETE = "friend.delete"; const char* const EVENT_FRIEND_DELETE = "friend.delete";
const int MAX_INSTANCE_ID = 1023; const int MAX_INSTANCE_ID = 1023;

View File

@ -9,6 +9,7 @@
#include "app.h" #include "app.h"
#include "IMConn.h" #include "IMConn.h"
#include "IMConnMgr.h" #include "IMConnMgr.h"
#include "dbhelper.h"
#include "cs_proto.pb.h" #include "cs_proto.pb.h"
#include "ss_proto.pb.h" #include "ss_proto.pb.h"
@ -140,10 +141,26 @@ void SyncHelper::RemovePendingRequest(long long seqid)
void SyncHelper::SS_IM_FriendAgreeRequest_TimeOut(ss::SS_IM_FriendAgreeRequest* msg) void SyncHelper::SS_IM_FriendAgreeRequest_TimeOut(ss::SS_IM_FriendAgreeRequest* msg)
{ {
std::string event_data;
msg->context().user_info().SerializeToString(&event_data);
DBHelper::Instance()->AddEvent
(
msg->context().user_info().base_data().account_id(),
msg->target_id(),
EVENT_FRIEND_AGREE,
event_data
);
} }
void SyncHelper::SS_IM_FriendDeleteRequest_TimeOut(ss::SS_IM_FriendDeleteRequest* msg) void SyncHelper::SS_IM_FriendDeleteRequest_TimeOut(ss::SS_IM_FriendDeleteRequest* msg)
{ {
std::string event_data;
msg->context().user_info().SerializeToString(&event_data);
DBHelper::Instance()->AddEvent
(
msg->context().user_info().base_data().account_id(),
msg->target_id(),
EVENT_FRIEND_DELETE,
event_data
);
} }