From 96f11e757cd28ad3e6ce6ad243ee8bd459d3b124 Mon Sep 17 00:00:00 2001 From: David Baker Date: Sun, 13 Nov 2022 20:38:01 +0000 Subject: [bugfix] Fix login on Mastodon iOS app for users with no statuses (#1042) * Fix login on Mastodon iOS app for users with no statuses Mastodon for iOS can't cope with an empty string for a date and expect a JSON `null` instead. Fixes https://github.com/superseriousbusiness/gotosocial/issues/1010 * Fix expected values in tests to match --- internal/typeutils/internaltofrontend.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/typeutils/internaltofrontend.go') diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index e22813549..b2e2279bb 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -105,10 +105,11 @@ func (c *converter) AccountToAPIAccountPublic(ctx context.Context, a *gtsmodel.A } // check when the last status was - var lastStatusAt string + var lastStatusAt *string lastPosted, err := c.db.GetAccountLastPosted(ctx, a.ID, false) if err == nil && !lastPosted.IsZero() { - lastStatusAt = util.FormatISO8601(lastPosted) + lastStatusAtTemp := util.FormatISO8601(lastPosted) + lastStatusAt = &lastStatusAtTemp } // set account avatar fields if available -- cgit v1.2.3