diff --git a/force-app/main/default/aura/SearchGIPHY/SearchGIPHY.cmp b/force-app/main/default/aura/SearchGIPHY/SearchGIPHY.cmp index 5bcddc6..4bfe302 100644 --- a/force-app/main/default/aura/SearchGIPHY/SearchGIPHY.cmp +++ b/force-app/main/default/aura/SearchGIPHY/SearchGIPHY.cmp @@ -28,7 +28,7 @@
diff --git a/force-app/main/default/aura/SearchGIPHY/SearchGIPHYController.js b/force-app/main/default/aura/SearchGIPHY/SearchGIPHYController.js
index 46d21bf..64a91e7 100644
--- a/force-app/main/default/aura/SearchGIPHY/SearchGIPHYController.js
+++ b/force-app/main/default/aura/SearchGIPHY/SearchGIPHYController.js
@@ -44,8 +44,9 @@
var height = selectedGif.images.original.height;
component.set("v.selectedGifWidth", width);
- component.set("v.selectedGifHeight", height);
- component.set("v.selectedGif", "https://media0.giphy.com/media/" + id + "/giphy.gif");
+ component.set("v.selectedGifHeight", 200);
+ // Force Giphy to return images limited to 200 pixel height to prevent file size limit error
+ component.set("v.selectedGif", "https://media0.giphy.com/media/" + id + "/200.gif");
},
diff --git a/force-app/main/default/classes/ChatterHelper.cls b/force-app/main/default/classes/ChatterHelper.cls
index 86fccc2..2a6d416 100644
--- a/force-app/main/default/classes/ChatterHelper.cls
+++ b/force-app/main/default/classes/ChatterHelper.cls
@@ -9,32 +9,26 @@ public with sharing class ChatterHelper {
Blob imageData = getImageData(imageUrl);
ID fileId = saveFile(fileName, imageData);
- ID postParentId = UserInfo.getUserId();
- FeedItem post = new FeedItem(
- ParentId = postParentId,
- Body = body,
- IsRichText = true
- );
-
- insert post;
+ // Use Salesforce "ConnectApi" class so the animated Gif may be embedded Inline
+ ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
+ messageInput.messageSegments = new List