summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrille Bollu <cyrille@bollu.be>2019-07-15 14:38:21 +0200
committerCyrille Bollu <cyrille@bollu.be>2019-07-15 14:40:21 +0200
commitd025569f5e4c21ecfc251c95642640d35d9169a1 (patch)
tree7d2184d49fe0d7a23e9067e66bac82c2e6d3da55
parentc8d98a421a6ab49fe9a44f79119d1bd3e75be091 (diff)
Fixes the PostAttachment component: It now works.
Note: This requires adding NoCSRFRequired in NavigationController' documentGet() function. It doesn't seem to raise any risk though. Signed-off-by: Cyrille Bollu <cyrille@bollu.be>
-rw-r--r--lib/Controller/NavigationController.php1
-rw-r--r--src/components/PostAttachment.vue8
-rw-r--r--src/components/TimelinePost.vue2
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php
index c4438e5a..331c7701 100644
--- a/lib/Controller/NavigationController.php
+++ b/lib/Controller/NavigationController.php
@@ -282,6 +282,7 @@ class NavigationController extends Controller {
/**
* @NoAdminRequired
+ * @NoCSRFRequired
*
* @param string $id
*
diff --git a/src/components/PostAttachment.vue b/src/components/PostAttachment.vue
index 1ce153e0..47c69f5f 100644
--- a/src/components/PostAttachment.vue
+++ b/src/components/PostAttachment.vue
@@ -1,6 +1,6 @@
<template>
<div class="post-attachment">
- <img :src='url' />
+ <img ref='image' src='' />
</div>
</template>
@@ -10,13 +10,17 @@ export default {
components: {
},
mixins: [],
- props: ['url'],
+ props: ['id'],
data() {
return {
}
},
computed: {
},
+ mounted() {
+ var image = this.$refs.image
+ image.src = OC.generateUrl('/apps/social/document/get?id=' + this.id)
+ },
methods: {
}
}
diff --git a/src/components/TimelinePost.vue b/src/components/TimelinePost.vue
index 1779ac29..d67ffe95 100644
--- a/src/components/TimelinePost.vue
+++ b/src/components/TimelinePost.vue
@@ -25,7 +25,7 @@
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="post-message" v-html="formatedMessage" />
<div v-if="hasAttachments" class="post-attachments">
- <post-attachment v-for="attachment in item.attachment" :key="attachment.id" :url="attachment.url" />
+ <post-attachment v-for="attachment in item.attachment" :key="attachment.id" :id="attachment.id" />
</div>
<div v-click-outside="hidePopoverMenu" class="post-actions">
<a v-tooltip.bottom="t('social', 'Reply')" class="icon-reply" @click.prevent="reply" />