|
|
@@ -22,6 +22,7 @@ export class ContentItem {
|
|
|
public readonly fromContactId?: string;
|
|
|
public readonly toContactId?: string;
|
|
|
public readonly media?: string;
|
|
|
+ public readonly relTargets: any;
|
|
|
|
|
|
constructor(hash: string, props: ContentParams) {
|
|
|
this.data = props;
|
|
|
@@ -48,6 +49,10 @@ export class ContentItem {
|
|
|
this.fromContactId = this.allLinks.filter(x => x.rel === '.from-contact-id').map(x => x.target)[0];
|
|
|
this.toContactId = this.allLinks.filter(x => x.rel === '.to-contact-id').map(x => x.target)[0];
|
|
|
this.media = this.allLinks.filter(x => x.rel === '.media').map(x => x.target)[0];
|
|
|
+ this.relTargets = this.allLinks.reduce((accum, link) => {
|
|
|
+ accum[link.rel] = link.target;
|
|
|
+ return accum;
|
|
|
+ }, {});
|
|
|
if (this.fromTarget && this.toTarget && this.media) {
|
|
|
this.repliable = true;
|
|
|
} else {
|