This commit is contained in:
aozhiwei 2024-04-07 17:58:41 +08:00
parent 1a63fe4a4a
commit 7acea617ca
2 changed files with 8 additions and 7 deletions

View File

@ -373,7 +373,7 @@ func (this *friendMgr) AsyncRemoveBlack(senderId string, targetId string, cb fun
func (this *friendMgr) addFriendShip(accountId1 string, accountId2 string, addTime int32) { func (this *friendMgr) addFriendShip(accountId1 string, accountId2 string, addTime int32) {
{ {
friends := this.getFriends(accountId1) friends := this.getFriends(accountId1)
if friends != nil { if friends == nil {
this.friendHash[accountId1] = make(map[string]int32) this.friendHash[accountId1] = make(map[string]int32)
friends = this.getFriends(accountId1) friends = this.getFriends(accountId1)
} }
@ -381,7 +381,7 @@ func (this *friendMgr) addFriendShip(accountId1 string, accountId2 string, addTi
} }
{ {
friends := this.getFriends(accountId2) friends := this.getFriends(accountId2)
if friends != nil { if friends == nil {
this.friendHash[accountId2] = make(map[string]int32) this.friendHash[accountId2] = make(map[string]int32)
friends = this.getFriends(accountId2) friends = this.getFriends(accountId2)
} }
@ -407,7 +407,7 @@ func (this *friendMgr) removeFriendShip(accountId1 string, accountId2 string) {
func (this *friendMgr) addBlackList(accountId string, blockId string, addTime int32) { func (this *friendMgr) addBlackList(accountId string, blockId string, addTime int32) {
{ {
blacks := this.getBlacks(accountId) blacks := this.getBlacks(accountId)
if blacks != nil { if blacks == nil {
this.blackHash[accountId] = make(map[string]int32) this.blackHash[accountId] = make(map[string]int32)
blacks = this.getBlacks(accountId) blacks = this.getBlacks(accountId)
} }

View File

@ -135,8 +135,9 @@ func (this *player) CMListFriend(hdr *f5.MsgHdr, msg *cs.CMListFriend) {
for _, accountId := range(friendList) { for _, accountId := range(friendList) {
userProfile := GetCacheMgr().GetUserProfile(accountId) userProfile := GetCacheMgr().GetUserProfile(accountId)
if userProfile != nil { if userProfile != nil {
ele := q5.NewSliceElement(&rspMsg.Users) ele := new(cs.MFUser)
userProfile.FillMFUser(*ele) q5.AppendSlice(&rspMsg.Users, ele)
userProfile.FillMFUser(ele)
} }
} }
this.SendMsg(rspMsg) this.SendMsg(rspMsg)
@ -217,8 +218,8 @@ func (this *player) CMAcceptFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAcceptFriend
constant.FRIEND_DB, constant.FRIEND_DB,
"t_friend_apply", "t_friend_apply",
[][]string{ [][]string{
{"sender_id", this.GetAccountId()}, {"sender_id", msg.GetTargetAccountId()},
{"target_id", msg.GetTargetAccountId()}, {"target_id", this.GetAccountId()},
{"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)}, {"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)},
}, },
func (err error, ds *f5.DataSet) { func (err error, ds *f5.DataSet) {