addons/isl-server/platform/obsidianServerPlatform.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import type {ServerPlatform} from '../src/serverPlatform';
b69ab319
b69ab3110export const platform: ServerPlatform = {
b69ab3111 platformName: 'obsidian',
b69ab3112
b69ab3113 async handleMessageFromClient(this: ServerPlatform, repo, _ctx, message, _postMessage) {
b69ab3114 switch (message.type) {
b69ab3115 case 'platform/openFile': {
b69ab3116 // For Obsidian, file opening is handled client-side via postMessage
b69ab3117 // Log for debugging purposes
b69ab3118 repo?.initialConnectionContext.logger.log(
b69ab3119 'Obsidian platform: openFile request (handled client-side)',
b69ab3120 message.path,
b69ab3121 );
b69ab3122 break;
b69ab3123 }
b69ab3124 case 'platform/openFiles': {
b69ab3125 repo?.initialConnectionContext.logger.log(
b69ab3126 'Obsidian platform: openFiles request (handled client-side)',
b69ab3127 message.paths,
b69ab3128 );
b69ab3129 break;
b69ab3130 }
b69ab3131 case 'platform/openExternal': {
b69ab3132 repo?.initialConnectionContext.logger.log(
b69ab3133 'Obsidian platform: openExternal request (handled client-side)',
b69ab3134 message.url,
b69ab3135 );
b69ab3136 break;
b69ab3137 }
b69ab3138 // Other platform messages handled by default behavior
b69ab3139 }
b69ab3140 },
b69ab3141};