Skip to content

Commit

Permalink
Default to type LINK when converting to protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmotta committed Aug 17, 2023
1 parent 1604076 commit ee9e510
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions protocol/common/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,8 @@ func isValidLinkPreviewForProto(preview LinkPreview) bool {
switch preview.Type {
case protobuf.UnfurledLink_IMAGE:
return preview.URL != "" && isValidLinkPreviewThumbnail(preview.Thumbnail)
case protobuf.UnfurledLink_LINK:
default: // Validate as a link type by default.
return preview.Title != "" && preview.URL != "" && isValidLinkPreviewThumbnail(preview.Thumbnail)
default:
return false
}
}

Expand Down

0 comments on commit ee9e510

Please sign in to comment.