@@ -209,23 +209,6 @@ async function composeNotification(data: pushNotificationDataMap[keyof pushNotif
|
||||
data,
|
||||
}];
|
||||
|
||||
case 'groupInvited':
|
||||
return [t('_notification.youWereInvitedToGroup', { userName: getUserName(data.body.user) }), {
|
||||
body: data.body.invitation.group.name,
|
||||
badge: iconUrl('users'),
|
||||
data,
|
||||
actions: [
|
||||
{
|
||||
action: 'accept',
|
||||
title: t('accept'),
|
||||
},
|
||||
{
|
||||
action: 'reject',
|
||||
title: t('reject'),
|
||||
},
|
||||
],
|
||||
}];
|
||||
|
||||
case 'app':
|
||||
return [data.body.header ?? data.body.body, {
|
||||
body: data.body.header ? data.body.body : '',
|
||||
|
@@ -32,18 +32,10 @@ export function openAntenna(antennaId: string, loginId: string) {
|
||||
return openClient('push', `/timeline/antenna/${antennaId}`, loginId, { antennaId });
|
||||
}
|
||||
|
||||
export async function openChat(body: any, loginId: string) {
|
||||
if (body.groupId === null) {
|
||||
return openClient('push', `/my/messaging/${getAcct(body.user)}`, loginId, { body });
|
||||
} else {
|
||||
return openClient('push', `/my/messaging/group/${body.groupId}`, loginId, { body });
|
||||
}
|
||||
}
|
||||
|
||||
// post-formのオプションから投稿フォームを開く
|
||||
export async function openPost(options: any, loginId: string) {
|
||||
// クエリを作成しておく
|
||||
let url = `/share?`;
|
||||
let url = '/share?';
|
||||
if (options.initialText) url += `text=${options.initialText}&`;
|
||||
if (options.reply) url += `replyId=${options.reply.id}&`;
|
||||
if (options.renote) url += `renoteId=${options.renote.id}&`;
|
||||
@@ -64,7 +56,7 @@ export async function openClient(order: swMessageOrderType, url: string, loginId
|
||||
|
||||
export async function findClient() {
|
||||
const clients = await self.clients.matchAll({
|
||||
type: 'window'
|
||||
type: 'window',
|
||||
});
|
||||
for (const c of clients) {
|
||||
if (c.url.indexOf('?zen') < 0) return c;
|
||||
|
@@ -118,9 +118,6 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv
|
||||
case 'receiveFollowRequest':
|
||||
await swos.api('following/requests/accept', loginId, { userId: data.body.userId });
|
||||
break;
|
||||
case 'groupInvited':
|
||||
await swos.api('users/groups/invitations/accept', loginId, { invitationId: data.body.invitation.id });
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'reject':
|
||||
@@ -128,9 +125,6 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv
|
||||
case 'receiveFollowRequest':
|
||||
await swos.api('following/requests/reject', loginId, { userId: data.body.userId });
|
||||
break;
|
||||
case 'groupInvited':
|
||||
await swos.api('users/groups/invitations/reject', loginId, { invitationId: data.body.invitation.id });
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'showFollowRequests':
|
||||
@@ -141,9 +135,6 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv
|
||||
case 'receiveFollowRequest':
|
||||
client = await swos.openClient('push', '/my/follow-requests', loginId);
|
||||
break;
|
||||
case 'groupInvited':
|
||||
client = await swos.openClient('push', '/my/groups', loginId);
|
||||
break;
|
||||
case 'reaction':
|
||||
client = await swos.openNote(data.body.note.id, loginId);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user