Added switch to persistence

This commit is contained in:
Samuel Hawksby-Robinson 2020-07-10 15:20:18 +01:00 committed by Andrea Maria Piana
parent 351cc4403d
commit fc7b311838
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
1 changed files with 6 additions and 8 deletions

View File

@ -173,17 +173,15 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message
message.Alias = alias.String
message.Identicon = identicon.String
// TODO switch
if message.ContentType == protobuf.ChatMessage_STICKER {
switch message.ContentType {
case protobuf.ChatMessage_STICKER:
message.Payload = &protobuf.ChatMessage_Sticker{Sticker: sticker}
}
if message.ContentType == protobuf.ChatMessage_AUDIO {
message.Payload = &protobuf.ChatMessage_Audio{Audio: audio}
}
if message.ContentType == protobuf.ChatMessage_TRANSACTION_COMMAND {
case protobuf.ChatMessage_TRANSACTION_COMMAND:
message.CommandParameters = command
}