Support unofficial status.quote

This commit is contained in:
Lim Chee Aun 2024-01-25 12:59:53 +08:00
parent 4ca9a802e3
commit a2d995ec07

View file

@ -187,9 +187,19 @@ export function saveStatus(status, instance, opts) {
if (oldStatus?._pinned) status._pinned = oldStatus._pinned;
// if (oldStatus?._filtered) status._filtered = oldStatus._filtered;
states.statuses[key] = status;
if (status.reblog) {
const key = statusKey(status.reblog.id, instance);
states.statuses[key] = status.reblog;
if (status.reblog?.id) {
const srKey = statusKey(status.reblog.id, instance);
states.statuses[srKey] = status.reblog;
}
if (status.quote?.id) {
const sKey = statusKey(status.quote.id, instance);
states.statuses[sKey] = status.quote;
states.statusQuotes[key] = [
{
id: status.quote.id,
instance,
},
];
}
});