diff --git a/src/pages/stream/post-menu.ts b/src/pages/stream/post-menu.ts index 9f3d161..092b459 100644 --- a/src/pages/stream/post-menu.ts +++ b/src/pages/stream/post-menu.ts @@ -39,7 +39,7 @@ export class PostMenu { } share() { - (window).shareContentPlugin.share(this.navParams.data.post.content.text, function(e) { + (window).shareContentPlugin.share(this.parsePost(), function(e) { console.log('sharing post:'); console.log(JSON.stringify(e)); }, function(e) { @@ -50,11 +50,26 @@ export class PostMenu { } copy() { - this.clipboardSrv.copyFromContent(this.navParams.data.post.content.text); + this.clipboardSrv.copyFromContent(this.parsePost()); this.presentToast('Post copied'); this.close(); } + parsePost() { + let text = this.navParams.data.post.content.text; + let links = this.navParams.data.post.content.entities.links; + if (links.length > 0) { + for (var i = 0; i < links.length; i++) { + text += "\n"; + if (typeof links[i].title !== "undefined") { + text += links[i].title + " - "; + } + text += links[i].link; + } + } + return text; + } + delete() { pnut.deletePost(this.navParams.data.post.id).then(res => { console.log(res);