import {base64} from '@ciscospark/common';


export function constructActivityEventData(activity) {
  const hydraActivity = Object.assign({}, activity);

  // Base64 encode uuids
  hydraActivity.id = base64.encode(`ciscospark://us/MESSAGE/${activity.id}`);
  hydraActivity.roomId = base64.encode(`ciscospark://us/ROOM/${activity.target.id}`);
  hydraActivity.target.id = base64.encode(`ciscospark://us/ROOM/${activity.target.id}`);

  return hydraActivity;
}

import {base64} from '@ciscospark/common';


export function constructActivityEventData(activity) {
  const hydraActivity = Object.assign({}, activity);

  // Base64 encode uuids
  hydraActivity.id = base64.encode(`ciscospark://us/MESSAGE/${activity.id}`);
  hydraActivity.roomId = base64.encode(`ciscospark://us/ROOM/${activity.target.id}`);
  hydraActivity.target = Object.assign({}, activity.target, {
    id: base64.encode(`ciscospark://us/ROOM/${activity.target.id}`)
  });

  return hydraActivity;
}

Fix overwriting issue with target id
fix(widget-message): Fix overwriting issue with target id
