- $url = common_local_url('outbox', array('nickname' => $user->nickname));
-
- common_redirect($url, 303);
+ if ($this->boolean('ajax')) {
+ $this->startHTML('text/xml;charset=utf-8');
+ $this->elementStart('head');
+ // TRANS: Page title after sending a direct message.
+ $this->element('title', null, _('Message sent'));
+ $this->elementEnd('head');
+ $this->elementStart('body');
+ $this->element('p', array('id' => 'command_result'),
+ // TRANS: Confirmation text after sending a direct message.
+ // TRANS: %s is the direct message recipient.
+ sprintf(_('Direct message to %s sent.'),
+ $this->other->nickname));
+ $this->elementEnd('body');
+ $this->elementEnd('html');
+ } else {
+ $url = common_local_url('outbox',
+ array('nickname' => $user->nickname));
+ common_redirect($url, 303);
+ }