[DirectMessage] Fix some wrong calls after MessageModel introduction in d9a9a3746b
This commit is contained in:
parent
68dfaff413
commit
5396f3c9d1
@ -36,14 +36,14 @@ class MessageCommand extends Command
|
|||||||
|
|
||||||
$this->text = $this->user->shortenLinks($this->text);
|
$this->text = $this->user->shortenLinks($this->text);
|
||||||
|
|
||||||
if (Message::contentTooLong($this->text)) {
|
if (MessageModel::contentTooLong($this->text)) {
|
||||||
// XXX: i18n. Needs plural support.
|
// XXX: i18n. Needs plural support.
|
||||||
// TRANS: Message given if content is too long. %1$sd is used for plural.
|
// TRANS: Message given if content is too long. %1$sd is used for plural.
|
||||||
// TRANS: %1$d is the maximum number of characters, %2$d is the number of submitted characters.
|
// TRANS: %1$d is the maximum number of characters, %2$d is the number of submitted characters.
|
||||||
$channel->error($this->user, sprintf(_m('Message too long - maximum is %1$d character, you sent %2$d.',
|
$channel->error($this->user, sprintf(_m('Message too long - maximum is %1$d character, you sent %2$d.',
|
||||||
'Message too long - maximum is %1$d characters, you sent %2$d.',
|
'Message too long - maximum is %1$d characters, you sent %2$d.',
|
||||||
Message::maxContent()),
|
MessageModel::maxContent()),
|
||||||
Message::maxContent(), mb_strlen($this->text)));
|
MessageModel::maxContent(), mb_strlen($this->text)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ class MessageCommand extends Command
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$message = Message::saveNew($this->user->id, $other->id, $this->text, $channel->source());
|
$message = MessageModel::saveNew(Profile::getByID($this->user->id), $this->text, $channel->source());
|
||||||
$message->notify();
|
$message->notify();
|
||||||
// TRANS: Message given have sent a direct message to another user.
|
// TRANS: Message given have sent a direct message to another user.
|
||||||
// TRANS: %s is the name of the other user.
|
// TRANS: %s is the name of the other user.
|
||||||
|
@ -98,16 +98,16 @@ class Group_message extends Managed_DataObject
|
|||||||
|
|
||||||
// We use the same limits as for 'regular' private messages.
|
// We use the same limits as for 'regular' private messages.
|
||||||
|
|
||||||
if (Message::contentTooLong($text)) {
|
if (MessageModel::contentTooLong($text)) {
|
||||||
// TRANS: Exception thrown when trying to send group private message that is too long.
|
// TRANS: Exception thrown when trying to send group private message that is too long.
|
||||||
// TRANS: %d is the maximum meggage length.
|
// TRANS: %d is the maximum meggage length.
|
||||||
throw new Exception(sprintf(
|
throw new Exception(sprintf(
|
||||||
_m(
|
_m(
|
||||||
'That\'s too long. Maximum message size is %d character.',
|
'That\'s too long. Maximum message size is %d character.',
|
||||||
'That\'s too long. Maximum message size is %d characters.',
|
'That\'s too long. Maximum message size is %d characters.',
|
||||||
Message::maxContent()
|
MessageModel::maxContent()
|
||||||
),
|
),
|
||||||
Message::maxContent()
|
MessageModel::maxContent()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ class GroupMessageForm extends Form
|
|||||||
'name' => 'content'),
|
'name' => 'content'),
|
||||||
($this->content) ? $this->content : '');
|
($this->content) ? $this->content : '');
|
||||||
|
|
||||||
$contentLimit = Message::maxContent();
|
$contentLimit = MessageModel::maxContent();
|
||||||
|
|
||||||
if ($contentLimit > 0) {
|
if ($contentLimit > 0) {
|
||||||
$this->out->elementStart('dl', 'form_note');
|
$this->out->elementStart('dl', 'form_note');
|
||||||
|
@ -207,7 +207,7 @@ function newMessage($i)
|
|||||||
|
|
||||||
$other = $friends[$j];
|
$other = $friends[$j];
|
||||||
|
|
||||||
$message = Message::saveNew($user->id, $other->id, $content, 'createsim');
|
$message = MessageModel::saveNew(Profile::getByID($user->id), $content, 'createsim');
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
function newSub($i)
|
function newSub($i)
|
||||||
|
Loading…
Reference in New Issue
Block a user