mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update DirectMessageController
This commit is contained in:
parent
fa8fbb7e86
commit
4b90b1e0df
2 changed files with 36 additions and 2 deletions
|
@ -307,6 +307,7 @@ class DirectMessageController extends Controller
|
||||||
'media' => $s->status->firstMedia() ? $s->status->firstMedia()->url() : null,
|
'media' => $s->status->firstMedia() ? $s->status->firstMedia()->url() : null,
|
||||||
'timeAgo' => $s->created_at->diffForHumans(null,null,true),
|
'timeAgo' => $s->created_at->diffForHumans(null,null,true),
|
||||||
'seen' => $s->read_at != null,
|
'seen' => $s->read_at != null,
|
||||||
|
'reportId' => (string) $s->status_id,
|
||||||
'meta' => json_decode($s->meta,true)
|
'meta' => json_decode($s->meta,true)
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
@ -589,7 +590,7 @@ class DirectMessageController extends Controller
|
||||||
{
|
{
|
||||||
$profile = $dm->author;
|
$profile = $dm->author;
|
||||||
$url = $dm->recipient->inbox_url;
|
$url = $dm->recipient->inbox_url;
|
||||||
|
|
||||||
$body = [
|
$body = [
|
||||||
'@context' => [
|
'@context' => [
|
||||||
'https://www.w3.org/ns/activitystreams',
|
'https://www.w3.org/ns/activitystreams',
|
||||||
|
|
|
@ -378,6 +378,14 @@
|
||||||
objDiv.scrollTop = objDiv.scrollHeight;
|
objDiv.scrollTop = objDiv.scrollHeight;
|
||||||
}, 300);
|
}, 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let options = localStorage.getItem('px_dm_options');
|
||||||
|
if(options) {
|
||||||
|
options = JSON.parse(options);
|
||||||
|
this.hideAvatars = options.hideAvatars;
|
||||||
|
this.hideTimestamps = options.hideTimestamps;
|
||||||
|
this.largerText = options.largerText;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -397,6 +405,21 @@
|
||||||
}
|
}
|
||||||
this.mutedNotifications = v;
|
this.mutedNotifications = v;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hideAvatars: function(v) {
|
||||||
|
this.hideAvatars = v;
|
||||||
|
this.updateOptions();
|
||||||
|
},
|
||||||
|
|
||||||
|
hideTimestamps: function(v) {
|
||||||
|
this.hideTimestamps = v;
|
||||||
|
this.updateOptions();
|
||||||
|
},
|
||||||
|
|
||||||
|
largerText: function(v) {
|
||||||
|
this.largerText = v;
|
||||||
|
this.updateOptions();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
updated() {
|
updated() {
|
||||||
|
@ -470,7 +493,7 @@
|
||||||
|
|
||||||
reportMessage() {
|
reportMessage() {
|
||||||
this.closeCtxMenu();
|
this.closeCtxMenu();
|
||||||
let url = '/i/report?type=post&id=' + this.ctxContext.id;
|
let url = '/i/report?type=post&id=' + this.ctxContext.reportId;
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
@ -642,6 +665,16 @@
|
||||||
|
|
||||||
showOptions() {
|
showOptions() {
|
||||||
this.page = 'options';
|
this.page = 'options';
|
||||||
|
},
|
||||||
|
|
||||||
|
updateOptions() {
|
||||||
|
let options = {
|
||||||
|
v: 1,
|
||||||
|
hideAvatars: this.hideAvatars,
|
||||||
|
hideTimestamps: this.hideTimestamps,
|
||||||
|
largerText: this.largerText
|
||||||
|
}
|
||||||
|
window.localStorage.setItem('px_dm_options', JSON.stringify(options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue