-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Envelop } from '@dm3-org/dm3-lib-messaging'; | ||
import { | ||
StorageAPI, | ||
StorageEnvelopContainer as StorageEnvelopContainerNew, | ||
} from '@dm3-org/dm3-lib-storage'; | ||
export enum MessageActionType { | ||
NEW = 'NEW', | ||
EDIT = 'EDIT', | ||
DELETE = 'DELETE_REQUEST', | ||
REPLY = 'REPLY', | ||
REACT = 'REACTION', | ||
NONE = 'NONE', | ||
} | ||
|
||
export enum MessageIndicator { | ||
SENT = 'SENT', | ||
RECEIVED = 'RECEIVED', | ||
READED = 'READED', | ||
} | ||
//Message source to identify where a message comes from. This is important to handle pagination of storage messages properly | ||
export enum MessageSource { | ||
//Messages added by the client via addMessage | ||
Client, | ||
//Messages fetched from the storage | ||
Storage, | ||
//Messages fetched from the deliveryService | ||
DeliveryService, | ||
//Messages received from the Websocket | ||
WebSocket, | ||
} | ||
|
||
export type MessageModel = StorageEnvelopContainerNew & { | ||
reactions: Envelop[]; | ||
replyToMessageEnvelop?: Envelop; | ||
source: MessageSource; | ||
indicator?: MessageIndicator; | ||
}; |