starMessage method

Future<String> starMessage(
  1. String conversationId,
  2. String messageId, {
  3. bool star = true,
})

Star/unstar message. Returns the star ID when starring, empty string when unstarring.

Implementation

Future<String> starMessage(
  String conversationId,
  String messageId, {
  bool star = true,
}) async {
  _ensureInitialized();
  if (star) {
    // Update local state immediately for optimistic UI
    await _database.updateMessage(messageId, isStarred: true);
    // Call adapter directly and return the star ID
    return await _registry.adapter.starMessage(conversationId, messageId);
  } else {
    // For unstarring, caller should use unstarMessage with starId
    return '';
  }
}