We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit d9619258 authored by Brion Vibber's avatar Brion Vibber

Ticket #2899: clean up inbox/outbox DM form a bit:

- "To" drop-down list now defaults to showing "Select recipient:" instead of the first person on your list, reducing liklihood of accidentally sending a message to the wrong person.
- When there are no mutual subscribers to send to, instead of an empty list the list now shows 'No mutual subscribers.'

In both cases, attempting to send when the default is selected displays an error message.
I'm not disabling form elements in part because our themes right now don't show disabled button state correctly; we might want to tighten that up a bit more once fixed.
parent 573f98c5
......@@ -133,6 +133,8 @@ class MessageForm extends Form
$mutual_users = $user->mutuallySubscribedUsers();
$mutual = array();
// TRANS Label entry in drop-down selection box in direct-message inbox/outbox. This is the default entry in the drop-down box, doubling as instructions and a brake against accidental submissions with the first user in the list.
$mutual[0] = _('Select recipient:');
while ($mutual_users->fetch()) {
if ($mutual_users->id != $user->id) {
......@@ -143,6 +145,11 @@ class MessageForm extends Form
if (count($mutual) == 1) {
// TRANS Entry in drop-down selection box in direct-message inbox/outbox when no one is available to message.
$mutual[0] = _('No mutual subscribers.');
$this->out->dropdown('to', _('To'), $mutual, null, false,
($this->to) ? $this->to->id : null);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment