saveMessage static method
Future<BaseMessage?>
saveMessage(
- int messageId, {
- dynamic onSuccess()?,
- dynamic onError(
- CometChatException excep
Save (bookmark) a message for the logged-in user.
Saves are private and per-viewer — no other member is notified, and any
readable message (own or others') can be saved. The returned message
carries savedAt stamped. Idempotent. On the cap error
ERR_SAVED_MESSAGES_LIMIT_EXCEEDED, errorParams carries the limit.
Reports through onSuccess only: this device fires no
MessageListener.onMessageSaved for its own call. The server self-echoes
a socket frame, so the user's other devices do fire it.
Implementation
static Future<BaseMessage?> saveMessage(
int messageId, {
Function(BaseMessage message)? onSuccess,
Function(CometChatException e)? onError,
}) {
return _pinSaveFacadeCall(
messageId,
'saved',
(sdk, id) => sdk.messages.saveMessage(id),
onSuccess,
onError,
);
}