summaryrefslogtreecommitdiffstats
path: root/models/issues
diff options
context:
space:
mode:
authorPanagiotis "Ivory" Vasilopoulos <git@n0toose.net>2023-08-10 21:20:01 +0000
committerGitHub <noreply@github.com>2023-08-10 21:20:01 +0000
commit2cbd377e1f8d01c1e4a472f6ca5d770af63dbea4 (patch)
tree8a3c22f72370c2e6338f41f9db566919b346e9be /models/issues
parent7a69d71733b5a01b6bb9a9b32c4e13afa5fe6c96 (diff)
downloadgitea-2cbd377e1f8d01c1e4a472f6ca5d770af63dbea4.tar.gz
gitea-2cbd377e1f8d01c1e4a472f6ca5d770af63dbea4.zip
Always show usernames in reaction tooltips (#26444)
Even if GetDisplayName() is normally preferred elsewhere, this change provides more consistency, as usernames are also always being shown when participating in a conversation taking place in an issue or a pull request. This change makes conversations easier to follow, as you would not have to have a mental association between someone's username and someone's real name in order to follow what is happening. This behavior matches GitHub's. Optimally, both the username and the full name (if applicable) could be shown, but such an effort is a much bigger task that needs to be thought out well.
Diffstat (limited to 'models/issues')
-rw-r--r--models/issues/reaction.go2
-rw-r--r--models/issues/reaction_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/issues/reaction.go b/models/issues/reaction.go
index 293dfa3fd1..28da696366 100644
--- a/models/issues/reaction.go
+++ b/models/issues/reaction.go
@@ -377,7 +377,7 @@ func (list ReactionList) GetFirstUsers() string {
if buffer.Len() > 0 {
buffer.WriteString(", ")
}
- buffer.WriteString(reaction.User.DisplayName())
+ buffer.WriteString(reaction.User.Name)
if rem--; rem == 0 {
break
}
diff --git a/models/issues/reaction_test.go b/models/issues/reaction_test.go
index ddd0e2d04c..e397568ac0 100644
--- a/models/issues/reaction_test.go
+++ b/models/issues/reaction_test.go
@@ -109,7 +109,7 @@ func TestIssueReactionCount(t *testing.T) {
reactions := reactionsList.GroupByType()
assert.Len(t, reactions["heart"], 4)
assert.Equal(t, 2, reactions["heart"].GetMoreUserCount())
- assert.Equal(t, user1.DisplayName()+", "+user2.DisplayName(), reactions["heart"].GetFirstUsers())
+ assert.Equal(t, user1.Name+", "+user2.Name, reactions["heart"].GetFirstUsers())
assert.True(t, reactions["heart"].HasUser(1))
assert.False(t, reactions["heart"].HasUser(5))
assert.False(t, reactions["heart"].HasUser(0))