Skip to content

Commit

Permalink
Do not include embedded content if its not specified. Leave null
Browse files Browse the repository at this point in the history
  • Loading branch information
xforever1313 authored and a-gubskiy committed Nov 27, 2024
1 parent bdd4314 commit 411b44f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/X.Bluesky/BlueskyClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Frozen;
using System.Globalization;
using System.Net.Http.Headers;
using System.Security.Authentication;
using System.Text;
Expand Down Expand Up @@ -127,7 +128,7 @@ private async Task CreatePost(string text, Uri? url)
}

// Fetch the current time in ISO 8601 format, with "Z" to denote UTC
var now = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ");
var now = DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture);
var facetBuilder = new FacetBuilder();

var facets = facetBuilder.GetFacets(text);
Expand Down Expand Up @@ -212,4 +213,4 @@ private async Task CreatePost(string text, Uri? url)
// This throws an exception if the HTTP response status is an error code.
response.EnsureSuccessStatusCode();
}
}
}
2 changes: 1 addition & 1 deletion src/X.Bluesky/Models/Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public record Post

public string CreatedAt { get; set; } = "";

public Embed Embed { get; set; } = new();
public Embed? Embed { get; set; } = null;

public List<string> Langs { get; set; } = new();

Expand Down

0 comments on commit 411b44f

Please sign in to comment.