1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

Auto-subscription: little less verbose

Summary:
When the user "Mrs. Kitten" adds or remove "Mrs. Kitten" as Subscriber,
usually these messages were generated:

    Mrs. Kitten added a subscriber: Mrs. Kitten.
    Mrs. Kitten removed a subscriber: Mrs. Kitten.

This was a bit like the Spiderman meme self-pointing Spiderman.

After this change, these beautiful messages are generated instead:

    Mrs. Kitten subscribed.
    Mrs. Kitten unsubscribed.

| Before    | After     |
| {F286215} | {F286216} |

Closes T15347

Test Plan:
- subscribe on something
- unsubscribe from something
- all other cases remain as-is

Reviewers: O1 Blessed Committers, bfs, speck

Reviewed By: O1 Blessed Committers, bfs, speck

Subscribers: bfs, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15347

Differential Revision: https://we.phorge.it/D25191
This commit is contained in:
Valerio Bozzolan 2023-06-15 11:49:18 +02:00
parent 1c098c273d
commit 7fe622e5d3

View file

@ -1033,12 +1033,22 @@ abstract class PhabricatorApplicationTransaction
count($rem), count($rem),
$this->renderSubscriberList($rem, 'rem')); $this->renderSubscriberList($rem, 'rem'));
} else if ($add) { } else if ($add) {
if ($this->isSelfSubscription()) {
return pht(
'%s subscribed.',
$this->renderHandleLink($author_phid));
}
return pht( return pht(
'%s added %d subscriber(s): %s.', '%s added %d subscriber(s): %s.',
$this->renderHandleLink($author_phid), $this->renderHandleLink($author_phid),
count($add), count($add),
$this->renderSubscriberList($add, 'add')); $this->renderSubscriberList($add, 'add'));
} else if ($rem) { } else if ($rem) {
if ($this->isSelfSubscription()) {
return pht(
'%s unsubscribed.',
$this->renderHandleLink($author_phid));
}
return pht( return pht(
'%s removed %d subscriber(s): %s.', '%s removed %d subscriber(s): %s.',
$this->renderHandleLink($author_phid), $this->renderHandleLink($author_phid),