Browse Source

Don't echap JIDs when displaying chats, the json encoder is taking care of that

Break infinite loop when joining a chatroom that is not joined yet…
pull/784/head
Timothée Jaussoin 7 years ago
parent
commit
0ac80b9618
  1. 9
      app/widgets/Chat/Chat.php

9
app/widgets/Chat/Chat.php

@ -41,7 +41,6 @@ class Chat extends \Movim\Widget\Base
$this->registerEvent('gone', 'onGone', 'chat');
$this->registerEvent('subject', 'onConferenceSubject', 'chat');
$this->registerEvent('muc_setsubject_handle', 'onConferenceSubject', 'chat');
$this->registerEvent('muc_getconfig_handle', 'onRoomConfig', 'chat');
$this->registerEvent('muc_setconfig_handle', 'onRoomConfigSaved', 'chat');
$this->registerEvent('muc_setconfig_error', 'onRoomConfigError', 'chat');
@ -179,7 +178,7 @@ class Chat extends \Movim\Widget\Base
public function onMucConnected($packet)
{
$this->ajaxGetRoom($packet->content->jid);
$this->ajaxGetRoom($packet->content->jid, false, true);
}
public function onRoomConfigError($packet)
@ -258,14 +257,14 @@ class Chat extends \Movim\Widget\Base
* @brief Get a chatroom
* @param string $jid
*/
public function ajaxGetRoom($room, $light = false)
public function ajaxGetRoom($room, $light = false, $noConnect = false)
{
if (!$this->validateJid($room)) return;
$r = $this->user->session->conferences()->where('conference', $room)->first();
if ($r) {
if (!$r->connected) {
if (!$r->connected && !$noConnect) {
$this->rpc('Rooms_ajaxJoin', $r->conference, $r->nick);
}
@ -583,8 +582,6 @@ class Chat extends \Movim\Widget\Base
$view->assign('jid', $jid);
$jid = echapJS($jid);
$view->assign('smiley', $this->call('ajaxSmiley'));
$view->assign('emoji', prepareString('😀'));
$view->assign('muc', $muc);

Loading…
Cancel
Save