aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/interactions/interactions.js2
-rw-r--r--src/components/interactions/interactions.vue9
-rw-r--r--src/services/api/api.service.js282
-rw-r--r--src/services/entity_normalizer/entity_normalizer.service.js7
-rw-r--r--src/services/notification_utils/notification_utils.js6
-rw-r--r--src/services/notifications_fetcher/notifications_fetcher.service.js1
6 files changed, 306 insertions, 1 deletions
diff --git a/src/components/interactions/interactions.js b/src/components/interactions/interactions.js
index 7fe5e76d..54275a7b 100644
--- a/src/components/interactions/interactions.js
+++ b/src/components/interactions/interactions.js
@@ -4,6 +4,8 @@ const tabModeDict = {
mentions: ['mention'],
'likes+repeats': ['repeat', 'like'],
follows: ['follow'],
+ reactions: ['pleroma:emoji_reaction'],
+ reports: ['pleroma:report'],
moves: ['move']
}
diff --git a/src/components/interactions/interactions.vue b/src/components/interactions/interactions.vue
index 57d5d87c..b7291c02 100644
--- a/src/components/interactions/interactions.vue
+++ b/src/components/interactions/interactions.vue
@@ -22,6 +22,15 @@
:label="$t('interactions.follows')"
/>
<span
+ key="reactions"
+ :label="$t('interactions.emoji_reactions')"
+ />
+ <span
+ v-if="canSeeReports"
+ key="reports"
+ :label="$t('interactions.reports')"
+ />
+ <span
v-if="!allowFollowingMove"
key="moves"
:label="$t('interactions.moves')"
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index f4483149..405903a9 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -489,6 +489,285 @@ const deleteUser = ({ credentials, user }) => {
})
}
+/* eslint-disable */
+const report = {
+ "account": {
+ "acct": "reporting_account",
+ "avatar": "https://develop.ilja.space/images/avi.png",
+ "avatar_static": "https://develop.ilja.space/images/avi.png",
+ "bot": false,
+ "created_at": "2020-09-03T14:17:00.000Z",
+ "display_name": "Reporting Account",
+ "emojis": [],
+ "fields": [],
+ "followers_count": 0,
+ "following_count": 0,
+ "header": "https://develop.ilja.space/images/banner.png",
+ "header_static": "https://develop.ilja.space/images/banner.png",
+ "id": "9ymg9LnKk74wuk9lXk",
+ "locked": false,
+ "note": "I&#39;m an account made for an example report notification. I&#39;m the one that will do the reporting.",
+ "pleroma": {
+ "accepts_chat_messages": true,
+ "ap_id": "https://develop.ilja.space/users/reporting_account",
+ "background_image": null,
+ "confirmation_pending": false,
+ "deactivated": false,
+ "favicon": null,
+ "hide_favorites": true,
+ "hide_followers": false,
+ "hide_followers_count": false,
+ "hide_follows": false,
+ "hide_follows_count": false,
+ "is_admin": false,
+ "is_moderator": false,
+ "relationship": {},
+ "skip_thread_containment": false,
+ "tags": []
+ },
+ "source": {
+ "fields": [],
+ "note": "",
+ "pleroma": {
+ "actor_type": "Person",
+ "discoverable": false
+ },
+ "sensitive": false
+ },
+ "statuses_count": 0,
+ "url": "https://develop.ilja.space/users/reporting_account",
+ "username": "reporting_account"
+ },
+ "created_at": "2020-09-03T14:22:59.000Z",
+ "id": "5",
+ "pleroma": {
+ "is_muted": false,
+ "is_seen": false
+ },
+ "report": {
+ "account": {
+ "local": true,
+ "locked": false,
+ "acct": "reported_account",
+ "followers_count": 0,
+ "fields": [],
+ "avatar": "https://develop.ilja.space/images/avi.png",
+ "actor_type": "Person",
+ "url": "https://develop.ilja.space/users/reported_account",
+ "deactivated": false,
+ "id": "9ymgGklmHjZ2OpxVLM",
+ "bot": false,
+ "roles": {
+ "admin": false,
+ "moderator": false
+ },
+ "statuses_count": 1,
+ "nickname": "reported_account",
+ "display_name": "Reported Account",
+ "source": {
+ "fields": [],
+ "note": "",
+ "pleroma": {
+ "actor_type": "Person",
+ "discoverable": false
+ },
+ "sensitive": false
+ },
+ "pleroma": {
+ "accepts_chat_messages": true,
+ "ap_id": "https://develop.ilja.space/users/reported_account",
+ "background_image": null,
+ "confirmation_pending": false,
+ "favicon": null,
+ "hide_favorites": true,
+ "hide_followers": false,
+ "hide_followers_count": false,
+ "hide_follows": false,
+ "hide_follows_count": false,
+ "is_admin": false,
+ "is_moderator": false,
+ "relationship": {},
+ "skip_thread_containment": false,
+ "tags": []
+ },
+ "emojis": [],
+ "created_at": "2020-09-03T14:18:21.000Z",
+ "username": "reported_account",
+ "note": "I&#39;m an account made for an example report notification. I&#39;m the one that will be reported.",
+ "approval_pending": false,
+ "avatar_static": "https://develop.ilja.space/images/avi.png",
+ "header": "https://develop.ilja.space/images/banner.png",
+ "registration_reason": null,
+ "confirmation_pending": false,
+ "header_static": "https://develop.ilja.space/images/banner.png",
+ "following_count": 0,
+ "tags": []
+ },
+ "actor": {
+ "local": true,
+ "locked": false,
+ "acct": "reporting_account",
+ "followers_count": 0,
+ "fields": [],
+ "avatar": "https://develop.ilja.space/images/avi.png",
+ "actor_type": "Person",
+ "url": "https://develop.ilja.space/users/reporting_account",
+ "deactivated": false,
+ "id": "9ymg9LnKk74wuk9lXk",
+ "bot": false,
+ "roles": {
+ "admin": false,
+ "moderator": false
+ },
+ "statuses_count": 0,
+ "nickname": "reporting_account",
+ "display_name": "Reporting Account",
+ "source": {
+ "fields": [],
+ "note": "",
+ "pleroma": {
+ "actor_type": "Person",
+ "discoverable": false
+ },
+ "sensitive": false
+ },
+ "pleroma": {
+ "accepts_chat_messages": true,
+ "ap_id": "https://develop.ilja.space/users/reporting_account",
+ "background_image": null,
+ "confirmation_pending": false,
+ "favicon": null,
+ "hide_favorites": true,
+ "hide_followers": false,
+ "hide_followers_count": false,
+ "hide_follows": false,
+ "hide_follows_count": false,
+ "is_admin": false,
+ "is_moderator": false,
+ "relationship": {},
+ "skip_thread_containment": false,
+ "tags": []
+ },
+ "emojis": [],
+ "created_at": "2020-09-03T14:17:00.000Z",
+ "username": "reporting_account",
+ "note": "I&#39;m an account made for an example report notification. I&#39;m the one that will do the reporting.",
+ "approval_pending": false,
+ "avatar_static": "https://develop.ilja.space/images/avi.png",
+ "header": "https://develop.ilja.space/images/banner.png",
+ "registration_reason": null,
+ "confirmation_pending": false,
+ "header_static": "https://develop.ilja.space/images/banner.png",
+ "following_count": 0,
+ "tags": []
+ },
+ "content": "This is the report created by &quot;reporting_account&quot;. It reports &quot;reported_account&quot;.",
+ "created_at": "2020-09-03T14:22:59.000Z",
+ "id": "9ymggNcUyfIW8Cq1zM",
+ "notes": [],
+ "state": "open",
+ "statuses": [
+ {
+ "account": {
+ "acct": "reported_account",
+ "avatar": "https://develop.ilja.space/images/avi.png",
+ "avatar_static": "https://develop.ilja.space/images/avi.png",
+ "bot": false,
+ "created_at": "2020-09-03T14:18:21.000Z",
+ "display_name": "Reported Account",
+ "emojis": [],
+ "fields": [],
+ "followers_count": 0,
+ "following_count": 0,
+ "header": "https://develop.ilja.space/images/banner.png",
+ "header_static": "https://develop.ilja.space/images/banner.png",
+ "id": "9ymgGklmHjZ2OpxVLM",
+ "locked": false,
+ "note": "I&#39;m an account made for an example report notification. I&#39;m the one that will be reported.",
+ "pleroma": {
+ "accepts_chat_messages": true,
+ "ap_id": "https://develop.ilja.space/users/reported_account",
+ "background_image": null,
+ "confirmation_pending": false,
+ "favicon": null,
+ "hide_favorites": true,
+ "hide_followers": false,
+ "hide_followers_count": false,
+ "hide_follows": false,
+ "hide_follows_count": false,
+ "is_admin": false,
+ "is_moderator": false,
+ "relationship": {},
+ "skip_thread_containment": false,
+ "tags": []
+ },
+ "source": {
+ "fields": [],
+ "note": "",
+ "pleroma": {
+ "actor_type": "Person",
+ "discoverable": false
+ },
+ "sensitive": false
+ },
+ "statuses_count": 1,
+ "url": "https://develop.ilja.space/users/reported_account",
+ "username": "reported_account"
+ },
+ "application": {
+ "name": "Web",
+ "website": null
+ },
+ "bookmarked": false,
+ "card": null,
+ "content": "A post I made that will be included in the report",
+ "created_at": "2020-09-03T14:18:51.000Z",
+ "emojis": [],
+ "favourited": false,
+ "favourites_count": 0,
+ "id": "9ymgJaQxAbTzDDZMJs",
+ "in_reply_to_account_id": null,
+ "in_reply_to_id": null,
+ "language": null,
+ "media_attachments": [],
+ "mentions": [],
+ "muted": false,
+ "pinned": false,
+ "pleroma": {
+ "content": {
+ "text/plain": "A post I made that will be included in the report"
+ },
+ "conversation_id": 7,
+ "direct_conversation_id": null,
+ "emoji_reactions": [],
+ "expires_at": null,
+ "in_reply_to_account_acct": null,
+ "local": true,
+ "parent_visible": false,
+ "spoiler_text": {
+ "text/plain": ""
+ },
+ "thread_muted": false
+ },
+ "poll": null,
+ "reblog": null,
+ "reblogged": false,
+ "reblogs_count": 0,
+ "replies_count": 0,
+ "sensitive": false,
+ "spoiler_text": "",
+ "tags": [],
+ "text": null,
+ "uri": "https://develop.ilja.space/objects/8fe7611a-07e7-403a-ae08-f74580b6cc53",
+ "url": "https://develop.ilja.space/notice/9ymgJaQxAbTzDDZMJs",
+ "visibility": "public"
+ }
+ ]
+ },
+ "type": "pleroma:report"
+}
+/* eslint-enable */
+
const fetchTimeline = ({
timeline,
credentials,
@@ -566,6 +845,9 @@ const fetchTimeline = ({
.then((data) => data.json())
.then((data) => {
if (!data.errors) {
+ if (isNotifications) {
+ return { data: [parseNotification(report)], pagination }
+ }
return { data: data.map(isNotifications ? parseNotification : parseStatus), pagination }
} else {
data.status = status
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index 206e6281..f71d6609 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -387,6 +387,13 @@ export const parseNotification = (data) => {
: parseUser(data.target)
output.from_profile = parseUser(data.account)
output.emoji = data.emoji
+ if (data.report) {
+ output.report = data.report
+ output.report.content = data.report.content
+ output.report.acct = parseUser(data.report.account)
+ output.report.actor = parseUser(data.report.actor)
+ output.report.statuses = data.report.statuses.map(parseStatus)
+ }
} else {
const parsedNotice = parseStatus(data.notice)
output.type = data.ntype
diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js
index d912d19f..dff97aa2 100644
--- a/src/services/notification_utils/notification_utils.js
+++ b/src/services/notification_utils/notification_utils.js
@@ -14,7 +14,8 @@ export const visibleTypes = store => {
rootState.config.notificationVisibility.follows && 'follow',
rootState.config.notificationVisibility.followRequest && 'follow_request',
rootState.config.notificationVisibility.moves && 'move',
- rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction'
+ rootState.config.notificationVisibility.emojiReactions && 'pleroma:emoji_reaction',
+ rootState.config.notificationVisibility.reports && 'pleroma:report'
].filter(_ => _))
}
@@ -91,6 +92,9 @@ export const prepareNotificationObject = (notification, i18n) => {
case 'follow_request':
i18nString = 'follow_request'
break
+ case 'pleroma:report':
+ i18nString = 'reported'
+ break
}
if (notification.type === 'pleroma:emoji_reaction') {
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js
index beeb167c..91861b21 100644
--- a/src/services/notifications_fetcher/notifications_fetcher.service.js
+++ b/src/services/notifications_fetcher/notifications_fetcher.service.js
@@ -61,6 +61,7 @@ const fetchNotifications = ({ store, args, older }) => {
messageArgs: [error.message],
timeout: 5000
})
+ console.error(error)
})
}