status-go/protocol/messenger_util.go

17 lines
674 B
Go
Raw Normal View History

2024-03-22 10:55:09 +00:00
package protocol
import "github.com/status-im/status-go/protocol/common"
// GetResendTypeForChat returns the resend type for a chat.
// This function currently infers the ResendType from the chat type.
// However, it is recommended to explicitly determine the ResendType based on
// specific message characteristics to avoid implicit assumptions. This ensures
// that each message dictates its ResendType based on its own properties and
// context, rather than the chat type it is associated with.
func GetResendTypeForChat(chat *Chat) common.ResendType {
if chat.ChatType == ChatTypeOneToOne {
return common.ResendTypeDataSync
}
return common.ResendTypeRawMessage
}