openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 1.01 kB
JavaScript
import { c as buildControlUiUserAvatarPath } from "./control-ui-contract-zYW4RcpK.js";
//#region src/gateway/authenticated-presence-user.ts
function buildAuthenticatedPresenceUser(params) {
if (!params.authenticatedUserProfile) {
if (!params.authenticatedUserId) return;
return {
id: params.authenticatedUserId,
...params.authenticatedUserIsTailscaleProvider ? {} : { email: params.authenticatedUserId }
};
}
return {
id: params.authenticatedUserProfile.profileId,
identity: {
type: "profile",
id: params.authenticatedUserProfile.profileId
},
...params.authenticatedUserId && !params.authenticatedUserIsTailscaleProvider ? { email: params.authenticatedUserId } : {},
...params.authenticatedUserProfile.displayName ? { name: params.authenticatedUserProfile.displayName } : {},
avatarUrl: buildControlUiUserAvatarPath(params.authenticatedUserProfile.profileId, params.authenticatedUserProfile.avatarRevision)
};
}
//#endregion
export { buildAuthenticatedPresenceUser as t };