|
|
@ -1012,8 +1012,7 @@ class Chat extends \Movim\Widget\Base |
|
|
|
->first(); |
|
|
|
|
|
|
|
if ($contextMessage) { |
|
|
|
$this->rpc('MovimTpl.fill', '#' . cleanupId($jid) . '-conversation', ''); |
|
|
|
$this->ajaxGetHistory($jid, $contextMessage->published, muc: $contextMessage->isMuc(), prepend: false, tryMam: false); |
|
|
|
$this->ajaxGetHistory($jid, $contextMessage->published, muc: $contextMessage->isMuc(), prepend: false, tryMam: false, clear: true); |
|
|
|
$this->rpc('Chat.scrollAndBlinkMessageMid', $mid); |
|
|
|
$this->rpc('MovimUtils.addClass', '#chat_widget .contained', 'history'); |
|
|
|
} |
|
|
@ -1025,7 +1024,7 @@ class Chat extends \Movim\Widget\Base |
|
|
|
* @param string jid |
|
|
|
* @param string time |
|
|
|
*/ |
|
|
|
public function ajaxGetHistory(string $jid, ?string $date = null, bool $muc = false, bool $prepend = true, bool $tryMam = true) |
|
|
|
public function ajaxGetHistory(string $jid, ?string $date = null, bool $muc = false, bool $prepend = true, bool $tryMam = true, ?bool $clear = false) |
|
|
|
{ |
|
|
|
if (!validateJid($jid)) return; |
|
|
|
|
|
|
@ -1049,6 +1048,10 @@ class Chat extends \Movim\Widget\Base |
|
|
|
$this->prepareMessage($message); |
|
|
|
} |
|
|
|
|
|
|
|
if ($clear) { |
|
|
|
$this->rpc('MovimTpl.fill', '#' . cleanupId($jid) . '-conversation', ''); |
|
|
|
} |
|
|
|
|
|
|
|
$this->rpc('Chat.appendMessagesWrapper', $this->_wrapper, $prepend); |
|
|
|
$this->_wrapper = []; |
|
|
|
} |
|
|
|