diff options
| author | 2023-04-14 08:14:11 +0200 | |
|---|---|---|
| committer | 2023-04-14 08:14:11 +0200 | |
| commit | 815c39d0c6622169dfab9d0446ace3483ffb7554 (patch) | |
| tree | 5d220dbb9d250348d0c0d11b43c80cfb02aae16c /mastoapi.c | |
| parent | Fixed crash in notify_get(). (diff) | |
| download | snac2-815c39d0c6622169dfab9d0446ace3483ffb7554.tar.gz snac2-815c39d0c6622169dfab9d0446ace3483ffb7554.tar.xz snac2-815c39d0c6622169dfab9d0446ace3483ffb7554.zip | |
Added a dummy 'created_at' field for accounts that don't have a date.
This avoid a crash in Tusky.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -432,6 +432,11 @@ xs_dict *mastoapi_account(const xs_dict *actor) | |||
| 432 | 432 | ||
| 433 | if (pub) | 433 | if (pub) |
| 434 | acct = xs_dict_append(acct, "created_at", pub); | 434 | acct = xs_dict_append(acct, "created_at", pub); |
| 435 | else { | ||
| 436 | /* unset created_at crashes Tusky, so lie like a mf */ | ||
| 437 | xs *date = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); | ||
| 438 | acct = xs_dict_append(acct, "created_at", date); | ||
| 439 | } | ||
| 435 | 440 | ||
| 436 | acct = xs_dict_append(acct, "note", xs_dict_get(actor, "summary")); | 441 | acct = xs_dict_append(acct, "note", xs_dict_get(actor, "summary")); |
| 437 | acct = xs_dict_append(acct, "url", id); | 442 | acct = xs_dict_append(acct, "url", id); |