Skip to content

Commit

Permalink
conversation group at type modify
Browse files Browse the repository at this point in the history
  • Loading branch information
FGadvancer committed Apr 22, 2022
1 parent 81bcf05 commit 98fc9b2
Show file tree
Hide file tree
Showing 2 changed files with 250 additions and 256 deletions.
8 changes: 1 addition & 7 deletions internal/conversation_msg/conversation_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,12 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
phNewConversationSet := make(map[string]*db.LocalConversation)
log.Info(operationID, "do Msg come here")
for _, v := range allMsg {
log.Error("this test", v.Options, v.ClientMsgID)

isHistory = utils.GetSwitchFromOptions(v.Options, constant.IsHistory)
isUnreadCount = utils.GetSwitchFromOptions(v.Options, constant.IsUnreadCount)
isConversationUpdate = utils.GetSwitchFromOptions(v.Options, constant.IsConversationUpdate)
isNotPrivate = utils.GetSwitchFromOptions(v.Options, constant.IsNotPrivate)
isSenderConversationUpdate = utils.GetSwitchFromOptions(v.Options, constant.IsSenderConversationUpdate)
//if v.ClientMsgID == "a1eb02b43909fbe33e44e80d2b49c87e" {
// log.Error("this test",v.Options,isConversationUpdate)
//}
msg := new(sdk_struct.MsgStruct)
copier.Copy(msg, v)
var tips server_api_params.TipsComm
Expand Down Expand Up @@ -268,7 +264,7 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
lc.FaceURL = msg.SenderFaceURL
case constant.GroupChatType:
//Generate At type into Conversation
c.genConversationGroupAtType(&lc, msg)
//c.genConversationGroupAtType(&lc, msg)
lc.GroupID = v.GroupID
lc.ConversationID = utils.GetConversationIDBySessionType(lc.GroupID, constant.GroupChatType)
//faceUrl, name, err := u.getGroupNameAndFaceUrlByUid(c.GroupID)
Expand Down Expand Up @@ -387,7 +383,6 @@ func (c *Conversation) diff(local, generated, cc, nc map[string]*db.LocalConvers
for _, v := range generated {
log.Debug("node diff", *v)
if localC, ok := local[v.ConversationID]; ok {
localC.GroupAtType = v.GroupAtType
if v.LatestMsgSendTime > localC.LatestMsgSendTime {
localC.UnreadCount = localC.UnreadCount + v.UnreadCount
localC.LatestMsg = v.LatestMsg
Expand Down Expand Up @@ -750,7 +745,6 @@ func (c *Conversation) updateConversation(lc *db.LocalConversation, cs map[strin
if oldC, ok := cs[lc.ConversationID]; !ok {
cs[lc.ConversationID] = lc
} else {
oldC.GroupAtType = lc.GroupAtType
if lc.LatestMsgSendTime > oldC.LatestMsgSendTime {
oldC.UnreadCount = oldC.UnreadCount + lc.UnreadCount
oldC.LatestMsg = lc.LatestMsg
Expand Down
Loading

0 comments on commit 98fc9b2

Please sign in to comment.