From c212c9846337f2d04796dfa69be006e882abeaca Mon Sep 17 00:00:00 2001
From: Lanre Adelowo <adelowomailbox@gmail.com>
Date: Sat, 19 Jan 2019 20:16:46 +0100
Subject: [PATCH] Fix wording when user is unassigned from an issue (#5769)

Previous Gitea would display that the user had unassigned themselves even if the actor
was not the user. Fixes #4418
---
 options/locale/locale_en-US.ini                 | 3 ++-
 templates/repo/issue/view_content/comments.tmpl | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 151629ea6d..0c32f3f5fd 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -692,7 +692,8 @@ issues.remove_milestone_at = `removed this from the <b>%s</b> milestone %s`
 issues.deleted_milestone = `(deleted)`
 issues.self_assign_at = `self-assigned this %s`
 issues.add_assignee_at = `was assigned by <b>%s</b> %s`
-issues.remove_assignee_at = `removed their assignment %s`
+issues.remove_assignee_at = `was unassigned by <b>%s</b> %s`
+issues.remove_self_assignment = `removed their assignment %s`
 issues.change_title_at = `changed title from <b>%s</b> to <b>%s</b> %s`
 issues.delete_branch_at = `deleted branch <b>%s</b> %s`
 issues.open_tab = %d Open
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 953aa4c2f0..facc3e2dab 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -124,7 +124,11 @@
 					</a>
 					<span class="text grey">
 						<a href="{{.Assignee.HomeLink}}">{{.Assignee.Name}}</a>
-						{{$.i18n.Tr "repo.issues.remove_assignee_at" $createdStr | Safe}}
+						{{ if eq .Poster.ID .Assignee.ID }}
+							{{$.i18n.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
+						{{ else }}
+							{{$.i18n.Tr "repo.issues.remove_assignee_at" .Poster.Name $createdStr | Safe}}
+						{{ end }}
 					</span>
 				{{else}}
 					<a class="ui avatar image" href="{{.Assignee.HomeLink}}">