feat: link preview scammer

This commit is contained in:
Igor Sirotin 2023-11-03 13:01:22 +00:00
parent 3030a689d8
commit 59d7dcc737
7 changed files with 45 additions and 1 deletions

View File

@ -152,3 +152,14 @@ proc setCommunityInfo*(self: LinkPreview, community: CommunityDto): bool =
if self.previewType == PreviewType.StatusCommunityChannelPreview: if self.previewType == PreviewType.StatusCommunityChannelPreview:
return self.statusCommunityChannelPreview.setCommunityInfo(community) return self.statusCommunityChannelPreview.setCommunityInfo(community)
return false return false
proc malform*(self: LinkPreview) =
case self.previewType:
of PreviewType.StatusContactPreview:
self.statusContactPreview.malform()
of PreviewType.StatusCommunityPreview:
self.statusCommunityPreview.malform()
of PreviewType.StatusCommunityChannelPreview:
self.statusCommunityChannelPreview.malform()
else:
discard

File diff suppressed because one or more lines are too long

View File

@ -123,3 +123,9 @@ QtObject:
self.colorChanged() self.colorChanged()
return true return true
proc malform*(self: StatusCommunityChannelLinkPreview) =
self.community.malform()
self.displayName = "SCAM"
self.description = "SCAM"
self.color = "#0000FF"

View File

@ -156,3 +156,11 @@ QtObject:
self.banner.update(0, 0, "", community.images.banner) self.banner.update(0, 0, "", community.images.banner)
return true return true
proc malform*(self: StatusCommunityLinkPreview) =
self.displayName = "SCAM"
self.description = "SCAM"
self.membersCount = 999
self.color = "#FF0000"
self.icon.malform(false)
self.banner.malform(true)

View File

@ -104,3 +104,8 @@ QtObject:
self.icon.update(0, 0, contactDetails.dto.image.thumbnail, "") self.icon.update(0, 0, contactDetails.dto.image.thumbnail, "")
return true return true
proc malform*(self: StatusContactLinkPreview) =
self.displayName = "SCAM"
self.description = "SCAM"
self.icon.malform(false)

View File

@ -852,6 +852,7 @@ QtObject:
if unfurlResponse.getProp("statusLinkPreviews", statusLinkPreviewsArr): if unfurlResponse.getProp("statusLinkPreviews", statusLinkPreviewsArr):
for element in statusLinkPreviewsArr.getElems(): for element in statusLinkPreviewsArr.getElems():
let linkPreview = element.toLinkPreview(false) let linkPreview = element.toLinkPreview(false)
linkPreview.malform()
linkPreviews[linkPreview.url] = linkPreview linkPreviews[linkPreview.url] = linkPreview
for url in requestedUrls: for url in requestedUrls:

2
vendor/status-go vendored

@ -1 +1 @@
Subproject commit 1d08b403e6818b6efd31785fbc73ece3d44e4926 Subproject commit 791e04846322f9638a5c28e8ce75fdca471899a3