diff --git a/src/assets/css/contentcredentials.scss b/src/assets/css/contentcredentials.scss new file mode 100644 index 0000000..ace2182 --- /dev/null +++ b/src/assets/css/contentcredentials.scss @@ -0,0 +1,13 @@ + .cc-detail-info { + color: #333333; + background-color: #DAD9FC; + padding: 16px; + margin: 16px 0 16px 0; + border-radius: 8px 8px 0 8px; + font-family: "Inter", sans-serif; + font-weight: 400; + font-size: 14px; + line-height: 125%; + letter-spacing: 0.4px; + vertical-align: middle; + } \ No newline at end of file diff --git a/src/assets/css/sendattachments.scss b/src/assets/css/sendattachments.scss index 1aac19a..4ce3301 100644 --- a/src/assets/css/sendattachments.scss +++ b/src/assets/css/sendattachments.scss @@ -622,20 +622,6 @@ $hiliteColor: #4642f1; } } - .detail-info { - color: #333333; - background-color: #DAD9FC; - padding: 16px; - margin: 16px 0 16px 0; - border-radius: 8px 8px 0 8px; - font-family: "Inter", sans-serif; - font-weight: 400; - font-size: 14px; - line-height: 125%; - letter-spacing: 0.4px; - vertical-align: middle; - } - .detail-row { margin-top: 12px; font-family: "Inter", sans-serif; diff --git a/src/assets/css/typography.scss b/src/assets/css/typography.scss index 76bc975..1231033 100644 --- a/src/assets/css/typography.scss +++ b/src/assets/css/typography.scss @@ -74,3 +74,16 @@ text-decoration-skip-ink: none; color: rgba(0,0,0,0.60); } + +.common-caption-small { + font-family: "Inter"; + font-size: 12 * $chat-text-size; + font-weight: 400; + font-style: italic; + line-height: 125%; + letter-spacing: 0.40 * $chat-text-size; + text-align: left; + text-underline-position: from-font; + text-decoration-skip-ink: none; + color: #545F71; +} diff --git a/src/assets/icons/ic_intervention.vue b/src/assets/icons/ic_intervention.vue new file mode 100644 index 0000000..ed977ea --- /dev/null +++ b/src/assets/icons/ic_intervention.vue @@ -0,0 +1,23 @@ + diff --git a/src/assets/icons/ic_intervention_check.vue b/src/assets/icons/ic_intervention_check.vue new file mode 100644 index 0000000..904f86b --- /dev/null +++ b/src/assets/icons/ic_intervention_check.vue @@ -0,0 +1,23 @@ + diff --git a/src/assets/translations/en.json b/src/assets/translations/en.json index fa95640..f6025f6 100644 --- a/src/assets/translations/en.json +++ b/src/assets/translations/en.json @@ -515,5 +515,8 @@ "cc_source": "Source", "cc_capture_timestamp": "Capture Timestamp", "cc_location": "Location" + }, + "cc": { + "metadata-stripped": "Image has been compressed and stripped of metadata.\n\nWe think this image has additional file information. If you want to learn more, ask the sender to share the original." } } diff --git a/src/components/content-credentials/C2PAInfo.vue b/src/components/content-credentials/C2PAInfo.vue index 7d1e5c8..a72cedc 100644 --- a/src/components/content-credentials/C2PAInfo.vue +++ b/src/components/content-credentials/C2PAInfo.vue @@ -8,15 +8,15 @@ {{ t("file_mode.content_credentials_info") }} -
+
{{ infoText }}
import { useI18n } from "vue-i18n"; -import { - ProofHintFlags, -} from "../../models/proof"; +import { ProofHintFlags } from "../../models/proof"; import { ref, Ref, watch } from "vue"; import dayjs from "dayjs"; import CCProperty from "./CCProperty.vue"; @@ -64,17 +62,15 @@ watch( } let result = ""; - if (props.flags.camera) { + if (props.flags.generator === "camera") { result += t("file_mode.captured_with_camera"); - } - if (props.flags.screenshot) { + } else if (props.flags.generator === "screenshot") { if (date) { result += t("file_mode.captured_screenshot_ago", { ago: date.fromNow(true) }); } else { result += t("file_mode.captured_screenshot"); } - } - if (props.flags.aiGenerated) { + } else if (props.flags.generator === "ai") { if (date) { result += t("file_mode.generated_with_ai_ago", { ago: date.fromNow(true) }); } else { @@ -93,9 +89,9 @@ watch( }, { immediate: true } ); - diff --git a/src/components/content-credentials/CCSummary.vue b/src/components/content-credentials/CCSummary.vue new file mode 100644 index 0000000..a064a7a --- /dev/null +++ b/src/components/content-credentials/CCSummary.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/file_mode/EventAttachmentInfo.vue b/src/components/file_mode/EventAttachmentInfo.vue index 46fbb89..57739e9 100644 --- a/src/components/file_mode/EventAttachmentInfo.vue +++ b/src/components/file_mode/EventAttachmentInfo.vue @@ -5,6 +5,7 @@
+
{{ t("cc.metadata-stripped") }}
@@ -19,23 +20,29 @@ import { computed, onMounted, Ref, ref } from "vue"; import { EventAttachment } from "../../models/eventAttachment"; import proofmode from "../../plugins/proofmode"; import { extractProofHintFlags } from "../../models/proof"; +import { useI18n } from "vue-i18n"; + +const { t } = useI18n(); const { attachment } = defineProps<{ attachment?: EventAttachment; }>(); const loadingProof: Ref = ref(false); +const metaStripped: Ref = ref(false); onMounted(() => { if (attachment?.proofHintFlags && attachment.proof === undefined) { const a = attachment; loadingProof.value = true; + metaStripped.value = true; a.loadSrc() .then((data) => { if (data && data.data) { return proofmode.proofCheckSource(data.data).then((res) => { a.proof = res; a.proofHintFlags = extractProofHintFlags(a.proof); + metaStripped.value = a?.proof?.integrity?.c2pa === undefined && a?.proof?.integrity?.exif === undefined; }); } }) @@ -43,6 +50,8 @@ onMounted(() => { .finally(() => { loadingProof.value = false; }); + } else { + metaStripped.value = attachment?.proof?.integrity?.c2pa === undefined && attachment?.proof?.integrity?.exif === undefined; } }); @@ -58,4 +67,5 @@ const hasExif = computed(() => { diff --git a/src/components/file_mode/GalleryItemsView.vue b/src/components/file_mode/GalleryItemsView.vue index 4476f3b..2c0494e 100644 --- a/src/components/file_mode/GalleryItemsView.vue +++ b/src/components/file_mode/GalleryItemsView.vue @@ -105,7 +105,7 @@ watch(props.items, (newValue: EventAttachment[], oldValue: EventAttachment[]) => // Added or removed? if (newValue && oldValue && newValue.length > oldValue.length) { currentAttachment.value = newValue[oldValue.length]; - } else if (newValue) { + } else if (newValue && oldValue && newValue.length < oldValue.length) { currentAttachment.value = newValue[newValue.length - 1]; } }); @@ -119,6 +119,7 @@ const downloadOne = () => { const downloadAll = () => { props.items.forEach((item) => util.download($matrix.matrixClient, $matrix.useAuthedMedia, item.event)); }; +