@@ -315,12 +315,6 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbconver
315
315
}
316
316
}
317
317
318
- if len (m ) != 0 {
319
- if err := c .conversationDatabase .SetUsersConversationFieldTx (ctx , req .UserIDs , & conversation , m ); err != nil {
320
- return nil , err
321
- }
322
- }
323
-
324
318
if req .Conversation .IsPrivateChat != nil && req .Conversation .ConversationType != constant .ReadGroupChatType {
325
319
var conversations []* dbModel.Conversation
326
320
for _ , ownerUserID := range req .UserIDs {
@@ -338,12 +332,19 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbconver
338
332
c .conversationNotificationSender .ConversationSetPrivateNotification (ctx , userID , req .Conversation .UserID ,
339
333
req .Conversation .IsPrivateChat .Value , req .Conversation .ConversationID )
340
334
}
341
- }
335
+ } else {
336
+ if len (m ) != 0 {
337
+ if err := c .conversationDatabase .SetUsersConversationFieldTx (ctx , req .UserIDs , & conversation , m ); err != nil {
338
+ return nil , err
339
+ }
342
340
343
- if unequal > 0 {
344
- for _ , v := range req .UserIDs {
345
- c .conversationNotificationSender .ConversationChangeNotification (ctx , v , []string {req .Conversation .ConversationID })
341
+ if unequal > 0 {
342
+ for _ , v := range req .UserIDs {
343
+ c .conversationNotificationSender .ConversationChangeNotification (ctx , v , []string {req .Conversation .ConversationID })
344
+ }
345
+ }
346
346
}
347
+
347
348
}
348
349
349
350
return & pbconversation.SetConversationsResp {}, nil
0 commit comments