Message class
Represents a message.
Properties
id: string
It's the unique identifier of the message on Stringee system.
localId: string
It's the unique identifier of the message on local database.
conversationId: string
It's the unique identifier of the conversation have this message on Stringee system.
sender: string
It's the unique identifier of the user send this message.
createdAt: number
It's the time create the message.
sequence: number
It's sequence of the message.
state: number
It's status of the message:
- INITIALIZE(state = 0): The message is initialized
- SENDING(state = 1): The message is sent by the sender
- SENT(state = 2): The message is sent to Stringee server
- DELIVERED(state = 3): The message is delivered to the recipient
- READ(state = 4): The message is read by the recipient
type: number
It's type of the message:
- type = 1: Text.
- type = 2: Photo.
- type = 3: Video.
- type = 4: Audio.
- type = 5: File.
- type = 6: Link.
- type = 7: Conversation creation notification.
- type = 8: Conversation rename notification.
- type = 9: Location.
- type = 10: Contact.
- type = 11: Sticker.
- type = 100: Notification
content: string
It's content of the message.
Methods
editMessage(newContent: string): Promise<void>
Edit message's content.
pinMessage(pin: boolean): Promise<void>
Pin/Unpin a message:
- true: pin message.
- false: unpin message.