Skip to content

Commit 2802f74

Browse files
committed
conversation update
1 parent 23f3195 commit 2802f74

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

internal/conversation_msg/conversation_msg.go

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,6 @@ func NewConversation(ws *ws.Ws, db *db.DataBase, p *ws.PostApi,
5151
return n
5252
}
5353

54-
//func NewConversation() *Conversation {
55-
// return &Conversation{}
56-
//}
57-
58-
//func (c *Conversation) Init(ws *ws.Ws, db *db.DataBase, ch chan common.Cmd2Value, loginUserID string, friend *friend.Friend, group *group.Group, user *user.User) {
59-
// c.Ws = ws
60-
// c.db = db
61-
// c.ch = ch
62-
// c.loginUserID = c.loginUserID
63-
// c.friend = friend
64-
// c.group = group
65-
// c.user = user
66-
// go common.DoListener(c)
67-
//}
68-
6954
func (c *Conversation) GetCh() chan common.Cmd2Value {
7055
return c.ch
7156
}
@@ -190,7 +175,9 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
190175
if isHistory {
191176
insertMsg = append(insertMsg, c.msgStructToLocalChatLog(msg))
192177
}
193-
178+
if msg.ContentType == constant.HasReadReceipt {
179+
msgReadList = append(msgReadList, msg)
180+
}
194181
}
195182
} else { //Sent by others
196183
if b, _ := c.db.MessageIfExists(msg.ClientMsgID); !b { //Deduplication operation
@@ -221,7 +208,6 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
221208
lc.UnreadCount = 1
222209
}
223210

224-
//u.doUpdateConversation(cmd2Value{Value: updateConNode{c.ConversationID, UpdateFaceUrlAndNickName, c}})
225211
if isConversationUpdate {
226212
c.updateConversation(&lc, conversationSet)
227213
newMessages = append(newMessages, msg)
@@ -285,10 +271,7 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
285271
c.doMsgReadState(msgReadList)
286272
c.revokeMessage(msgRevokeList)
287273
c.newMessage(newMessages)
288-
//u.doUpdateConversation(cmd2Value{Value: updateConNode{"", ConChange, ""}})
289274
log.Info(operationID, "trigger map is :", newConversationSet, conversationChangedSet)
290-
//u.doUpdateConversation(cmd2Value{Value: updateConNode{"", NewCon, mapKeyToStringList(newConversationSet)}})
291-
//u.doUpdateConversation(cmd2Value{Value: updateConNode{"", ConChange, mapKeyToStringList(conversationChangSet)}})
292275
if len(newConversationSet) != 0 {
293276
c.ConversationListener.OnNewConversation(utils.StructToJsonString(mapConversationToList(newConversationSet)))
294277
}
@@ -299,8 +282,6 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
299282
if isTriggerUnReadCount {
300283
c.doUpdateConversation(common.Cmd2Value{Value: common.UpdateConNode{"", constant.TotalUnreadMessageChanged, ""}})
301284
}
302-
//sdkLog("length msgListenerList", u.MsgListenerList, "length message", len(newMessages), "msgListenerLen", len(u.MsgListenerList))
303-
304285
}
305286
func listToMap(list []*db.LocalConversation, m map[string]*db.LocalConversation) {
306287
for _, v := range list {

0 commit comments

Comments
 (0)