Don't resend automatically group chat messages

Since we fixed re-sending of messages, it has been noticed a performance
degradation in private group chats.
This is due to too aggressive re-sending of messages.
This commit disables resending of private group chat messages for now
(same as 1.9, so no changes), but keeps it enabled for 1-to-1s.
This commit is contained in:
Andrea Maria Piana 2021-01-08 20:33:19 +01:00
parent cd21f9b0e2
commit 4084c9d82c
1 changed files with 28 additions and 35 deletions

View File

@ -1220,7 +1220,6 @@ func (m *Messenger) CreateGroupChatWithMembers(ctx context.Context, name string,
Payload: encodedMessage, Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE, MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE,
Recipients: recipients, Recipients: recipients,
ResendAutomatically: true,
}) })
if err != nil { if err != nil {
@ -1303,7 +1302,6 @@ func (m *Messenger) RemoveMemberFromGroupChat(ctx context.Context, chatID string
Payload: encodedMessage, Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE, MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE,
Recipients: oldRecipients, Recipients: oldRecipients,
ResendAutomatically: true,
}) })
if err != nil { if err != nil {
return nil, err return nil, err
@ -1392,7 +1390,6 @@ func (m *Messenger) AddMembersToGroupChat(ctx context.Context, chatID string, me
Payload: encodedMessage, Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE, MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE,
Recipients: recipients, Recipients: recipients,
ResendAutomatically: true,
}) })
if err != nil { if err != nil {
@ -1457,7 +1454,6 @@ func (m *Messenger) ChangeGroupChatName(ctx context.Context, chatID string, name
Payload: encodedMessage, Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE, MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE,
Recipients: recipients, Recipients: recipients,
ResendAutomatically: true,
}) })
if err != nil { if err != nil {
@ -1668,7 +1664,6 @@ func (m *Messenger) AddAdminsToGroupChat(ctx context.Context, chatID string, mem
Payload: encodedMessage, Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE, MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE,
Recipients: recipients, Recipients: recipients,
ResendAutomatically: true,
}) })
if err != nil { if err != nil {
@ -1736,7 +1731,6 @@ func (m *Messenger) ConfirmJoiningGroup(ctx context.Context, chatID string) (*Me
Payload: encodedMessage, Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE, MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE,
Recipients: recipients, Recipients: recipients,
ResendAutomatically: true,
}) })
if err != nil { if err != nil {
return nil, err return nil, err
@ -1804,7 +1798,6 @@ func (m *Messenger) LeaveGroupChat(ctx context.Context, chatID string, remove bo
Payload: encodedMessage, Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE, MessageType: protobuf.ApplicationMetadataMessage_MEMBERSHIP_UPDATE_MESSAGE,
Recipients: recipients, Recipients: recipients,
ResendAutomatically: true,
}) })
if err != nil { if err != nil {
return nil, err return nil, err