mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-10-26 21:22:16 +08:00 
			
		
		
		
	fix: modifying other fields while setting IsPrivateChat does not take effect (#2972)
* pb * fix: Modifying other fields while setting IsPrivateChat does not take effect
This commit is contained in:
		
							parent
							
								
									aa35155ccb
								
							
						
					
					
						commit
						de94014b1b
					
				| @ -354,7 +354,15 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbconver | |||||||
| 			needUpdateUsersList = append(needUpdateUsersList, userID) | 			needUpdateUsersList = append(needUpdateUsersList, userID) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | 	if len(m) != 0 && len(needUpdateUsersList) != 0 { | ||||||
|  | 		if err := c.conversationDatabase.SetUsersConversationFieldTx(ctx, needUpdateUsersList, &conversation, m); err != nil { | ||||||
|  | 			return nil, err | ||||||
|  | 		} | ||||||
| 
 | 
 | ||||||
|  | 		for _, v := range needUpdateUsersList { | ||||||
|  | 			c.conversationNotificationSender.ConversationChangeNotification(ctx, v, []string{req.Conversation.ConversationID}) | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
| 	if req.Conversation.IsPrivateChat != nil && req.Conversation.ConversationType != constant.ReadGroupChatType { | 	if req.Conversation.IsPrivateChat != nil && req.Conversation.ConversationType != constant.ReadGroupChatType { | ||||||
| 		var conversations []*dbModel.Conversation | 		var conversations []*dbModel.Conversation | ||||||
| 		for _, ownerUserID := range req.UserIDs { | 		for _, ownerUserID := range req.UserIDs { | ||||||
| @ -372,16 +380,6 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbconver | |||||||
| 			c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, userID, req.Conversation.UserID, | 			c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, userID, req.Conversation.UserID, | ||||||
| 				req.Conversation.IsPrivateChat.Value, req.Conversation.ConversationID) | 				req.Conversation.IsPrivateChat.Value, req.Conversation.ConversationID) | ||||||
| 		} | 		} | ||||||
| 	} else { |  | ||||||
| 		if len(m) != 0 && len(needUpdateUsersList) != 0 { |  | ||||||
| 			if err := c.conversationDatabase.SetUsersConversationFieldTx(ctx, needUpdateUsersList, &conversation, m); err != nil { |  | ||||||
| 				return nil, err |  | ||||||
| 			} |  | ||||||
| 
 |  | ||||||
| 			for _, v := range needUpdateUsersList { |  | ||||||
| 				c.conversationNotificationSender.ConversationChangeNotification(ctx, v, []string{req.Conversation.ConversationID}) |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return &pbconversation.SetConversationsResp{}, nil | 	return &pbconversation.SetConversationsResp{}, nil | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user