2018-04-17 04:56:21 +01:00
|
|
|
import {
|
|
|
|
getNotificationIdsForStatuses as getNotificationIdsForStatusesFromDatabase,
|
|
|
|
getReblogsForStatus as getReblogsForStatusFromDatabase
|
|
|
|
} from '../_database/timelines/lookup'
|
|
|
|
import {
|
|
|
|
getStatus as getStatusFromDatabase
|
|
|
|
} from '../_database/timelines/getStatusOrNotification'
|
2018-02-17 03:38:21 +00:00
|
|
|
|
|
|
|
export async function getIdThatThisStatusReblogged (instanceName, statusId) {
|
2018-04-17 04:56:21 +01:00
|
|
|
let status = await getStatusFromDatabase(instanceName, statusId)
|
2018-02-17 03:38:21 +00:00
|
|
|
return status.reblog && status.reblog.id
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function getIdsThatTheseStatusesReblogged (instanceName, statusIds) {
|
|
|
|
let reblogIds = await Promise.all(statusIds.map(async statusId => {
|
|
|
|
return getIdThatThisStatusReblogged(instanceName, statusId)
|
|
|
|
}))
|
2018-03-04 21:52:35 +00:00
|
|
|
return reblogIds.filter(Boolean)
|
2018-02-17 03:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getIdsThatRebloggedThisStatus (instanceName, statusId) {
|
2018-04-17 04:56:21 +01:00
|
|
|
return getReblogsForStatusFromDatabase(instanceName, statusId)
|
2018-02-17 03:38:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getNotificationIdsForStatuses (instanceName, statusIds) {
|
2018-04-17 04:56:21 +01:00
|
|
|
return getNotificationIdsForStatusesFromDatabase(instanceName, statusIds)
|
2018-02-17 03:38:21 +00:00
|
|
|
}
|