diff --git a/src/mixins/message-mixin.ts b/src/mixins/message-mixin.ts index 8cae91d3..1ea08662 100644 --- a/src/mixins/message-mixin.ts +++ b/src/mixins/message-mixin.ts @@ -11,6 +11,8 @@ import type { ImageType, } from '../schemas/image.js' import type { + BroadcastStatus, + BroadcastTargetStatus, MessagePayload, MessagePayloadFilterFunction, MessageQueryFilter, @@ -77,6 +79,16 @@ const messageMixin = (bas abstract messageSendText (conversationId: string, text: string, mentionIdList?: string[]) : Promise abstract messageSendUrl (conversationId: string, urlLinkPayload: UrlLinkPayload) : Promise + abstract createMessageBroadcast(targets: string[], content: PostPayload): Promise + abstract getMessageBroadcastStatus(id: string): Promise<{ + status: BroadcastStatus, + detail: { + contactId?: string, + roomId?: string, + status: BroadcastTargetStatus, + }[] + }> + abstract messageRecall (messageId: string) : Promise /** diff --git a/src/mods/types.ts b/src/mods/types.ts index 89823aad..2dbe622d 100644 --- a/src/mods/types.ts +++ b/src/mods/types.ts @@ -9,6 +9,8 @@ import { FriendshipType, ImageType, MessageType, + BroadcastStatus, + BroadcastTargetStatus, PostType, TapType, sayableTypes, @@ -42,6 +44,8 @@ export { export { ScanStatus, + BroadcastStatus, + BroadcastTargetStatus, type FriendshipAddOptions, YOU, CHAT_EVENT_DICT, diff --git a/src/schemas/message.ts b/src/schemas/message.ts index 4d10970f..88053203 100644 --- a/src/schemas/message.ts +++ b/src/schemas/message.ts @@ -166,3 +166,16 @@ export type MessagePayloadFilterFunction = (payload: MessagePayload) => boole /** @hidden */ export type MessagePayloadFilterFactory = (query: MessageQueryFilter) => MessagePayloadFilterFunction + +export enum BroadcastStatus { + Unknown = 0, + Sending = 1, + Sent = 2 +} + +export enum BroadcastTargetStatus { + Unsent = 0, + Sent = 1, + NotFriend = 2, + Occupied = 3, +} diff --git a/src/schemas/mod.ts b/src/schemas/mod.ts index 56bc8959..c00c3509 100644 --- a/src/schemas/mod.ts +++ b/src/schemas/mod.ts @@ -27,6 +27,8 @@ import { type MessagePayloadTo, type MessageQueryFilter, MessageType, + BroadcastStatus, + BroadcastTargetStatus, } from './message.js' import { DirtyType } from './dirty.js' import { @@ -114,6 +116,8 @@ export { isPostPayloadClient, isPostPayloadServer, MessageType, + BroadcastStatus, + BroadcastTargetStatus, PaginationRequest, PaginationResponse, PostType,