From a68a09a83ef2eb411e2a7a66e919f27c040c0b6a Mon Sep 17 00:00:00 2001 From: r Date: Sat, 8 Feb 2020 11:50:14 +0000 Subject: Remove account relationship buttons for logged in user's page --- renderer/model.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'renderer') diff --git a/renderer/model.go b/renderer/model.go index 4ff73c3..842dd71 100644 --- a/renderer/model.go +++ b/renderer/model.go @@ -31,6 +31,15 @@ type CommonData struct { NavbarData *NavbarData } +func (c CommonData) IsCurrentUser(id string) bool { + if c.NavbarData != nil && + c.NavbarData.User != nil && + c.NavbarData.User.ID == id { + return true + } + return false +} + type ErrorData struct { *CommonData Error string @@ -69,12 +78,13 @@ type NotificationData struct { type UserData struct { *CommonData - User *mastodon.Account - Type string - Users []*mastodon.Account - Statuses []*mastodon.Status - NextLink string - DarkMode bool + User *mastodon.Account + IsCurrent bool + Type string + Users []*mastodon.Account + Statuses []*mastodon.Status + NextLink string + DarkMode bool } type UserSearchData struct { -- cgit v1.2.3