X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fnewmessage.php;h=25e58feab30c294ec6ef7bec4857a29de5316760;hb=a9bb1c75282a642d34b88fee2a7ca31ab7c2a0fb;hp=37fca1ca2b8b34ff9a06ece73ef3394fb463cda4;hpb=5f5413624d166a9b2116d266c7698dd6dcd2d8c4;p=quix0rs-gnu-social.git diff --git a/actions/newmessage.php b/actions/newmessage.php index 37fca1ca2b..25e58feab3 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -113,7 +113,7 @@ class NewmessageAction extends Action $this->other = User::staticGet('id', $this->to); if (!$this->other) { - $this->clientError(_('No such user'), 404); + $this->clientError(_('No such user.'), 404); return false; } @@ -173,7 +173,7 @@ class NewmessageAction extends Action return; } - $this->notify($user, $this->other, $message); + $message->notify(); if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); @@ -182,7 +182,7 @@ class NewmessageAction extends Action $this->elementEnd('head'); $this->elementStart('body'); $this->element('p', array('id' => 'command_result'), - sprintf(_('Direct message to %s sent'), + sprintf(_('Direct message to %s sent.'), $this->other->nickname)); $this->elementEnd('body'); $this->elementEnd('html'); @@ -224,15 +224,14 @@ class NewmessageAction extends Action $this->msg = $msg; if ($this->trimmed('ajax')) { - $this->startHTML('text/xml;charset=UTF-8'); + header('Content-Type: text/xml;charset=utf-8'); + $this->xw->startDocument('1.0', 'UTF-8'); + $this->elementStart('html'); $this->elementStart('head'); $this->element('title', null, _('New message')); $this->elementEnd('head'); $this->elementStart('body'); - if (common_logged_in()) { - $this->showNoticeForm(); - } - $this->elementEnd('div'); + $this->showNoticeForm(); $this->elementEnd('body'); $this->endHTML(); } @@ -248,12 +247,6 @@ class NewmessageAction extends Action } } - function notify($from, $to, $message) - { - mail_notify_message($message, $from, $to); - // XXX: Jabber, SMS notifications... probably queued - } - // Do nothing (override) function showNoticeForm()