Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

Merge pull request #1514 from gitroomhq/feat/creation-method-tracking

Nevo David715d3e40fd11
diff --cc libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts
index 5f4694bac,a4896849a..0e8100efc
--- a/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts
+++ b/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts
@@@ -740,23 -738,17 +747,27 @@@ export class PostsService
} catch (err) {}
}
- async createPost(orgId: string, body: CreatePostDto): Promise<any[]> {
+ async createPost(
+ orgId: string,
+ body: CreatePostDto,
+ creationMethod: CreationMethod
+ ): Promise<any[]> {
const postList = [];
for (const post of body.posts) {
+ const provider = this._integrationManager.getSocialIntegration(
+ (post.settings as any)?.__type
+ );
+ const removeLinks = !!provider?.stripLinks?.();
+
const messages = (post.value || []).map((p) => p.content);
- const updateContent = !body.shortLink
- ? messages
- : await this._shortLinkService.convertTextToShortLinks(orgId, messages);
+ // No point shortlinking links on platforms that strip them out anyway
+ const updateContent =
+ !body.shortLink || removeLinks
+ ? messages
+ : await this._shortLinkService.convertTextToShortLinks(
+ orgId,
+ messages
+ );
post.value = (post.value || []).map((p, i) => ({
...p,