summaryrefslogtreecommitdiff
path: root/internal/typeutils/internaltofrontend.go
diff options
context:
space:
mode:
authorLibravatar David Baker <dbkr@users.noreply.github.com>2022-11-13 20:38:01 +0000
committerLibravatar GitHub <noreply@github.com>2022-11-13 21:38:01 +0100
commit96f11e757cd28ad3e6ce6ad243ee8bd459d3b124 (patch)
treed05b444b9177b7514b59efd082ecf60507ae5bb1 /internal/typeutils/internaltofrontend.go
parent[chore] bump go-cache to v3.1.7 to fix possible issues with zero value keys (... (diff)
downloadgotosocial-96f11e757cd28ad3e6ce6ad243ee8bd459d3b124.tar.xz
[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
Diffstat (limited to 'internal/typeutils/internaltofrontend.go')
-rw-r--r--internal/typeutils/internaltofrontend.go5
1 files changed, 3 insertions, 2 deletions
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