UsersController optimisations
This commit is contained in:
parent
264320b1bf
commit
95eb63e502
1 changed files with 5 additions and 6 deletions
|
@ -158,7 +158,8 @@ namespace BirdsiteLive.Controllers
|
||||||
if (tweet == null)
|
if (tweet == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
|
|
||||||
var user = await _twitterUserService.GetUserAsync(id);
|
if (tweet.Author.Acct != id)
|
||||||
|
return NotFound();
|
||||||
|
|
||||||
var status = _statusService.GetStatus(id, tweet);
|
var status = _statusService.GetStatus(id, tweet);
|
||||||
|
|
||||||
|
@ -178,8 +179,8 @@ namespace BirdsiteLive.Controllers
|
||||||
{
|
{
|
||||||
Text = tweet.MessageContent,
|
Text = tweet.MessageContent,
|
||||||
OgUrl = $"https://twitter.com/{id}/status/{statusId}",
|
OgUrl = $"https://twitter.com/{id}/status/{statusId}",
|
||||||
UserProfileImage = user.ProfileImageUrl,
|
UserProfileImage = tweet.Author.ProfileImageUrl,
|
||||||
UserName = user.Name,
|
UserName = tweet.Author.Name,
|
||||||
};
|
};
|
||||||
return View(displayTweet);
|
return View(displayTweet);
|
||||||
}
|
}
|
||||||
|
@ -233,8 +234,6 @@ namespace BirdsiteLive.Controllers
|
||||||
if (tweet == null)
|
if (tweet == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
|
|
||||||
var user = await _twitterUserService.GetUserAsync(id);
|
|
||||||
|
|
||||||
var status = _statusService.GetActivity(id, tweet);
|
var status = _statusService.GetActivity(id, tweet);
|
||||||
|
|
||||||
var jsonApUser = JsonSerializer.Serialize(status);
|
var jsonApUser = JsonSerializer.Serialize(status);
|
||||||
|
|
Loading…
Add table
Reference in a new issue